Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Rolex show time #2147

Merged
merged 2 commits into from
Sep 15, 2024
Merged

Make Rolex show time #2147

merged 2 commits into from
Sep 15, 2024

Conversation

xsebek
Copy link
Member

@xsebek xsebek commented Sep 15, 2024

  • show time when robot has time capability

Prompted by #2146, which used the fancy rolex entity for commands but surprisingly did not show time in UI.

You can test it with:

git cherry-pick ba8dae31  # see before and after adding rolex
cabal run swarm -O0 -- -i data/scenarios/Testing/562-lodestone.yaml --speed 2 --autoplay

* show time when robot has `time` capability

Prompted by #2146, which used the fancy `rollex` entity for commands but surprisingly did not show time in UI.
@xsebek xsebek added the merge me Trigger the merge process of the Pull request. label Sep 15, 2024
Comment on lines 543 to -548
clockEquipped :: GameState -> Bool
clockEquipped gs = case focusedRobot gs of
Nothing -> False
Just r
| countByName "clock" (r ^. equippedDevices) > 0 -> True
| otherwise -> False
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be the only instance of if p then True else False in repo.

I am surprised HLint did not spot it.

@mergify mergify bot merged commit 1edf55d into main Sep 15, 2024
12 checks passed
@mergify mergify bot deleted the task/xsebek/time-vs-clock branch September 15, 2024 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Trigger the merge process of the Pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants