Exemplo n.º 1
0
 public void receiveMobAttack(MobAttack attack) {
   for (MobInstance mob : mobs) {
     if (mob.getID() == attack.mob.ID) {
       mob.attack();
     }
   }
 }
Exemplo n.º 2
0
 private boolean hasMob(MobUpdate update, List<MobInstance> list, long time) {
   for (MobInstance mob : list) {
     if (mob.getID() == update.ID) {
       mob.updateMob(update, time);
       return true;
     }
   }
   return false;
 }
Exemplo n.º 3
0
 public void setSelectedMob(MobInstance instance) {
   if (selectedMob == null && instance != null) {
     ModelInstance temp = instance.getModelInstance();
     Material mat = temp.materials.get(0);
     originalSelectedMaterial = new Material();
     originalSelectedMaterial.set(mat);
     mat.set(selectedMaterial);
     selectedMob = instance;
     selectedMob.setSelected(true);
   } else if (instance == null && selectedMob != null) {
     ModelInstance temp = selectedMob.getModelInstance();
     Material mat = temp.materials.get(0);
     mat.clear();
     mat.set(originalSelectedMaterial);
     selectedMob.setSelected(false);
     selectedMob = instance;
   } else if (selectedMob != null && instance != null) {
     ModelInstance temp = selectedMob.getModelInstance();
     Material mat = temp.materials.get(0);
     mat.clear();
     mat.set(originalSelectedMaterial);
     selectedMob.setSelected(false);
     ModelInstance temp2 = instance.getModelInstance();
     Material mat2 = temp2.materials.get(0);
     originalSelectedMaterial = new Material();
     originalSelectedMaterial.set(mat2);
     mat2.set(selectedMaterial);
     selectedMob = instance;
     selectedMob.setSelected(true);
   }
 }