diff --git a/backend/backend/Models/Game.cs b/backend/backend/Models/Game.cs index 741129c..615e158 100755 --- a/backend/backend/Models/Game.cs +++ b/backend/backend/Models/Game.cs @@ -1,7 +1,8 @@ namespace backend.Models; public struct SetCheckResult { - public bool IsSet { get; set; } + public bool? IsSet { get; set; } + public bool? IsFinished { get; set; } public Game NewState { get; set; } } @@ -56,16 +57,28 @@ public class Game { var finished = Deck.Length == 0 && Hand.All(card => card == 0); - if (finished) Hand = []; + // Empty hand if game is finished for optimal database space usage + if (finished) { + Hand = []; + } return finished; } public SetCheckResult? IsSet(ushort[] indices) { - if (indices.Length != 3 || Hand == null) return null; + if (GameIsFinished()) { + FinishedAt = DateTime.Now; - bool AnyEmpty = indices.Any(index => Hand[index] == 0); - if (AnyEmpty) return null; + return new SetCheckResult { IsFinished = true, NewState = this }; + } + + if (indices.Length != 3 || Hand == null) { + return null; + } + + if (indices.Any(index => Hand[index] == 0)) { + return null; + } var cards = indices .Select(index => Card.ToCard(Hand[index])) @@ -78,7 +91,6 @@ public class Game { if (!matchingShapes && !matchingColors && !matchingShades && !matchingCounts) { Fails += 1; - return new SetCheckResult { IsSet = false, NewState = this }; } @@ -88,10 +100,6 @@ public class Game { ReplaceCardInHand(index); } - if (GameIsFinished()) { - FinishedAt = DateTime.Now; - } - return new SetCheckResult { IsSet = true, NewState = this }; } } diff --git a/frontend/public/shapes/diamond-blue-opaque.svg b/frontend/public/shapes/diamond-blue-opaque.svg new file mode 100755 index 0000000..9da9100 --- /dev/null +++ b/frontend/public/shapes/diamond-blue-opaque.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/diamond-blue-solid.svg b/frontend/public/shapes/diamond-blue-solid.svg new file mode 100755 index 0000000..c1eebab --- /dev/null +++ b/frontend/public/shapes/diamond-blue-solid.svg @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/diamond-blue-transparent.svg b/frontend/public/shapes/diamond-blue-transparent.svg new file mode 100755 index 0000000..f98ad88 --- /dev/null +++ b/frontend/public/shapes/diamond-blue-transparent.svg @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/diamond-green-opaque.svg b/frontend/public/shapes/diamond-green-opaque.svg new file mode 100755 index 0000000..a98f680 --- /dev/null +++ b/frontend/public/shapes/diamond-green-opaque.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/diamond-green-solid.svg b/frontend/public/shapes/diamond-green-solid.svg new file mode 100755 index 0000000..0a187d9 --- /dev/null +++ b/frontend/public/shapes/diamond-green-solid.svg @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/diamond-green-transparent.svg b/frontend/public/shapes/diamond-green-transparent.svg new file mode 100755 index 0000000..63cfc79 --- /dev/null +++ b/frontend/public/shapes/diamond-green-transparent.svg @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/diamond-red-opaque.svg b/frontend/public/shapes/diamond-red-opaque.svg new file mode 100755 index 0000000..9f21fbc --- /dev/null +++ b/frontend/public/shapes/diamond-red-opaque.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/diamond-red-solid.svg b/frontend/public/shapes/diamond-red-solid.svg new file mode 100755 index 0000000..fe814be --- /dev/null +++ b/frontend/public/shapes/diamond-red-solid.svg @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/diamond-red-transparent.svg b/frontend/public/shapes/diamond-red-transparent.svg new file mode 100755 index 0000000..dad7ece --- /dev/null +++ b/frontend/public/shapes/diamond-red-transparent.svg @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/oval-blue-opaque.svg b/frontend/public/shapes/oval-blue-opaque.svg new file mode 100755 index 0000000..06ce0a5 --- /dev/null +++ b/frontend/public/shapes/oval-blue-opaque.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/oval-blue-solid.svg b/frontend/public/shapes/oval-blue-solid.svg new file mode 100755 index 0000000..78c708a --- /dev/null +++ b/frontend/public/shapes/oval-blue-solid.svg @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/oval-blue-transparent.svg b/frontend/public/shapes/oval-blue-transparent.svg new file mode 100755 index 0000000..1632c02 --- /dev/null +++ b/frontend/public/shapes/oval-blue-transparent.svg @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/oval-green-opaque.svg b/frontend/public/shapes/oval-green-opaque.svg new file mode 100755 index 0000000..98c8177 --- /dev/null +++ b/frontend/public/shapes/oval-green-opaque.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/oval-green-solid.svg b/frontend/public/shapes/oval-green-solid.svg new file mode 100755 index 0000000..e94135e --- /dev/null +++ b/frontend/public/shapes/oval-green-solid.svg @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/oval-green-transparent.svg b/frontend/public/shapes/oval-green-transparent.svg new file mode 100755 index 0000000..dc98b71 --- /dev/null +++ b/frontend/public/shapes/oval-green-transparent.svg @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/oval-red-opaque.svg b/frontend/public/shapes/oval-red-opaque.svg new file mode 100755 index 0000000..84fe6ac --- /dev/null +++ b/frontend/public/shapes/oval-red-opaque.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/oval-red-solid.svg b/frontend/public/shapes/oval-red-solid.svg new file mode 100755 index 0000000..7ed9254 --- /dev/null +++ b/frontend/public/shapes/oval-red-solid.svg @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/oval-red-transparent.svg b/frontend/public/shapes/oval-red-transparent.svg new file mode 100755 index 0000000..b0a7bde --- /dev/null +++ b/frontend/public/shapes/oval-red-transparent.svg @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/squiggle-blue-opaque.svg b/frontend/public/shapes/squiggle-blue-opaque.svg new file mode 100755 index 0000000..e5cbc70 --- /dev/null +++ b/frontend/public/shapes/squiggle-blue-opaque.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/squiggle-blue-solid.svg b/frontend/public/shapes/squiggle-blue-solid.svg new file mode 100755 index 0000000..91df89a --- /dev/null +++ b/frontend/public/shapes/squiggle-blue-solid.svg @@ -0,0 +1,25 @@ + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/squiggle-blue-transparent.svg b/frontend/public/shapes/squiggle-blue-transparent.svg new file mode 100755 index 0000000..296b31e --- /dev/null +++ b/frontend/public/shapes/squiggle-blue-transparent.svg @@ -0,0 +1,25 @@ + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/squiggle-green-opaque.svg b/frontend/public/shapes/squiggle-green-opaque.svg new file mode 100755 index 0000000..c1aae1c --- /dev/null +++ b/frontend/public/shapes/squiggle-green-opaque.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/squiggle-green-solid.svg b/frontend/public/shapes/squiggle-green-solid.svg new file mode 100755 index 0000000..0b956f5 --- /dev/null +++ b/frontend/public/shapes/squiggle-green-solid.svg @@ -0,0 +1,25 @@ + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/squiggle-green-transparent.svg b/frontend/public/shapes/squiggle-green-transparent.svg new file mode 100755 index 0000000..d0ffc7f --- /dev/null +++ b/frontend/public/shapes/squiggle-green-transparent.svg @@ -0,0 +1,25 @@ + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/squiggle-red-opaque.svg b/frontend/public/shapes/squiggle-red-opaque.svg new file mode 100755 index 0000000..2a94d22 --- /dev/null +++ b/frontend/public/shapes/squiggle-red-opaque.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/squiggle-red-solid.svg b/frontend/public/shapes/squiggle-red-solid.svg new file mode 100755 index 0000000..5d5cbbb --- /dev/null +++ b/frontend/public/shapes/squiggle-red-solid.svg @@ -0,0 +1,25 @@ + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/shapes/squiggle-red-transparent.svg b/frontend/public/shapes/squiggle-red-transparent.svg new file mode 100755 index 0000000..b1919f7 --- /dev/null +++ b/frontend/public/shapes/squiggle-red-transparent.svg @@ -0,0 +1,25 @@ + + + + + + + + + + \ No newline at end of file diff --git a/frontend/src/app/app.component.html b/frontend/src/app/app.component.html index 4b41587..5015ef6 100755 --- a/frontend/src/app/app.component.html +++ b/frontend/src/app/app.component.html @@ -1,338 +1,3 @@ - - - - - - - - - - - - - - - - - -
+
diff --git a/frontend/src/app/card/card.component.html b/frontend/src/app/card/card.component.html index 3444b61..5e0eef2 100755 --- a/frontend/src/app/card/card.component.html +++ b/frontend/src/app/card/card.component.html @@ -1,5 +1,5 @@ -
-
- +
+
+ Card Image
diff --git a/frontend/src/app/card/card.component.scss b/frontend/src/app/card/card.component.scss index 9e55f41..b9e6806 100755 --- a/frontend/src/app/card/card.component.scss +++ b/frontend/src/app/card/card.component.scss @@ -12,16 +12,20 @@ cursor: pointer; } +.selected { + border: 4px solid black; +} + .red { - color: red; + filter: invert(7%) sepia(97%) saturate(5069%) hue-rotate(4deg) brightness(92%) contrast(111%); } .green { - color: green; + filter: invert(23%) sepia(41%) saturate(7500%) hue-rotate(118deg) brightness(90%) contrast(107%); } .blue { - color: purple; + filter: invert(18%) sepia(36%) saturate(6314%) hue-rotate(236deg) brightness(64%) contrast(141%); } .opaque { diff --git a/frontend/src/app/card/card.component.ts b/frontend/src/app/card/card.component.ts index f9ec373..adbf8ef 100755 --- a/frontend/src/app/card/card.component.ts +++ b/frontend/src/app/card/card.component.ts @@ -10,13 +10,14 @@ import { CommonModule } from '@angular/common'; }) export class CardComponent { @Input() card!: Card; + @Input() selected: boolean = false; parseShade() { switch (this.card.shade) { case CardShade.Opaque: return 'opaque'; case CardShade.Solid: - return 'translucent'; + return 'solid'; case CardShade.Transparent: return 'transparent'; } diff --git a/frontend/src/app/game/game.component.html b/frontend/src/app/game/game.component.html index 4c0fb2a..5570027 100755 --- a/frontend/src/app/game/game.component.html +++ b/frontend/src/app/game/game.component.html @@ -1,7 +1,12 @@
- +
diff --git a/frontend/src/app/game/game.component.scss b/frontend/src/app/game/game.component.scss index 04f54fb..4d7a0ec 100755 --- a/frontend/src/app/game/game.component.scss +++ b/frontend/src/app/game/game.component.scss @@ -5,9 +5,9 @@ padding: 20px; } -.selected { - border: 4px solid black; -} +// .selected { +// border: 4px solid black; +// } .stats { display: flex;