1
Fork 0
mirror of https://github.com/Steffo99/octogem.git synced 2025-02-18 22:34:06 +00:00
octogem/Assets/Scripts/Components/Position/UnitPosition.cs

20 lines
429 B
C#
Raw Permalink Normal View History

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