Klammersetzung...

This commit is contained in:
Samed Bektas
2014-05-16 11:42:32 +02:00
parent c46f6bf743
commit 05596b89bd

View File

@@ -4,10 +4,11 @@ namespace WorldOfPeacecraft
{ {
private int Score; private int Score;
public delegate void LocationChangedEventHandler (int x, int y); public delegate void LocationChangedEventHandler(int x, int y);
public event LocationChangedEventHandler LocationChanged; public event LocationChangedEventHandler LocationChanged;
public Player (int id, int posX, int posY, string desc, bool busy, int score) : base(id, posX, posY, desc, busy) public Player(int id, int posX, int posY, string desc, bool busy, int score)
: base(id, posX, posY, desc, busy)
{ {
this.SetScore(score); this.SetScore(score);
} }
@@ -17,25 +18,29 @@ namespace WorldOfPeacecraft
this.Score = score; this.Score = score;
} }
public int GetScore () public int GetScore()
{ {
return Score; return Score;
} }
public string GetName () public string GetName()
{ {
return Desc; return Desc;
} }
public override void SetPos (int x, int y) public override void SetPos(int x, int y)
{ {
bool positionChanged = false; bool positionChanged = false;
if (x != GetX() || y != GetY ()) if (x != GetX() || y != GetY())
{
positionChanged = true; positionChanged = true;
base.SetPos (x, y); base.SetPos(x, y);
}
if (positionChanged && LocationChanged != null) if (positionChanged && LocationChanged != null)
{
LocationChanged(x, y); LocationChanged(x, y);
} }
}
public override string ToString() public override string ToString()
{ {