예제 #1
0
    private void RightMouseClick()
    {
        GameObject hitObject = FindHitObject();

        if (hitObject != null)
        {
            if (hitObject.GetComponent <ISelectAble>() != null && hitObject.tag == "Country")
            {
                Country clickedCountry = hitObject.GetComponent <Country>();
                _currentPlayersturn = PlayerTurnHandler.GetCurrentPlayer();
                Player countryOwner = clickedCountry.GetPlayerOwner();

                if (PlayerTurnHandler.CurrentGameMode == PlayerTurnHandler.GameMode.Reinforcement)
                {
                    if (_currentPlayersturn == countryOwner && _currentPlayersturn.reinforcementsAvailable > 0)
                    {
                        clickedCountry.AddArmy();
                        _currentPlayersturn.reinforcementsAvailable--;
                    }
                }
                else if (PlayerTurnHandler.CurrentGameMode == PlayerTurnHandler.GameMode.Attack)
                {
                    //Check if the two countries are connected.
                    //Check if the country is enemy.
                    attackPanelObject.SetActive(true);
                    _attackPannel.StartAttack(_currentSelectedCountry, clickedCountry);
                }
                countryHandler.SetSelectedCountry(_currentSelectedCountry);
            }
        }
    }
예제 #2
0
    public void Start()
    {
        SetUpLists();
        amountOfLandForEachPlayer = (int)(countryList.Count / PlayerTurnHandler.amountOfPlayers);
        oddLandLeft = (int)(countryList.Count % PlayerTurnHandler.amountOfPlayers);

        playerList = PlayerTurnHandler.GetPlayerList();
        SetOwners();
    }
예제 #3
0
 // Use this for initialization
 void Start()
 {
     _currentPlayersturn = PlayerTurnHandler.GetCurrentPlayer();
 }