public void setWorld(NormalWorld w) { world = w; }
/// <summary> /// Generates World Areas, placeholder till file I/O is implemented /// </summary> private void GenAreas() { World = _inject.Get<NormalWorld>(new ConstructorArgument("size", 20 )); }
public void process( IWebSocketConnection socket, LinkedList<Entity> entList, NormalWorld world ) { switch (type) { case "entityRequest": foreach( Entity e in entList ) { if( e.ID == int.Parse(args["Id"])) { StatusMessage toSend = new StatusMessage(e._char); socket.Send(toSend.getJsonString()); } } return; case "moveRoute": Entity toMove = null; foreach (Entity e in entList) { if (e.ID == int.Parse(args["Id"])) { toMove = e; } } String[] coordsList = args["moveList"].Split(','); Area[] route = new Area[coordsList.Length]; int i = 0; foreach (String s in coordsList) { String[] coordsPair = s.Split(':'); route[i] = world.GetArea(int.Parse(coordsPair[0]), int.Parse(coordsPair[1])); i++; } MoveLoop moveLoop = new MoveLoop(toMove, route, world); toMove.CurObjective = moveLoop; return; } }