Ejemplo n.º 1
0
 public void setWorld(NormalWorld w)
 {
     world = w;
 }
Ejemplo n.º 2
0
Archivo: Tick.cs Proyecto: Twistie/Tick
 /// <summary>
 /// Generates World Areas, placeholder till file I/O is implemented
 /// </summary>
 private void GenAreas()
 {
     World = _inject.Get<NormalWorld>(new ConstructorArgument("size", 20 ));
 }
Ejemplo n.º 3
0
 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;
     }
 }