PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/WorldView/Structures/Chest.cs

#
C# | 137 lines | 124 code | 13 blank | 0 comment | 0 complexity | 45a452d6588eefe75fefd394e06ec89b MD5 | raw file
  1using System;
  2using System.Collections.Generic;
  3using System.Drawing;
  4
  5namespace MoreTerra.Structures
  6{
  7	public enum ChestType
  8	{
  9		Unknown = -1,
 10		Chest = 0,
 11		GoldChest,
 12		LockedGoldChest,
 13		ShadowChest,
 14		LockedShadowChest,
 15        Barrel = 5,
 16        TrashCan,
 17        EbonwoodChest,
 18        RichMahoganyChest,
 19        PearlwoodChest,
 20        IvyChest = 10,
 21        IceChest,
 22        LivingWoodChest,
 23        SkywareChest,
 24        ShadewoodChest,
 25        WebCoveredChest = 15,
 26        LihzahrdChest,
 27        WaterChest,
 28        JungleChest,
 29        CorruptionChest,
 30        CrimsonChest = 20,
 31        HallowedChest,
 32        FrozenChest,
 33        LockedJungleChest,
 34        LockedCorruptionChest,
 35        LockedCrimsonChest = 25,
 36        LockedHallowedChest,
 37        LockedFrozenChest = 27
 38	}
 39
 40
 41    public class Chest
 42    {
 43		private Boolean activeChest;
 44        private int chestId;
 45        private Point coordinates;
 46        private List<Item> items;
 47		private ChestType chestType;
 48
 49
 50		#region Constructors
 51        public Chest(int chestId, Point coordinates)
 52        {
 53			this.activeChest = true;
 54            this.chestId = chestId;
 55            this.coordinates = coordinates;
 56            this.items = new List<Item>();
 57			this.chestType = ChestType.Unknown;
 58        }
 59
 60		public Chest()
 61		{
 62			this.chestId = 0;
 63			this.items = new List<Item>();
 64			this.chestType = ChestType.Unknown;
 65		}
 66		#endregion
 67
 68        public void AddItem(Item item)
 69        {
 70            this.items.Add(item);
 71        }
 72
 73		#region GetSet Functions
 74        public string Name { get; set; }
 75
 76        public Point Coordinates
 77        {
 78            get
 79            {
 80                return this.coordinates;
 81            }
 82			set
 83			{
 84				this.coordinates = value;
 85			}
 86        }
 87
 88        public List<Item> Items
 89        {
 90            get
 91            {
 92                return this.items;
 93            }
 94			set
 95			{
 96				this.items = value;
 97			}
 98        }
 99
100        public int ChestId
101        {
102            get
103            {
104                return this.chestId;
105            }
106			set
107			{
108				this.chestId = value;
109			}
110        }
111
112		public Boolean Active
113		{
114			get
115			{
116				return this.activeChest;
117			}
118			set
119			{
120				this.activeChest = value;
121			}
122		}
123
124		public ChestType Type
125		{
126			get
127			{
128				return this.chestType;
129			}
130			set
131			{
132				this.chestType = value;
133			}
134		}
135		#endregion
136    }
137}