1
Fork 0
mirror of https://github.com/Steffo99/octogem.git synced 2024-11-22 13:04:19 +00:00
octogem/Assets/Scripts/Components/Position/UnitPosition.cs

20 lines
429 B
C#
Raw Normal View History

2018-09-26 22:38:49 +00:00
using UnityEngine;
using System;
public class UnitPosition : GenericPosition
{
2018-09-30 14:35:17 +00:00
public void JumpTo(MapPosition position)
2018-09-26 22:38:49 +00:00
{
this.Position = position;
}
2018-09-30 14:35:17 +00:00
public void StepTo(MapPosition position)
2018-09-26 22:38:49 +00:00
{
if(!position.IsAdjacent(this.Position))
{
throw new Exception("The new position is not adjacent to the current position");
}
this.Position = position;
}
}