Skip to content

Commit

Permalink
Merge pull request #41 from software-challenge/ostseeschach
Browse files Browse the repository at this point in the history
Ostseeschach
  • Loading branch information
jnccd authored Oct 2, 2021
2 parents 4c372c4 + 773fba8 commit 19539dd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/software_challenge_client/piece.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# Ein Spielstein mit Ausrichtung, Koordinaten und Farbe
class Piece
include Constants

# @!attribute [rw] Color
# @return [Color]
attr_accessor :color
Expand Down Expand Up @@ -53,6 +55,7 @@ def target_coords
end

coords.map{ |x| x + position }.to_a
coords.map{ |x| x + position }.select{ |c| c.x >= 0 && c.y >=0 && c.x < BOARD_SIZE && c.y < BOARD_SIZE}.to_a
end

def ==(other)
Expand Down

0 comments on commit 19539dd

Please sign in to comment.