public void Move(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;
if (this.Step == 0)
{
this._previousStep = 0;
this.Step++;
}
else if (this.Step == 2)
{
this._previousStep = 2;
this.Step--;
}
else if (this.Step == 1)
{
if (this._previousStep == 2)
this.Step--;
else
this.Step++;
}
this.IsMoving = true;
}