PageRenderTime 23ms CodeModel.GetById 18ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/WorldView/Structures/NPC.cs

#
C# | 153 lines | 140 code | 13 blank | 0 comment | 0 complexity | 990b4d0609e897aef8aadc0a3cd2be4b MD5 | raw file
  1using System;
  2using System.Drawing;
  3
  4namespace MoreTerra.Structures
  5{
  6	public enum NPCType
  7	{
  8        ArmsDealer = 0,
  9		Clothier,
 10        Cyborg,
 11		Demolitionist,
 12		Dryad,
 13        DyeTrader = 5,
 14        GoblinTinkerer,
 15		Guide,
 16		Mechanic,
 17		Merchant,
 18        Nurse = 10,
 19        OldMan,
 20        Painter,
 21        PartyGirl,
 22        Pirate,
 23        SantaClaus = 15,
 24        Steampunker,
 25        Truffle,
 26        WitchDoctor,
 27		Wizard,
 28        Unknown = 20
 29	}
 30		
 31	public class NPC
 32	{
 33		private Int32 npcId;
 34		private Boolean activeNpc;
 35		private String npcName;
 36		private PointSingle npcPosition;
 37
 38		private Boolean isNpcHomeless;
 39		private Point npcHomeTile;
 40		private NPCType npcType;
 41
 42		#region Constructors
 43		public NPC()
 44		{
 45			npcId = -1;
 46			activeNpc = false;
 47			npcName = String.Empty;
 48			npcPosition = new PointSingle(0, 0);
 49			isNpcHomeless = false;
 50			npcHomeTile = new Point(0, 0);
 51			npcType = NPCType.Unknown;
 52		}
 53
 54		public NPC(Int32 id, Boolean active, String name, PointSingle pos, Boolean homeless, Point home)
 55		{
 56			npcId = id;
 57			activeNpc = active;
 58			npcName = name;
 59			isNpcHomeless = homeless;
 60			npcHomeTile = home;
 61			npcPosition = pos;
 62			npcType = NPCType.Unknown;
 63		}
 64		#endregion
 65
 66		#region GetSet Functions
 67		public Int32 Id
 68		{
 69			get
 70			{
 71				return npcId;
 72			}
 73			set
 74			{
 75				npcId = value;
 76			}
 77		}
 78
 79		public Boolean Homeless
 80		{
 81			get
 82			{
 83				return isNpcHomeless;
 84			}
 85			set
 86			{
 87				isNpcHomeless = value;
 88			}
 89		}
 90			
 91		public PointSingle Position
 92		{
 93			get
 94			{
 95				return npcPosition;
 96			}
 97			set
 98			{
 99				npcPosition = value;
100			}
101		}
102
103		public Point HomeTile
104		{
105			get
106			{
107				return npcHomeTile;
108			}
109			set
110			{
111				npcHomeTile = value;
112			}
113		}
114
115		public Boolean Active
116		{
117			get
118			{
119				return activeNpc;
120		}
121			set
122			{
123				activeNpc = value;
124			}
125		}
126
127		public String Name
128		{
129			get
130			{
131				return npcName;
132			}
133			set
134			{
135				npcName = value;
136			}
137		}
138
139		public NPCType Type
140		{
141			get
142			{
143				return npcType;
144			}
145			set
146			{
147				npcType = value;
148			}
149		}
150		#endregion
151
152	}
153}