Esempio n. 1
0
 public void LoadFlagStack(Tile tile)
 {
     flagStack = tile.data.flagStack;
     this.tile = tile;
     RefreshSlots();
     Debug.Log("FlagStack loaded");
 }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
 public TileData(int id)
 {
     this.id        = id;
     isLocked       = false;
     flagStack      = new FlagStack();
     actionnerValue = false;
     hasActionner   = false;
     hasCorpse      = false;
 }
Esempio n. 4
0
 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)
 }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
 internal static FlagStack GetFS(FlagStack flagStack)
 {
     return(mapFlagStack[flagStack.id]);
 }
Esempio n. 7
0
 public void SetSlotFromLeft(int fromID, int toID)
 {
     FlagStack.GetFS(flagStack).SwapFlag(fromID, toID);
     RefreshSlots();
 }
Esempio n. 8
0
    internal void RemoveItem(Item item)
    {
        FlagStack.GetFS(flagStack).RemoveFlagAt(item.currentSlot.GetComponent <Slot>().slotID); // flagStack update

        RefreshSlots();
    }