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)); } }
private void checkRoom(OnlineRoom receivedRoom) { checkActions(receivedRoom); if (receivedRoom.HasEnded) { checkVictory(receivedRoom); } }
private void Refresh(OnlineRoom updatedRoom) { if (updatedRoom.HasStarted) { gameStack.Show(); roomUpdater.TimeBetweenPolls = 500; } }
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) { } } }
private void checkActions(OnlineRoom receivedRoom) { if (receivedRoom.UserActionArgument != null) { argumentToSend = receivedRoom.UserActionArgument; if (argumentToSend.Arguments.Count == 1) { argumentWithOneArgument(receivedRoom, argumentToSend.Type.ReturnType()); } } }
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 } }
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); } }
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(); } }
private void checkPlayerHand(OnlineRoom room) { checkCards(room.PlayerWithID(api.LocalUser.Value.ID).Hand.Cards); checkTokens(room.PlayerWithID(api.LocalUser.Value.ID).Hand.Tokens); }
public RoomScreen(OnlineRoom room) { this.room = new Bindable <OnlineRoom>(room); }