public FlagStack() { if (mapFlagStack == null) { mapFlagStack = new Dictionary <int, FlagStack>(); } if (idManager == null) { idManager = new IDManager(); } flags = new List <Flag>(); this.id = idManager.GetNewID(); mapFlagStack.Add(this.id, this); }
public Slot(InventoryModel model, Item item = null, int amount = 0) { if (idManager == null) { idManager = new IDManager(); } this.id = idManager.GetNewID(); this.model = model; this.item = item; this.amount = amount; }
public void Awake() { if (idManager == null) { idManager = new IDManager(); } if (mappedCP == null) { mappedCP = new Dictionary <int, CheckPoint> (); } this.id = idManager.GetNewID(); if (isInit) { MapSaveState.current.serializable.initCheck = data; } }
public Slot(InventoryModel model, Item item = null, int amount = 0) { if (idManager == null) { idManager = new IDManager(); } this.id = idManager.GetNewID(); this.model = model; this.item = item; this.amount = amount; if (mappedSlots == null) { mappedSlots = new Dictionary <int, Slot>(); } mappedSlots.Add(id, this); }
public static Tile CreateTile() { Tile toReturn = Instantiate(original).GetComponent <Tile>(); if (idManager == null) { idManager = new IDManager(); } if (mappedTile == null) { mappedTile = new Dictionary <int, Tile>(); } if (cursor == null) { cursor = GameObject.FindWithTag("Cursor"); cursor.SetActive(false); } toReturn.id = idManager.GetNewID(); toReturn.data = new TileData(toReturn.id); toReturn.currentFlagState = new List <Flag>(toReturn.data.flagStack.flags); toReturn.AddNextFlag(); mappedTile.Add(toReturn.id, toReturn); return(toReturn); }