-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayerFacade.java
More file actions
40 lines (35 loc) · 1.23 KB
/
PlayerFacade.java
File metadata and controls
40 lines (35 loc) · 1.23 KB
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
34
35
36
37
38
39
40
import java.io.Serializable;
import java.awt.Color;
/**
* Lightweight object designed for sending player information to the server.
* <p>
* Using a dude as its constructor parameter, pulls some basic info and populates its own variables so it can be sent instead of a bloated dude object.
* </p>
*
* @author Joeseph Agnelli, Mackenzie Neaton, Ken Rissew, Andrew Curry
* @version 1.0
*/
public class PlayerFacade implements Serializable{
private static final long serialVersionUID = 6L;
protected int x;
protected int y; // Position in the battlefield
protected Color col; // Team color
protected double xSpeed;
protected double ySpeed; // Movement speed
protected int playerScore; // Lives left
protected String playerNick=""; // Nickname
/**
* Constructor takes in a Dude object, rips some values and is sent to server in a Window.java inner class.
*
* @param d The dude being sent to the server
*/
public PlayerFacade(Dude d){
this.x = d.myX;
this.y = d.myY;
this.col = d.col;
this.xSpeed = d.xSpeed;
this.ySpeed = d.ySpeed;
this.playerScore = d.playerScore;
this.playerNick = d.playerNick; // Just ripping the values from the given dude
}
}