CEngineSharp_Client.World.Entity.Player.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.Position.X, this.Position.Y).IsOccupied = false;

            this.Position = new Vector2i(newX, newY);

            ServiceLocator.WorldManager.MapManager.Map.GetTile(newX, newY).IsOccupied = true;

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