Esempio n. 1
0
    public void PlayerVoted(Player player, Vote.Options option)
    {
        PlayerVoteStatusUI playerVoteStatus;

        if (playerStatusDictionary.TryGetValue(player, out playerVoteStatus))
        {
            playerVoteStatus.SetVote(option);
        }
    }
Esempio n. 2
0
 public void ExecuteAction(Vote.Options option)
 {
     if (option == Vote.Options.Yes && yesAction != null)
     {
         yesAction();
     }
     else if (option == Vote.Options.No && noAction != null)
     {
         noAction();
     }
 }
Esempio n. 3
0
 public void SetVote(Vote.Options option)
 {
     if (option == Vote.Options.Yes)
     {
         yesImage.SetActive(true);
         waitingImage.SetActive(false);
         noImage.SetActive(false);
     }
     else if (option == Vote.Options.No)
     {
         yesImage.SetActive(false);
         waitingImage.SetActive(false);
         noImage.SetActive(true);
     }
 }
Esempio n. 4
0
    public void PlayerVoteFor(Player player, Vote.Options option)
    {
        currentVote.AddVote(player, option);

        RpcPlayerVoteFor(player.gameObject, (byte)option);

        if (currentVote.Ended)
        {
            var result = currentVote.GetResult();
            if (result == Vote.Options.Yes)
            {
                RpcVotePassed();
            }
            else if (result == Vote.Options.No)
            {
                RpcVoteFailed();
            }
            TargetOnVoteResult(currentVote.Owner.connectionToClient, (byte)currentVote.GetResult());
            currentVote = null;
        }
    }
 public CommandPlayerVoteFor(Vote.Options option)
 {
     this.caller = Player.LocalPlayer;
     this.option = option;
 }
 public CommandPlayerVoteFor(Player caller, Vote.Options option)
 {
     this.caller = caller;
     this.option = option;
 }
Esempio n. 7
0
 public void CmdPlayerVoteFor(GameObject caller, Vote.Options voteData)
 {
     Instance.ExecuteServerCommandWithoutUndo(new CommandPlayerVoteFor(caller.GetComponent <Player>(), voteData), true);
 }