Class: Sashite::Ggn::Ruleset::Source::Destination::Engine::Transition
- Inherits:
-
Object
- Object
- Sashite::Ggn::Ruleset::Source::Destination::Engine::Transition
- Defined in:
- lib/sashite/ggn/ruleset/source/destination/engine/transition.rb
Overview
Represents the result of a valid pseudo-legal move evaluation.
A Transition encapsulates the changes that occur when a move is executed on the game board. Since GGN focuses exclusively on board-to-board transformations, a Transition only contains board state changes: pieces moving, appearing, or disappearing on the board.
Instance Attribute Summary collapse
-
#diff ⇒ Hash<String, String|nil>
readonly
Board state changes after the move.
Instance Method Summary collapse
-
#initialize(**diff) ⇒ Transition
constructor
Creates a new Transition with the specified board changes.
Constructor Details
#initialize(**diff) ⇒ Transition
Creates a new Transition with the specified board changes.
66 67 68 69 70 |
# File 'lib/sashite/ggn/ruleset/source/destination/engine/transition.rb', line 66 def initialize(**diff) @diff = diff freeze end |
Instance Attribute Details
#diff ⇒ Hash<String, String|nil> (readonly)
Returns Board state changes after the move. Keys are square labels, values are piece identifiers or nil for empty squares.
36 37 38 |
# File 'lib/sashite/ggn/ruleset/source/destination/engine/transition.rb', line 36 def diff @diff end |