Setter für das Backend

This commit is contained in:
2014-04-05 13:55:18 +02:00
parent 24612b0901
commit 202cd1638e
3 changed files with 54 additions and 35 deletions

View File

@@ -9,27 +9,47 @@ namespace Frontend
private Receiver Rec;
private Parser Parse;
private TcpClient Client;
private Dictionary<int, Dragon> Dragons;
private Dictionary<int, Player> Players;
private Map Map;
public Backend ()
{
Parse = new Parser();
Client = new TcpClient("localhost",9999);
Rec = new Receiver(Client, Parse);
Dragons = new Dictionary<int, Dragon>();
Players = new Dictionary<int, Player>();
}
public IEnumerable<IPositionable> getDragons()
{
return null;
return Dragons.Values;
}
public IEnumerable<IPositionable> getPlayers()
{
return null;
return Players.Values;
}
public void SetDragon (Dragon dragon)
{
Dragons[dragon.GetId()] = dragon;
}
public void SetPlayer (Player player)
{
Players[player.GetId()] = player;
}
public void SetMap (Map map)
{
this.Map = map;
}
public ITile[,] getMap()
{
return null;
return Map.GetTiles();
}
public void sendCommand(string command)