コード例 #1
0
        protected override void Seed(ForbiddingManse context)
        {
            var goku = new Character {
                Name = "Forbidding Manse Goku"
            };
            var sailorMoon = new Character {
                Name = "Fobidding Manse Sailor Moon"
            };

            context.Characters.Add(goku);
            context.Characters.Add(sailorMoon);

            var record = new MatchRecord
            {
                WinnerCharacterId = goku.CharacterId,
                LoserCharacterId  = sailorMoon.CharacterId,

                WinnerSalt = -1,
                LoserSalt  = -1,

                Tier = "Unknown",

                MatchStart  = DateTime.Now,
                MatchLength = TimeSpan.FromSeconds(1),

                MatchType = MatchType.Exhibition,
            };

            context.Matches.Add(record);
        }
コード例 #2
0
        public void RegisterMatchResult(MatchRecord matchRecord)
        {
            Matches.Add(matchRecord);

            _scrollOfHeroes.Information("{Winner} defeated {Loser}. {@MatchRecord}",
                                        GetCharacter(matchRecord.WinnerCharacterId).Name,
                                        GetCharacter(matchRecord.LoserCharacterId).Name,
                                        matchRecord);

            SaveChanges();
        }
コード例 #3
0
        public void RegisterMatchResult(MatchEndEventArgs matchEndArgs, MatchType type)
        {
            var winningCharacter = GetOrCreateCharacter(matchEndArgs.WinningPlayerName);
            var loosingCharacter = GetOrCreateCharacter(matchEndArgs.LoosingPlayerName);

            var matchRecord = new MatchRecord
            {
                WinnerCharacterId = winningCharacter.CharacterId,
                LoserCharacterId  = loosingCharacter.CharacterId,

                WinnerSalt = matchEndArgs.WinnerSalt,
                LoserSalt  = matchEndArgs.LoserSalt,

                Tier = matchEndArgs.Tier,

                MatchStart  = matchEndArgs.MatchStart,
                MatchLength = matchEndArgs.MatchLength,

                MatchType = type,
            };

            RegisterMatchResult(matchRecord);
        }
コード例 #4
0
        public void RegisterMatchResult(string winningCharacterName, string loosingCharacterName, MatchType type)
        {
            var winningCharacter = GetOrCreateCharacter(winningCharacterName);
            var loosingCharacter = GetOrCreateCharacter(loosingCharacterName);

            var matchRecord = new MatchRecord
            {
                WinnerCharacterId = winningCharacter.CharacterId,
                LoserCharacterId  = loosingCharacter.CharacterId,

                WinnerSalt = -1,
                LoserSalt  = -1,

                Tier = "Unknown",

                MatchStart  = DateTime.Now,
                MatchLength = TimeSpan.FromSeconds(1),

                MatchType = type,
            };

            RegisterMatchResult(matchRecord);
        }