Ejemplo n.º 1
0
    void DetectFieldTypeAmdAction(GameFieldViewer field)
    {
        switch (field.GetFieldType)
        {
        case FieldType.Free:
            Debug.Log("Free Field");
            if (turn == PlayerType.Player)
            {
                popup.Show(PopupType.Buy, GetBuyField, field.GetFieldModel.cost);
            }
            else
            {
                GetBuyField(true);
            }
            break;

        case FieldType.Bonus:
            Debug.Log("Bonus Field");
            int bon = bonus.ShowBonusAnimation(field.GetPosition);
            GetPlayerView.GetModel.AddMoney(bon);
            panel.SetPlayerInfo(GetPlayerView.GetModel);
            SwitchTurn();
            break;

        case FieldType.Player1:
            Debug.Log("Player1 Field");
            if (turn == PlayerType.Player)
            {
                field.PayTax(player_model, ai_model, panel);
                int tax = field.GetFieldModel.tax;
                animationController.TextAnimation(field.GetPosition, "-" + tax.ToString());
                animationController.TextAnimation(ai_view.GetPosition, "+" + tax.ToString());
            }
            SwitchTurn();
            break;

        case FieldType.Player2:
            Debug.Log("Player2 Field");
            if (turn == PlayerType.AI)
            {
                field.PayTax(ai_model, player_model, panel);
                int tax = field.GetFieldModel.tax;
                animationController.TextAnimation(field.GetPosition, "-" + tax.ToString());
                animationController.TextAnimation(player_view.GetPosition, "+" + tax.ToString());
            }
            SwitchTurn();
            break;

        case FieldType.Start:
            ShowStartFieldGetBonus();
            SwitchTurn();
            break;
        }
    }