software_challenge_client 21.0.2 → 21.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c65e973b488cf092e716716135e61c348b62d899a77c821aae0e44e340667888
4
- data.tar.gz: 1d4511f7ba6c1dffc6344b523cc3cf04ef3e114a962d3edf2d0cc8dd9382190b
3
+ metadata.gz: a08a78bd14dd02e33b72e6263f1b5f378490d29a3200d66b83664a6ee3eeeeb7
4
+ data.tar.gz: b5bb2bf9b10e457d9a3a187025435cdda90d7b6010a079f5c7587d0ae134fdec
5
5
  SHA512:
6
- metadata.gz: 9e9416cc5a08cd30f7c969edc29a5a5f8c496cc3fa5a1b3c4c7222f4a1ecc653fb2777c1d64e4ac389801d2ad4288901b956366c500835bfc58f51b02d256aa3
7
- data.tar.gz: d7aabbb618c88b80f8845e72199a4ccf377980aa82f7ed260de1cb9c6c52435d5d0ef4b985a2fff786737c40b6f8fea422dae08a4a906591bbe83daffa695a94
6
+ metadata.gz: 99c7dfa3c94c0db8ff13448dc718502c15d98063c98a16ee8e9eb066a510f1405662a7b0e56d5323bc74e712f38690d3047fe096de192e387babd0318477aae2
7
+ data.tar.gz: 2f011d42e30b16f40827c1a3411ceae2923490291faf4cfe63a295dfce7bc606ed755c4b028639c9d8f09eec2b3fdebba82bb077233856c360f5686022fdcd63
@@ -1,3 +1,7 @@
1
+ = 21.1.0
2
+
3
+ Pieces are now mutable and `==` of pieces considers rotated shapes which result in the same covered board fields as equal.
4
+
1
5
  = 21.0.2
2
6
 
3
7
  Fixed problem which caused `last_move` of a `GameState` always be `nil` (thanks to wollw!).
@@ -35,12 +35,33 @@ class Piece
35
35
  @coords = coords_priv
36
36
  end
37
37
 
38
+ # Dreht den Stein
39
+ def rotate!(rotation)
40
+ @rotation = @rotation.rotate(rotation)
41
+ @coords = coords_priv
42
+ end
43
+
44
+ # Flipped den Stein
45
+ def flip!(f = true)
46
+ @is_flipped = @is_flipped ^ f
47
+ @coords = coords_priv
48
+ end
49
+
50
+ # Setzt den Stein auf eine Position
51
+ def locate!(position)
52
+ @position = position
53
+ @coords = coords_priv
54
+ end
55
+
56
+ # Verschiebt den Stein
57
+ def move!(shift)
58
+ @position = position + shift
59
+ @coords = coords_priv
60
+ end
61
+
38
62
  def ==(other)
39
63
  color == other.color &&
40
- kind == other.kind &&
41
- rotation == other.rotation &&
42
- is_flipped == other.is_flipped &&
43
- position == other.position
64
+ coords == other.coords
44
65
  end
45
66
 
46
67
  def to_s
@@ -52,6 +73,7 @@ class Piece
52
73
  end
53
74
 
54
75
  private
76
+
55
77
  def coords_priv
56
78
  kind.transform(@rotation, @is_flipped).transform do |it|
57
79
  Coordinates.new(it.x + @position.x, it.y + @position.y)
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
  # frozen_string_literal: true
3
3
  module SoftwareChallengeClient
4
- VERSION = '21.0.2'
4
+ VERSION = '21.1.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: software_challenge_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 21.0.2
4
+ version: 21.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - 'kwollw '
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2020-11-27 00:00:00.000000000 Z
13
+ date: 2020-12-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: builder