Example #1
0
 private void PartnersManagement(PartnerClose partnerClose, PartnerFar partnerFar)
 {
     if (partnerFar == null || partnerClose == null)
     {
         return;
     }
     partnerClose.Partner = partnerFar;
     partnerFar.Partner   = partnerClose;
 }
Example #2
0
 public void loadEntities(List <GraphicObj> listGraphicObj)
 {
     foreach (Room room in mGen.rooms)
     {
         PartnerClose partnerClose = null;
         PartnerFar   partnerFar   = null;
         foreach (Entity entity in room.entityList)
         {
             //Debug.WriteLine("{0} {1} {2}", entity.type, entity.chiefId, entity.numberMinion);
             if (entity.type == "totem")
             {
                 listGraphicObj.Add(new Totem(entity.position));
             }
             else if (entity.type == "chief")
             {
                 listGraphicObj.Add(new GangChef(entity.numberMinion, entity.position, player));
             }
             else if (entity.type == "PartnerFar")
             {
                 partnerFar = new PartnerFar(entity.position, player);
                 listGraphicObj.Add(partnerFar);
             }
             else if (entity.type == "PartnerClose")
             {
                 partnerClose = new PartnerClose(entity.position, player);
                 listGraphicObj.Add(partnerClose);
             }
             else if (entity.type == "BatSpawner")
             {
                 listGraphicObj.Add(new BadBatSpawner(entity.position, 10, 15, 5));
             }
             //else if (entity.type == "InsideWall")
             //{
             //    listGraphicObj.Add(new HorizontalInsideWall(entity.position));
             //}
             else if (entity.type == "BadBat")
             {
                 listGraphicObj.Add(new BadBat(entity.position, player));
             }
             else
             {
                 listGraphicObj.Add(new Bat(entity.position, player));
             }
         }
         PartnersManagement(partnerClose, partnerFar);
     }
 }