Ejemplo n.º 1
0
        private void checkVictory(OnlineRoom receivedRoom)
        {
            if (!hasEnded)
            {
                hasEnded = true;
            }
            else
            {
                return;
            }
            if (receivedRoom.WinningPlayersIndexes == null)
            {
                return;
            }

            if (receivedRoom.WinningPlayersIndexes.Count == 1)
            {
                if (localPlayer.BackingUser.ID == receivedRoom.Players[receivedRoom.WinningPlayersIndexes.FirstOrDefault()].BackingUser.ID)
                {
                    Schedule(() => infoOverlay.Show(@"Felicidades, ganaste!", Colour4.Green));
                }
                else
                {
                    Schedule(() => infoOverlay.Show(@"Suerte para la proxima, perdiste!", Colour4.DarkRed));
                }
            }
            else if (receivedRoom.WinningPlayersIndexes.Count > 1)
            {
                Schedule(() => infoOverlay.Show(@"Empate!", Colour4.Blue));
            }
            else if (receivedRoom.WinningPlayersIndexes.Count == 0)
            {
                Schedule(() => infoOverlay.Show(@"Nadie ganó!", Colour4.DarkRed));
            }
        }
Ejemplo n.º 2
0
 private void checkRoom(OnlineRoom receivedRoom)
 {
     checkActions(receivedRoom);
     if (receivedRoom.HasEnded)
     {
         checkVictory(receivedRoom);
     }
 }
Ejemplo n.º 3
0
 private void Refresh(OnlineRoom updatedRoom)
 {
     if (updatedRoom.HasStarted)
     {
         gameStack.Show();
         roomUpdater.TimeBetweenPolls = 500;
     }
 }
Ejemplo n.º 4
0
 private void argumentWithManyArguments(OnlineRoom receivedRoom, ArgumentType argumentType)
 {
     for (int i = 0; i < receivedRoom.UserActionArgument.Arguments.Count; i++)
     {
         if (receivedRoom.UserActionArgument.Arguments[i].Type.ReturnType() == ArgumentReturnType.SinglePlayer)
         {
         }
     }
 }
Ejemplo n.º 5
0
 private void checkActions(OnlineRoom receivedRoom)
 {
     if (receivedRoom.UserActionArgument != null)
     {
         argumentToSend = receivedRoom.UserActionArgument;
         if (argumentToSend.Arguments.Count == 1)
         {
             argumentWithOneArgument(receivedRoom, argumentToSend.Type.ReturnType());
         }
     }
 }
Ejemplo n.º 6
0
        private void refreshRoom(OnlineRoom receivedRoom)
        {
            if (receivedRoom == null)
            {
                return;
            }

            checkPlayerHand(receivedRoom.PlayerWithID(api.LocalUser.Value.ID).Hand.Cards);

            foreach (var card in localPlayer.Hand.Cards)
            {
                //playerCards.Add(); // Hacer CardContainer
            }
        }
Ejemplo n.º 7
0
    public void loadRooms()
    {
        var roomList = PhotonNetwork.GetRoomList();
        var rooms    = new List <OnlineRoom>();

        for (var i = 0; i < roomList.Length; i++)
        {
            var currentRoom = new OnlineRoom(roomList[i].Name, roomList[i].PlayerCount);
            rooms.Add(currentRoom);
        }

        if (OnLoadedRooms != null)
        {
            OnLoadedRooms(rooms);
        }
    }
Ejemplo n.º 8
0
        private void argumentWithOneArgument(OnlineRoom receivedRoom, ArgumentReturnType argumentType)
        {
            if (receivedRoom.Players[receivedRoom.UserActionArgument.Arguments[0].Result[0]].BackingUser.ID != localPlayer.BackingUser.ID)
            {
                sendOverlay.Hide();
                EnableCardSelection.Value   = false;
                EnablePlayerSelection.Value = false;
                EnableTileSelection.Value   = false;
                return;
            }

            if ((argumentType & ArgumentReturnType.Tile) != 0)
            {
                EnableTileSelection.Value = true;
                sendOverlay.Show();
            }
            if ((argumentType & ArgumentReturnType.Card) != 0)
            {
                EnableCardSelection.Value = true;
                sendOverlay.Show();
            }
            if ((argumentType & ArgumentReturnType.Player) != 0)
            {
                EnablePlayerSelection.Value = true;
                sendOverlay.Show();
                playersArray = receivedRoom.Players;
            }
            if ((argumentType & ArgumentReturnType.CardType) != 0)
            {
                EnableCardSelection.Value = true;
                List <OnlineCard> cardsType = new List <OnlineCard>();
                foreach (var card in game.GameCards)
                {
                    OnlineCard oc = new OnlineCard()
                    {
                        TypeID = card.TypeID
                    };
                    cardsType.Add(oc);
                }
                selectOverlay.PopulateCards(cardsType);
                sendOverlay.Show();
            }
        }
Ejemplo n.º 9
0
 private void checkPlayerHand(OnlineRoom room)
 {
     checkCards(room.PlayerWithID(api.LocalUser.Value.ID).Hand.Cards);
     checkTokens(room.PlayerWithID(api.LocalUser.Value.ID).Hand.Tokens);
 }
Ejemplo n.º 10
0
 public RoomScreen(OnlineRoom room)
 {
     this.room = new Bindable <OnlineRoom>(room);
 }