Esempio n. 1
0
        public void GivenWorldState_WhenApplyAfterTickStateChanges_ReturnPlayerSmaller()
        {
            WorldStateService.GenerateStartingWorld();
            var state = WorldStateService.GetState();

            state.World.Radius = 1900;

            var bot = FakeGameObjectProvider.GetBotAt(new Position(0, 2000));

            bot.Size = 50;
            WorldStateService.UpdateBotSpeed(bot);

            WorldStateService.ApplyAfterTickStateChanges();
            Assert.AreEqual(49, bot.Size);

            WorldStateService.ApplyAfterTickStateChanges();
            Assert.AreEqual(48, bot.Size);

            bot.Position = new Position(0, 1900);
            WorldStateService.ApplyAfterTickStateChanges();
            Assert.AreEqual(47, bot.Size);

            bot.Position = new Position(0, 1849);
            WorldStateService.ApplyAfterTickStateChanges();
            Assert.AreEqual(47, bot.Size);
        }