From ced3d03bdb3ce866d832e03fb212865140905a9a Mon Sep 17 00:00:00 2001 From: Thomas Leyh Date: Sun, 24 Jul 2016 08:14:18 +0200 Subject: Add project files. --- V3/Objects/Movement/IMovable.cs | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 V3/Objects/Movement/IMovable.cs (limited to 'V3/Objects/Movement/IMovable.cs') diff --git a/V3/Objects/Movement/IMovable.cs b/V3/Objects/Movement/IMovable.cs new file mode 100644 index 0000000..659708b --- /dev/null +++ b/V3/Objects/Movement/IMovable.cs @@ -0,0 +1,43 @@ +using Microsoft.Xna.Framework; +using V3.Data; +using V3.Map; + +namespace V3.Objects.Movement +{ + public interface IMovable + { + /// + /// Calculates a path without collisions to desired destination. + /// + /// Pathfinder to use. + /// Current position in pixel. + /// Destination in pixel. + void FindPath(Pathfinder pathfinder, Vector2 position, Vector2 destination); + + /// + /// Uses pathfinder to for steady movement to new transition. + /// + /// Current position in pixel. + /// Movement speed of the creature. + /// Normalized vector * speed which represents a small step in the direction of desired destination.( + Vector2 GiveNewPosition(Vector2 currentPosition, int speed); + + /// + /// Calculates the direction the creature is looking when moving. + /// + MovementDirection GiveMovementDirection(); + bool IsMoving { get; } + + /// + /// Save the movement data to a MovementData object. + /// + /// the MovementData object with the current status + MovementData SaveData(); + + /// + /// Restore the movement state from the given data. + /// + /// the state of the movement to restore + void LoadData(MovementData movementData); + } +} -- cgit v1.2.1