-
Notifications
You must be signed in to change notification settings - Fork 54
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
implement Equip/Unequip #887
Conversation
src/Swarm/Game/Step.hs
Outdated
@@ -1488,6 +1499,16 @@ execConst c vs s k = do | |||
let msg = "The operator '$' should only be a syntactic sugar and removed in elaboration:\n" | |||
in throwError . Fatal $ msg <> badConstMsg | |||
where | |||
installSelf item focusedID myID = do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implementation is now shared between install
and equip
.
@@ -542,6 +546,8 @@ constInfo c = case c of | |||
["The current location has to be empty for this to work."] | |||
Give -> command 2 short "Give an item to another robot nearby." | |||
Install -> command 2 short "Install a device from inventory on a robot." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be quite a bit more work to remove the Install
command. Let's leave it around but consider it "deprecated".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we also want to change the install
tutorial to an equip
tutorial? Even in the tutorial, it tells you to install something on yourself...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but let's address that in #907.
Tested with |
93f7d82
to
e0522d3
Compare
b9c23e4
to
0e96974
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good. We also need to update the help text for an appropriate device to mention equip
and unequip
. Since you put these commands under CGive
, that device would be grabber
. However, the poor grabber
is already very overloaded with providing four different commands. It's also unclear why a grabber
would be needed to equip
and unequip
on yourself (I imagine the grabber
arm doing stuff outside the robot). We might consider (1) creating a new capability, CEquip
, which is (2) provided by a new device.
It's actually using the |
0e96974
to
f715006
Compare
Oh, ok, but that capability is still provided by a |
How about a device called a "welder" that provides
|
I like it! It's kinda like the |
5dd3fde
to
f4be72e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Eventually we'll want a recipe for welder
.
f4be72e
to
a4298ac
Compare
See comment on #883