/WorldView/Structures/Item.cs
C# | 94 lines | 84 code | 10 blank | 0 comment | 2 complexity | 0da8a7bd33d2eb6c9c57fa6d820cc729 MD5 | raw file
- using System;
-
- namespace MoreTerra.Structures
- {
- public class Item
- {
- private string name;
- private int count;
- private Int32 id;
- private Byte prefix;
-
- #region Constructors
- public Item(string name, int count, byte prefix)
- {
- this.name = name;
- this.count = count;
- this.prefix = prefix;
- }
-
- public Item()
- {
- this.name = null;
- this.count = 0;
- this.prefix = 0;
- }
- #endregion
-
- #region GetSet Functions
- public string Name
- {
- get
- {
- return this.name;
- }
- set
- {
- this.name = value;
- }
- }
-
- public int Count
- {
- get
- {
- return this.count;
- }
- set
- {
- this.count = value;
- }
- }
-
- public Int32 Id
- {
- get
- {
- return id;
- }
- set
- {
- id = value;
- }
- }
-
- public Byte Prefix
- {
- get
- {
- return prefix;
- }
- set
- {
- id = value;
- }
- }
- #endregion
-
- #region Overrides
- public override string ToString()
- {
- if(count == 1)
- {
- return this.name;
- }
- else
- {
- return string.Format("{0}, Count: {1}", this.name, this.count);
- }
-
- }
- #endregion
-
- }
- }