Ejemplo n.º 1
0
    virtual protected void UndoCommand()
    {
        player.RebasePosition(playerPosLog[playerCMDNo]);
        hasSolved = hasSolvedLog[playerCMDNo];

        if (playerInboxLog[playerCMDNo] == null)
        {
            playerInbox.ResetInbox();
        }
        else
        {
            List <Data> tempList = new List <Data>();
            foreach (string s in playerInboxLog[playerCMDNo])
            {
                Data d = Instantiate(Resources.Load("DataBoard", typeof(Data))) as Data;
                d.dataStr = s;
                tempList.Add(d);
            }
            playerInbox.ResetInbox(tempList.ToArray());
        }

        if (playerHoldingLog[playerCMDNo] == null)
        {
            player.DropdownData();
        }
        else
        {
            Data d = Instantiate(Resources.Load("DataBoard", typeof(Data))) as Data;
            d.dataStr = playerHoldingLog[playerCMDNo];
            player.PickupData(d);
        }

        if (playerOutboxLog[playerCMDNo] == null)
        {
            playerOutbox.ResetOutbox();
        }
        else
        {
            List <Data> tempList = new List <Data>();
            foreach (string s in playerOutboxLog[playerCMDNo])
            {
                Data d = Instantiate(Resources.Load("DataBoard", typeof(Data))) as Data;
                d.dataStr = s;
                tempList.Add(d);
            }
            playerOutbox.ResetOutbox(tempList.ToArray());
        }
        playerCMDNo -= 1;
        enumPan.SetRunningState(playerCMDNo, EnumPanel.Status.Executing);
    }
Ejemplo n.º 2
0
 protected override void UndoCommand()
 {
     if (distrustOutboxLog[playerCMDNo] == null)
     {
         distrustOutbox.ResetOutbox();
     }
     else
     {
         List <Data> tempList = new List <Data>();
         foreach (string s in distrustOutboxLog[playerCMDNo])
         {
             Data d = Instantiate(Resources.Load("DataBoard", typeof(Data))) as Data;
             d.dataStr = s;
             tempList.Add(d);
         }
         distrustOutbox.ResetOutbox(tempList.ToArray());
     }
     base.UndoCommand();
 }