Пример #1
0
        public void PlayerEnterExitTest()
        {
            var enter = false;

            AltColShape.OnEntityEnterColShape = (o, shape) =>
            {
                if (shape.Id != 0)
                {
                    return;
                }
                enter = true;
            };
            AltColShape.Create(0, 0, new Position(1, 1, 1), 50);
            Thread.Sleep(1000);
            Assert.True(enter);
            AltColShape.OnEntityExitColShape = (o, shape) =>
            {
                if (shape.Id != 0)
                {
                    return;
                }
                enter = false;
            };
            lock (player)
            {
                player.Position = new Position(52, 1, 1);
            }

            Thread.Sleep(1000);
            Assert.False(enter);
            Assert.Pass();
        }
Пример #2
0
 public void Setup()
 {
     player = new MockPlayer {
         Position = new Position(1, 1, 1)
     };
     players = new List <IPlayer> {
         player
     };
     AltColShape.Init(new MockColShapeModule(new MockPlayerPool(players), new MockVehiclePool()));
 }