@Override public final boolean equals(final Object obj) { if (this == obj) { return true; } if (!(obj instanceof Session)) { return false; } Session other = (Session) obj; return this.player.equals(other.player); } }
/** * @param id Player to check. * @return <code>true</code> if the player is world. */ public boolean isWorld(final PlayerId id) { return Player.WORLD.id.equals(id); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof Message)) { return false; } Message other = (Message) obj; return this.date == other.date && this.content.equals(other.content) && this.read == other.read && this.receiver.equals(other.receiver) && this.sender.equals(other.sender); } }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PlayerDto playerDto = (PlayerDto) o; return player.equals(playerDto.player) && login.equals(playerDto.login) && status == playerDto.status; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ResourceTransferDto that = (ResourceTransferDto) o; return receiver.equals(that.receiver) && giver.equals(that.giver) && resources.equals(that.resources) && cause == that.cause; }
@Override public final boolean hasSameOwnerAs(final Entity e) { return this.owner.equals(e.getOwner()); }
public boolean isOwned(final PlayerId player) { assert player != null; return this.entity.getOwner().equals(player); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ChangeOwnerDto that = (ChangeOwnerDto) o; if (!entity.equals(that.entity)) { return false; } return newOwnerId.equals(that.newOwnerId); }
/** * Occurs when 2 entities are no longer colliding, notify the listeners that they are not visible if they were and only if they do not belong to the same player. */ @Override public final void lostCollision(final CollisionResult r) { T viewer = this.manager.findById(r.object1); T unseen = this.manager.findById(r.object2); if (!viewer.getOwner().equals(unseen.getOwner()) && viewer.isSeeing(unseen)) { this.listenerList.forEach(l -> l.noLongerSee(viewer, unseen)); } }