public void LoadFlagStack(Tile tile) { flagStack = tile.data.flagStack; this.tile = tile; RefreshSlots(); Debug.Log("FlagStack loaded"); }
public TileData(TileData toCopy) { this.id = toCopy.id; this.isLocked = toCopy.isLocked; this.flagStack = new FlagStack(toCopy.flagStack); this.actionnerValue = toCopy.actionnerValue; this.hasActionner = toCopy.hasActionner; this.hasCorpse = toCopy.hasCorpse; }
public TileData(int id) { this.id = id; isLocked = false; flagStack = new FlagStack(); actionnerValue = false; hasActionner = false; hasCorpse = false; }
public void SetSlotFromRight(int slotID, ref Item item) { //slots[slotID].item = item; // Update Slot's item //item.currentSlot = this.gameObject; // Update Item's slot //Update FlagStack if (flagStack.flags.Count < 5) { FlagStack.GetFS(flagStack).AddFlagAt(item.flagPrefab.GetComponent <Flag>(), slotID); // flagStack update } RefreshSlots(); //if (slots.Count < 5 && slotID == flagStack.flags.Count - 1) }
public FlagStack(FlagStack flagStack) { if (mapFlagStack == null) { mapFlagStack = new Dictionary <int, FlagStack>(); } if (idManager == null) { idManager = new IDManager(); } this.id = idManager.GetNewID(); this.flags = new List <Flag>(flagStack.flags); mapFlagStack.Add(this.id, this); }
internal static FlagStack GetFS(FlagStack flagStack) { return(mapFlagStack[flagStack.id]); }
public void SetSlotFromLeft(int fromID, int toID) { FlagStack.GetFS(flagStack).SwapFlag(fromID, toID); RefreshSlots(); }
internal void RemoveItem(Item item) { FlagStack.GetFS(flagStack).RemoveFlagAt(item.currentSlot.GetComponent <Slot>().slotID); // flagStack update RefreshSlots(); }