CEngineSharp_Client.World.Entity.Npc.Warp C# (CSharp) Method

Warp() public method

public Warp ( int newX, int newY, Directions direction ) : void
newX int
newY int
direction Directions
return void
        public void Warp(int newX, int newY, Directions direction)
        {
            this.Direction = direction;

            ServiceLocator.WorldManager.MapManager.Map.GetTile(this.X, this.Y).IsOccupied = false;

            this.X = newX;
            this.Y = newY;

            ServiceLocator.WorldManager.MapManager.Map.GetTile(this.X, this.Y).IsOccupied = true;

            this.Sprite.Position = new Vector2f(newX * 32, newY * 32);
        }