-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nicol
committed
Sep 13, 2023
1 parent
dc0ca77
commit 6398b36
Showing
13 changed files
with
143 additions
and
96 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
14 changes: 13 additions & 1 deletion
14
src/main/java/org/magic/api/beans/abstracts/AbstractMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/main/java/org/magic/api/beans/messages/ConnectionMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.magic.api.beans.messages; | ||
|
||
import org.magic.api.beans.abstracts.AbstractMessage; | ||
import org.magic.game.model.Player; | ||
|
||
public class ConnectionMessage extends AbstractMessage { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
public ConnectionMessage(Player p, boolean online) { | ||
setTypeMessage(online?MSG_TYPE.CONNECT:MSG_TYPE.DISCONNECT); | ||
setAuthor(p); | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/org/magic/api/beans/messages/StatutMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.magic.api.beans.messages; | ||
|
||
import org.magic.api.beans.abstracts.AbstractMessage; | ||
import org.magic.game.model.Player; | ||
import org.magic.game.model.Player.STATUS; | ||
|
||
public class StatutMessage extends AbstractMessage { | ||
|
||
private static final long serialVersionUID = 1L; | ||
private STATUS statut; | ||
|
||
public StatutMessage(Player p, STATUS statut) { | ||
setTypeMessage(MSG_TYPE.CHANGESTATUS); | ||
setAuthor(p); | ||
this.statut=statut; | ||
} | ||
|
||
public void setStatut(STATUS statut) { | ||
this.statut = statut; | ||
} | ||
|
||
public STATUS getStatut() { | ||
return statut; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
src/main/java/org/magic/api/beans/messages/TalkMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.magic.api.beans.messages; | ||
|
||
import java.awt.Color; | ||
|
||
import org.magic.api.beans.abstracts.AbstractMessage; | ||
import org.magic.game.model.Player; | ||
|
||
public class TalkMessage extends AbstractMessage{ | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private String message; | ||
private Color color; | ||
|
||
public String toChatString() { | ||
return getAuthor().getName() + " : " + message; | ||
} | ||
|
||
public TalkMessage(Player author, String message, Color color) { | ||
super(); | ||
setAuthor(author); | ||
this.message = message; | ||
this.color = color; | ||
|
||
} | ||
|
||
|
||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
public void setMessage(String message) { | ||
this.message = message; | ||
} | ||
|
||
public Color getColor() { | ||
return color; | ||
} | ||
|
||
public void setColor(Color color) { | ||
this.color = color; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.