示例#1
0
        public void PlayerPawnTest()
        {
            var state = new FortPlayerState()
            {
                PlayerID    = 1,
                UniqueId    = "abc-123",
                BotUniqueId = "",
                bIsABot     = false,
                TeamIndex   = 1,
                HeroType    = new ItemDefinition()
                {
                    Name = "bandolier"
                }
            };

            builder.UpdatePlayerState(1, state);
            builder.AddActorChannel(1, 100);

            var pawn = new PlayerPawn()
            {
                PlayerState = 100,
                Pickaxe     = new ItemDefinition()
                {
                    Name = "raiders revenge"
                }
            };

            builder.UpdatePlayerPawn(2, pawn);
            builder.Build(replay);

            Assert.Equal("raiders revenge", replay.PlayerData.First().Cosmetics.Pickaxe);
        }
示例#2
0
        public void PlayerStateMarksReplayOwnerTest()
        {
            var gameState = new GameState()
            {
                RecorderPlayerState = new ActorGuid {
                    Value = 1
                }
            };

            builder.UpdateGameState(gameState);

            var state = new FortPlayerState()
            {
                PlayerID    = 1,
                UniqueId    = "abc-123",
                BotUniqueId = "",
                bIsABot     = false,
                TeamIndex   = 1,
                HeroType    = new ItemDefinition()
                {
                    Name = "bandolier"
                }
            };

            builder.AddActorChannel(1, 1);
            builder.UpdatePlayerState(1, state);
            builder.Build(replay);

            Assert.Contains(replay.PlayerData, i => i.IsReplayOwner);
        }