Ejemplo n.º 1
0
    public void SetControl(string mainCharacter)
    {

        #if SIMULATING
        controlType = ControlType.Simulated;
        #endif

        if (Replay.replaying)
        {
          controlType = ControlType.Replay;
        }

        DeactivateAllMovements();

        hexesControl.mainCharacter = mainCharacter;
        hexQueuedControl.mainCharacter = mainCharacter;
        turnControl.mainCharacter = mainCharacter;

        switch (controlType)
        {
            case ControlType.DiscreteQueued:
                discreteQueued.enabled = true;
                discreteQueued.myCharacter = myCharacter;
                discreteQueued.SetTurnBased(turnBased);
                break;
            case ControlType.Continuous:
                continousControl.enabled = true;
                continousControl.myCharacter = myCharacter;
                continousControl.SetTurnBased(turnBased);
                break;
            case ControlType.HexToHex:
                hexesControl.enabled = true;
                hexesControl.myCharacter = myCharacter;
                hexesControl.SetTurnBased(turnBased);
                break;
            case ControlType.HexQueued:
                hexQueuedControl.enabled = true;
                hexQueuedControl.myCharacter = myCharacter;
                hexQueuedControl.SetTurnBased(turnBased);
                break;
            case ControlType.Discrete:
                discreteControl.enabled = true;
                discreteControl.SetTurnBased(turnBased);
                discreteControl.myCharacter = myCharacter;
                break;
            case ControlType.TurnBased:
                turnControl.enabled = true;
                turnControl.SetTurnBased(turnBased);
                turnControl.myCharacter = myCharacter;
                break;
            case ControlType.Simulated:
                simulatedControl.enabled = true;
                simulatedControl.SetTurnBased(turnBased);
                simulatedControl.myCharacter = myCharacter;
                break;
            case ControlType.Replay:
                replayControl.enabled = true;
                replayControl.SetTurnBased(false);
                replayControl.myCharacter = myCharacter;
                break;
            default:
                break;
        }
    }