Beispiel #1
0
        public void LeaveCombat()
        {
            Combat = null;
            IsInCombat = false;

            StatusMessage stat = new StatusMessage(this);
            _logger.Log(stat.getJsonString());
        }
Beispiel #2
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;
     }
 }
Beispiel #3
0
        public void JoinCombat(ICombat c)
        {
            IsInCombat = true;
            Combat = c;

            StatusMessage stat = new StatusMessage(this);
            _logger.Log(stat.getJsonString());
        }