/*----------------------------------------------------------------------------------------------------------------------*/

    // Start is called before the first frame update
    void Start()
    {
        //Connect to turnActionManager
        UNOsystem = FindObjectOfType <UNO>();
        //actionManager = Gameobject.Find("turnManager").GetComponent("turnActionManager");
        actionManager = FindObjectOfType <turnActionManager>();

        //Get player data
        players   = getPlayers();
        turnOrder = new List <string>(players);

        //Create turn order
        //Shuffle(turnOrder);//? Randomizing function for lists; should work for this, right?


        foreach (string player in turnOrder)
        {
            print(player);
        }


        //Set first player
        //currPlayer = players[0];

        //Set turn direction
        //  +Clockwise = 1
        //  +Counterclockwise = -1
        turnDirection = 1;
    }
Esempio n. 2
0
 private void registerSingleton()
 {
     if (mInst == null)
     {
         mInst = this;
     }
     else
     {
         throw new UnityException("ERROR: Cannot create another instance of singleton class CEnemyManager.");
     }
 }
Esempio n. 3
0
    // Start is called before the first frame update
    void Start()
    {
        //UNOsystem = UNOobject.GetComponent<UNO>();
        UNOsystem = FindObjectOfType <UNO>();
        //actionManager = turnManager.GetComponent<turnActionManager>;
        actionManager = FindObjectOfType <turnActionManager>();

        HardAI = FindObjectOfType <HardAI>();

        //TEMPORARY VARIABLES FOR DEMO
        deckClick = false;
        cardClick = false;
        //player1Click = false;
        discardPileClick = false;
        UNObuttonClick   = false;
        playerSafe       = false;
        CPUSafe          = false;
        // Instantiation of UNO object used for rearranging position of Player1 cards
        //  +Changed to UNOsystem; modified code to fit.
        //uno = FindObjectOfType<UNO>();
    }
Esempio n. 4
0
 override public void destroy()
 {
     base.destroy();
     mInst = null;
 }
Esempio n. 5
0
    //handMem[Player][Color][Symbol]

    /*
     * List<List<byte>> AI_handMem;
     * List<List<byte>> Player_handMem;
     */

    // Start is called before the first frame update
    void Start()
    {
        UNOsystem     = FindObjectOfType <UNO>();
        actionManager = FindObjectOfType <turnActionManager>();
        input         = FindObjectOfType <UserInput>();

        maxQuants = new List <List <byte> >()
        {
            new List <byte>()
            {
                2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 0, 0
            },
            new List <byte>()
            {
                2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 0, 0
            },
            new List <byte>()
            {
                2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 0, 0
            },
            new List <byte>()
            {
                2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 0, 0
            },
            new List <byte>()
            {
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4
            }
        };

        handMem = new List <List <byte> >()
        {
            new List <byte>()
            {
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            },
            new List <byte>()
            {
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            },
            new List <byte>()
            {
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            },
            new List <byte>()
            {
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            },
            new List <byte>()
            {
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            }
        };
        foreach (string card in UNOsystem.CPU1)
        {
            addCard(card, handMem);
        }

        discardMem = new List <List <byte> >()
        {
            new List <byte>()
            {
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            },
            new List <byte>()
            {
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            },
            new List <byte>()
            {
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            },
            new List <byte>()
            {
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            },
            new List <byte>()
            {
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            }
        };

        hand_color_weights = new List <double>()
        {
            1.5, 1.5, 1.5
        };
        hand_symbol_weights = new List <double>()
        {
            1.5, 1.5, 1.5
        };
        played_color_weights = new List <double>()
        {
            0.9, 0.9, 0.9
        };
        played_symbol_weights = new List <double>()
        {
            0.9, 0.9, 0.9
        };

        hand_color_shifts = new List <double>()
        {
            0, 0, 0
        };
        hand_symbol_shifts = new List <double>()
        {
            0, 0, 0
        };
        played_color_shifts = new List <double>()
        {
            0, 0, 0
        };
        played_symbol_shifts = new List <double>()
        {
            0, 0, 0
        };
    }