コード例 #1
0
        //obtaining response which is send to clients - current data of players
        //readiness to play the new game
        private ActualizedPlayersReadinessDataRequest ObtainPlayersReadinessData()
        {
            List <ActualizedDataOfPlayersReadiness> ReadinessList = new List <ActualizedDataOfPlayersReadiness>();

            foreach (PlayerData item in MakaoEngineHostDataPlaceholders.PlayersData)
            {
                ActualizedDataOfPlayersReadiness singlePlayerData = new ActualizedDataOfPlayersReadiness()
                {
                    PlayerName    = item.PlayerName,
                    PlayerNumber  = item.PlayerNumber,
                    PlayerID      = item.PlayerID,
                    IsReadyToPlay = item.ReadyToPlay,
                };
                ReadinessList.Add(singlePlayerData);
            }
            ActualizedPlayersReadinessDataRequest response = new ActualizedPlayersReadinessDataRequest()
            {
                ReadinessDataList = ReadinessList,
            };

            return(response);
        }
コード例 #2
0
ファイル: InfoSenderClass.cs プロジェクト: Michu8258/Makao
 //spread info about change in players readiness to game
 public void SendInfoToClientsAboutChangeOfReadiness(ActualizedPlayersReadinessDataRequest dataToSend)
 {
     Task.Run(() => SendInfoToAllCLients(ClientInfoType.PlayersReadinessChanged, (object)dataToSend));
 }
コード例 #3
0
 //receiving information from host about players rediness to play
 void IMakaoGameClientService.UpdatePlayersGameReadinessData(ActualizedPlayersReadinessDataRequest request)
 {
     DataPlaceholder.OnPlayersReadinesChanged(request);
 }
コード例 #4
0
 public static void OnPlayersReadinesChanged(ActualizedPlayersReadinessDataRequest args)
 {
     PlayersReadinesChanged?.Invoke(null, new PlayersReadinessToPlayEventArgs {
         ReadinessData = args
     });
 }