Ejemplo n.º 1
0
    /*----------------------------------------------------------------------------------------------------------------------*/

    // 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;
    }
Ejemplo n.º 2
0
    /*----------------------------------------------------------------------------------------------------------------------*/

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

        //Connect to Wild Menu
        WMsystem = FindObjectOfType <WildMenu>();

        HardAI = FindObjectOfType <HardAI>();

        nav = FindObjectOfType <Navigation>();

        //For game being declared over
        GameOverSystem = FindObjectOfType <GameOverMenu>();

        orderManager = GetComponent <turnOrderManager>();

        currPlayer = "NULL";
        phase      = 0;
        UNOcalled  = false;
        cardDrawn  = false;

        playAllowed = false;
        playDone    = false;

        AIdraw         = false;
        AIplay         = false;
        AIselectedCard = "NULL";
    }
Ejemplo n.º 3
0
    // Start is called before the first frame update
    void Start()
    {
        List <string> deck = UNO.GenerateDeck();

        // FindObjectOfType returns the object that matches the type
        // and null if no object natches the type.
        // uno variable is used to access the sprites
        uno = FindObjectOfType <UNO>();

        // Loop to match the name of the card with the stings in the deck
        int i = 0;

        foreach (string card in deck)
        {
            if (this.name == card)
            {
                cardFace = uno.cardFaces[i];
                break;
            }
            i++;
        }
        // GetComponent returns the component of type if the game object
        // has one attached, null if it doesn't
        spriteRenderer = GetComponent <SpriteRenderer>();
        selectable     = GetComponent <Selectable>();
    }
Ejemplo n.º 4
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>();
    }
Ejemplo n.º 5
0
 // Start is called before the first frame update
 void Start()
 {
     //UNOsystem = UNOobject.GetComponent<UNO>();
     UNOsystem = FindObjectOfType <UNO>();
 }
Ejemplo n.º 6
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
        };
    }
Ejemplo n.º 7
0
 // Start is called before the first frame update
 void Start()
 {
     UNOsystem        = FindObjectOfType <UNO>();
     ExitMenuIsActive = false;
 }