Skip to content

Commit

Permalink
Merge pull request #87 from hpi-swa-teaching/dev-linus
Browse files Browse the repository at this point in the history
removed unnecessary rule checking
  • Loading branch information
arcuslinus authored Jan 12, 2024
2 parents 88124ee + 11703a5 commit 85f6ac5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 6 additions & 7 deletions src/SIY-Game/SIYArena.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -268,17 +268,16 @@ SIYArena >> positionDictionary [

{
#category : #movement,
#'squeak_changestamp' : 'LK 1/6/2024 19:28'
#'squeak_changestamp' : 'LK 1/12/2024 23:29'
}
SIYArena >> postMoveBlocksRoutine [
"This routine gets triggered, after every block has been moved through the moveBlocksDirection method, for example after keyboard input.
This routine will NOT get triggered, if blocks are moved using the halo."

self ruleManager updateRulesInArena: self.

"check rules for all SIYYou blocks again (sometimes necessary),
direction for queue generation doesn't matter"
(self blockMediator generateQueueForDirection: 1@0)

"check rules for all blocks"
(self blockMediator getBlocksOfType: SIYBlock)
do: [:aBlock | self ruleManager checkRulesFor: aBlock].

self undoCaretaker createSnapshotOf: self.
Expand Down Expand Up @@ -382,13 +381,13 @@ SIYArena >> scaleFactor: aScaleFactor [

{
#category : #stepping,
#'squeak_changestamp' : 'KD 1/8/2024 15:10'
#'squeak_changestamp' : 'LK 1/12/2024 20:25'
}
SIYArena >> slowStepTime [
"slower step time affects the delay between block movements, while a keyboard
button is held down"

^ 180
^ 155
]

{
Expand Down
4 changes: 2 additions & 2 deletions src/SIY-Game/SIYBlock.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -538,15 +538,15 @@ SIYBlock >> position: aPoint [

{
#category : #movement,
#'squeak_changestamp' : 'LK 1/4/2024 14:30'
#'squeak_changestamp' : 'LK 1/12/2024 23:29'
}
SIYBlock >> postMoveRoutine: aDirection [
"This routine gets triggered, after the block has been moved using basicMove,
for example through keyboard inputs. It will NOT get triggered, if the block has been
moved using the halo."

self setTextureForDirection: aDirection.
self ruleManager checkRulesFor: self
"self ruleManager checkRulesFor: self"
]

{
Expand Down

0 comments on commit 85f6ac5

Please sign in to comment.