public void AttackPhase(AttackModel param) { SetParam(MyConst.RPC_DATA_ATTACK, (param)); GetLatestKey(2, delegate(string resultString) { FirebaseDBFacade.RunTransaction(reference.Child(MyConst.GAMEROOM_ROOM).Child(gameRoomKey).Child(MyConst.GAMEROOM_BATTLE_STATUS).Child(resultString), delegate(MutableData mutableData) { mutableData.Value = PhaseMutate(mutableData, MyConst.BATTLE_STATUS_ATTACK); }); }); }
public void JoinRoom() { FirebaseDBFacade.RunTransaction(reference.Child(MyConst.GAMEROOM_ROOM).Child(gameRoomKey).Child(MyConst.GAMEROOM_STATUS), delegate(MutableData mutableData) { int playerCount = int.Parse(mutableData.Value.ToString()); playerCount++; joinCounter++; mutableData.Value = playerCount.ToString(); }); StartCoroutine(StartJoinDelay()); }
public void AnswerPhase(string param) { GetLatestKey(1, delegate(string resultString) { FirebaseDBFacade.RunTransaction(reference.Child(MyConst.GAMEROOM_ROOM).Child(gameRoomKey).Child(MyConst.GAMEROOM_BATTLE_STATUS).Child(resultString), delegate(MutableData mutableData) { mutableData.Value = PhaseMutate(mutableData, MyConst.BATTLE_STATUS_ANSWER, delegate(Dictionary <string, System.Object> battleStatus, int battleCount) { if (GameManager.isHost) { battleStatus [MyConst.RPC_DATA_PLAYER_ANSWER_PARAM] = param; } else { battleStatus [MyConst.RPC_DATA_ENEMY_ANSWER_PARAM] = param; } }); }); }); }