PageRenderTime 80ms CodeModel.GetById 40ms app.highlight 3ms RepoModel.GetById 28ms app.codeStats 1ms

/WorldView/Structures/Item.cs

#
C# | 94 lines | 84 code | 10 blank | 0 comment | 2 complexity | 0da8a7bd33d2eb6c9c57fa6d820cc729 MD5 | raw file
 1using System;
 2
 3namespace MoreTerra.Structures
 4{
 5    public class Item
 6    {
 7        private string name;
 8        private int count;
 9		private Int32 id;
10		private Byte prefix;
11
12		#region Constructors
13        public Item(string name, int count, byte prefix)
14        {
15            this.name = name;
16            this.count = count;
17			this.prefix = prefix;
18        }
19
20		public Item()
21		{
22			this.name = null;
23			this.count = 0;
24			this.prefix = 0;
25		}
26		#endregion
27
28		#region GetSet Functions
29        public string Name
30        {
31            get
32            {
33                return this.name;
34            }
35			set
36			{
37				this.name = value;
38			}
39        }
40
41        public int Count
42        {
43            get
44            {
45                return this.count;
46            }
47			set
48			{
49				this.count = value;
50			}
51        }
52
53		public Int32 Id
54		{
55			get
56			{
57				return id;
58			}
59			set
60			{
61				id = value;
62			}
63		}
64
65		public Byte Prefix
66		{
67			get
68			{
69				return prefix;
70			}
71			set
72			{
73				id = value;
74			}
75		}
76		#endregion
77
78		#region Overrides
79        public override string ToString()
80        {
81            if(count == 1)
82            {
83                return this.name;
84            }
85            else
86            {
87                return string.Format("{0}, Count: {1}", this.name, this.count);
88            }
89            
90        }
91		#endregion
92    
93    }
94}