diff options
| author | Jérémy Zurcher <jeremy@asynk.ch> | 2026-03-15 10:46:20 +0100 |
|---|---|---|
| committer | Jérémy Zurcher <jeremy@asynk.ch> | 2026-03-15 10:46:20 +0100 |
| commit | 7d7db184eacd1407c87d01355ae587acccccf7ac (patch) | |
| tree | d9d57e8801d445da9c9bef85998a5c7a502ebf92 | |
| parent | 4ce3bd5f717e62fef61acbb17eb0214477d52dab (diff) | |
| download | colonial-twilight-7d7db184eacd1407c87d01355ae587acccccf7ac.zip colonial-twilight-7d7db184eacd1407c87d01355ae587acccccf7ac.tar.gz | |
Track & Sector : add track?
| -rw-r--r-- | lib/colonial_twilight/board/spaces.rb | 8 | ||||
| -rw-r--r-- | spec/spaces_spec.rb | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/colonial_twilight/board/spaces.rb b/lib/colonial_twilight/board/spaces.rb index 343fcaa..c388ac1 100644 --- a/lib/colonial_twilight/board/spaces.rb +++ b/lib/colonial_twilight/board/spaces.rb @@ -12,6 +12,10 @@ module ColonialTwilight @name = name end + def track? + true + end + def max? @v == @max end @@ -112,6 +116,10 @@ module ColonialTwilight define_method(sym) { @forces.send(sym) } end + def track? + false + end + def sector? true end diff --git a/spec/spaces_spec.rb b/spec/spaces_spec.rb index a07a098..b38be16 100644 --- a/spec/spaces_spec.rb +++ b/spec/spaces_spec.rb @@ -12,6 +12,10 @@ describe ColonialTwilight::Track do expect(@t.v).to eq 0 end + it 'is a Track' do + expect(@t.track?).to be true + end + it 'shift' do expect(@t.shift(3)).to eq 3 expect(@t.shift(-2)).to eq 1 @@ -56,6 +60,7 @@ describe ColonialTwilight::Sector do end it 'is a Sector' do + expect(@s.track?).to be false expect(@s.sector?).to be true expect(@s.city?).to be false expect(@s.country?).to be false |
