Class: Pathfinding::Target::Coords
- Defined in:
- scripts/01450 Systems/00003 Map Engine/00002 Logic/00650 RMXP/00710 Pathfinding_targets.rb
Class Method Summary collapse
-
.load(data)
Create new target from the given data.
Instance Method Summary collapse
-
#check_move(x, y) ⇒ Boolean
Check if the character targetted has moved, considering the distance for optimisation and return true if the target is considered as moved.
-
#initialize(*args) ⇒ Coords
constructor
A new instance of Coords.
-
#reached?(x, y, z) ⇒ Boolean
Test if the target is reached at the fiveng coords.
-
#save ⇒ Array<Object>
Gather the savable data.
Constructor Details
#initialize(*args) ⇒ Coords
Returns a new instance of Coords.
30 31 32 33 34 35 36 37 38 |
# File 'scripts/01450 Systems/00003 Map Engine/00002 Logic/00650 RMXP/00710 Pathfinding_targets.rb', line 30 def initialize(*args) coords = args[0] @x = coords[0] + Yuki::MapLinker.get_OffsetX @y = coords[1] + Yuki::MapLinker.get_OffsetY @z = coords[2] @radius = args[1] @original_x = coords[0] @original_y = coords[1] # Prevent bug from MapLinker Enable/Disable end |
Class Method Details
Instance Method Details
#check_move(x, y) ⇒ Boolean
Check if the character targetted has moved, considering the distance for optimisation and return true if the target is considered as moved
53 54 55 |
# File 'scripts/01450 Systems/00003 Map Engine/00002 Logic/00650 RMXP/00710 Pathfinding_targets.rb', line 53 def check_move(x, y) false end |
#reached?(x, y, z) ⇒ Boolean
Test if the target is reached at the fiveng coords
45 46 47 |
# File 'scripts/01450 Systems/00003 Map Engine/00002 Logic/00650 RMXP/00710 Pathfinding_targets.rb', line 45 def reached?(x, y, z) return ((@x - x).abs + (@y - y).abs) <= @radius end |
#save ⇒ Array<Object>
Gather the savable data
59 60 61 |
# File 'scripts/01450 Systems/00003 Map Engine/00002 Logic/00650 RMXP/00710 Pathfinding_targets.rb', line 59 def save return [:Coords, [@original_x, @original_y, @z], @radius] end |