Beispiel #1
0
    public void GenerateBoard()
    {
        foreach (Transform child in transform)
        {
            Destroy(child.gameObject);
        }

        for (int i = 0; i < 25; i++)
        {
            if (i >= 0 && i <= 8)
            {
                secrets[i] = TeamCard.Teams.Red;
            }
            else if (i >= 9 && i <= 16)
            {
                secrets[i] = TeamCard.Teams.Blue;
            }
            else if (i == 17)
            {
                secrets[i] = TeamCard.Teams.Spy;
            }
            else
            {
                secrets[i] = TeamCard.Teams.Innocent;
            }
        }

        secrets.Shuffle();

        for (int i = 0; i < 25; i++)
        {
            TeamCard card = Instantiate(colourCard, transform);
            card.SetTeam(secrets[i]);
        }

        NewSecret?.Invoke();
    }
Beispiel #2
0
        public async ValueTask <OperationResult <SecretResult> > Post([FromServices] IKeyVaultLogic keyVault, [FromBody] NewSecret newSecret)
        {
            var result = await keyVault.NewSecret(HttpContext.User, newSecret);

            SetStatusCode(result);
            return(result);
        }