Last change
on this file since 43 was 43, checked in by bart, 2 years ago |
Added python timedependent parties (conceder, hardliner, etc)
|
File size:
1.0 KB
|
Rev | Line | |
---|
[43] | 1 | package geniusweb.inform;
|
---|
| 2 |
|
---|
| 3 | import com.fasterxml.jackson.annotation.JsonCreator;
|
---|
| 4 | import com.fasterxml.jackson.annotation.JsonProperty;
|
---|
| 5 |
|
---|
| 6 | import geniusweb.actions.Action;
|
---|
| 7 |
|
---|
| 8 | /**
|
---|
| 9 | * Informs that someone did an action
|
---|
| 10 | */
|
---|
| 11 | public class ActionDone implements Inform {
|
---|
| 12 |
|
---|
| 13 | private final Action action;
|
---|
| 14 |
|
---|
| 15 | @JsonCreator
|
---|
| 16 | public ActionDone(@JsonProperty("action") Action action) {
|
---|
| 17 | this.action = action;
|
---|
| 18 | }
|
---|
| 19 |
|
---|
| 20 | public Action getAction() {
|
---|
| 21 | return action;
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | @Override
|
---|
| 25 | public String toString() {
|
---|
| 26 | return "ActionDone[" + action + "]";
|
---|
| 27 | }
|
---|
| 28 |
|
---|
| 29 | @Override
|
---|
| 30 | public int hashCode() {
|
---|
| 31 | final int prime = 31;
|
---|
| 32 | int result = 1;
|
---|
| 33 | result = prime * result + ((action == null) ? 0 : action.hashCode());
|
---|
| 34 | return result;
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | @Override
|
---|
| 38 | public boolean equals(Object obj) {
|
---|
| 39 | if (this == obj)
|
---|
| 40 | return true;
|
---|
| 41 | if (obj == null)
|
---|
| 42 | return false;
|
---|
| 43 | if (getClass() != obj.getClass())
|
---|
| 44 | return false;
|
---|
| 45 | ActionDone other = (ActionDone) obj;
|
---|
| 46 | if (action == null) {
|
---|
| 47 | if (other.action != null)
|
---|
| 48 | return false;
|
---|
| 49 | } else if (!action.equals(other.action))
|
---|
| 50 | return false;
|
---|
| 51 | return true;
|
---|
| 52 | }
|
---|
| 53 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.