-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame_IDCard.js
33 lines (30 loc) · 955 Bytes
/
game_IDCard.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
'use strict';
class IDCard extends React.Component {
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
}
handleClick() {
let verb = this.props.verb;
let newItem = "ID Card";
let newMessage = "";
if (verb === "push") {
newMessage = "Better not, you don't want to lose it";
} else if (verb === "look") {
newMessage = "It's an ID Card for someone named Russ Linden. It looks like the card expires next month.";
} else if (verb === "pickUp") {
newMessage = "You grab the ID Card off the dashboard";
this.props.interactions.pickUp(newItem);
} else if (verb === "use") {
newMessage = "You can't use that here";
}
this.props.changeMessage(newMessage);
}
render() {
return (
<button type="button" className="btn btn-secondary" onClick={this.handleClick}>
ID Card
</button>
)
}
}