Ejemplo n.º 1
0
        private void StartHotSeat_Tapped(string id, GestureSample gesture)
        {
            var battleData = new BattleData {
                CurrentPlayerId = BattleData.TestPlayerOneId, IsTestMode = true
            };

            var clonedTeamOne = Convert.Clone(teamManager.Team);

            battleData.InitializeCharacters(BattleData.TestPlayerOneId, clonedTeamOne, isTestMode: true);

            var clonedTeamTwo = Convert.Clone(teamManager.Team);

            battleData.InitializeCharacters(BattleData.TestPlayerTwoId, clonedTeamTwo, isTestMode: true);

            StartBattle?.Invoke(battleData);
        }
Ejemplo n.º 2
0
        public async Task <BattleData> JoinBattleAndObserve(string matchId, TeamData team)
        {
            currentBattle = await battleMapper.GetBattle(matchId);

            currentBattle.InitializeCharacters(ApplicationData.PlayerId, team);
            currentBattle.ChangePlayingSide();
            await battleMapper.PutBattle(currentBattle);

            watchingBattle = battleMapper.ObserveBattle(matchId).Subscribe(OnDataUpdated);

            return(currentBattle);
        }
Ejemplo n.º 3
0
        public async Task <BattleData> CreateBattle(TeamData team)
        {
            var matchId    = Guid.NewGuid();
            var battleData = new BattleData
            {
                CurrentPlayerId = ApplicationData.PlayerId,
                MatchId         = matchId.ToString()
            };

            battleData.InitializeCharacters(ApplicationData.PlayerId, team);
            await battleMapper.PutBattle(battleData);

            return(battleData);
        }