GetID() public method

public GetID ( ) : uint
return uint
コード例 #1
0
ファイル: ItemTypeHandler.cs プロジェクト: Railec/SE1cKBS2
 /*
 * Returns the amount of itemtypes that are existent in the given room.
 * The itemtype that you require is given in the parameter.
 */
 public int AmountInRoom(ItemType type, Room r)
 {
     List<Item> matches = ItemHandler.GetInstance().GetItemsBy(delegate (Item i) {
         return i.RoomID == r.GetID();
     });
     int rtn = 0;
     foreach (Item i in matches)
         if (i.Type.ID == type.ID) rtn++;
     return rtn;
 }
コード例 #2
0
ファイル: ItemTypeHandler.cs プロジェクト: Railec/SE1cKBS2
 /*
 * Returns all of the different itemtypes that are in the given room
 * This will distinct any duplicate values.
 */
 public List<ItemType> InRoom(Room r)
 {
     List<ItemType> itemTypes = new List<ItemType>();
     List<Item> matches = ItemHandler.GetInstance().GetItemsBy(delegate (Item i) {
         return i.RoomID == r.GetID();
     });
     foreach (Item i in matches) {
         if (itemTypes.Contains(i.Type)) continue;
         itemTypes.Add(i.Type);
     }
     return itemTypes;
 }