summaryrefslogtreecommitdiffstats
path: root/Piece.gd
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-07-19 18:17:36 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2020-07-19 18:17:36 +0200
commit2320bc526783ac3fb86e52dde07e8bb736a76286 (patch)
tree8080437f639775e67b3c113153a8972c534cbf72 /Piece.gd
parentfa92fda3e7ea53d479402dcdbd153177ef030c21 (diff)
downloadgodot-hexgrid-2320bc526783ac3fb86e52dde07e8bb736a76286.zip
godot-hexgrid-2320bc526783ac3fb86e52dde07e8bb736a76286.tar.gz
document public API
Diffstat (limited to 'Piece.gd')
-rw-r--r--Piece.gd8
1 files changed, 6 insertions, 2 deletions
diff --git a/Piece.gd b/Piece.gd
index 50baa43..1a9e357 100644
--- a/Piece.gd
+++ b/Piece.gd
@@ -3,18 +3,22 @@ extends Node2D
class_name Piece, "res://godot/Piece.png"
+# movement points
func get_mp() -> int:
print("Piece#get_mp() must be overriden in a subclass")
return 0
+# movement point bonus if you start your movement on a road and follow it
func road_march_bonus() -> int:
print("Piece#road_march_bonus() must be overriden in a subclass")
return 0
-func move_cost(src : Tile, dst : Tile, a : int) -> int:
+# movement cost from a Tile to another adjacent Tile
+func move_cost(src : Tile, dst : Tile, orientation : int) -> int:
print("Piece#move_cost() must be overriden in a subclass")
return -1 # impracticable
-func at_least_one_tile() -> bool:
+# are you allowed to move into that Tile as only move even if you don't have enough movement points
+func at_least_one_tile(dst : Tile) -> bool:
print("Piece#at_least_one_tile() must be overriden in a subclass")
return true