Package com.l2client.component

Examples of com.l2client.component.IdentityComponent


    }
  }
 
  public int getEntityId(Component c){
    int ret = -1;
    IdentityComponent ent = entities.get(c);
    if(ent != null)
      ret = ent.getId();
   
    return ret;
  }
View Full Code Here


   
  }

  public Entity createEntity(int i) {
    Entity ret = null;
    IdentityComponent idc = null;
    if(!entityIds.contains(i)){
      idc = new IdentityComponent(i, new Entity(i));
      entityIds.add(i);
      addComponent(i, idc);   
      entities.put(idc, idc);
      log.fine("Entity created with id "+i);
    } else {
      log.severe("Create called but ID "+i+"already used ?!?");
      idc = (IdentityComponent) getComponent(i, IdentityComponent.class);
    }
    if(idc != null){
      ret = idc.getEntity();
    } else {
      log.severe("No entity on ID component for entity "+i+" with id comp "+idc);
      dumpComponents(i);
    }
    return ret;
View Full Code Here

          + " present coords are:" + e.getX() + "," + e.getY()
          + "," + e.getZ()+" -> "+ServerValues.getServerString(e.getX(), e.getY(), e.getZ()));
      if(e.getName()== null||e.getName().length()<=0 )
        e.setName(Singleton.get().getDataManager().getNpcName(((NpcData)e).getTemplateId()));
    }
    final IdentityComponent  id = (IdentityComponent) Singleton.get().getEntityManager().getComponent(e.getObjectId(), IdentityComponent.class);

////    //this could take a while so let it run async..
//    new Thread(new Runnable() {
//     
//      @Override
View Full Code Here

    }
  }

  public void remove(int obj) {
    Singleton s = Singleton.get();
    IdentityComponent id = (IdentityComponent) s.getEntityManager().getComponent(obj, IdentityComponent.class);
    if(id != null){
      Entity e = id.getEntity();
      if(e != null)
        s.getSceneManager().changeWalkerNode(e,Action.REMOVE);
System.out.println("Starting to remove comps of "+id);     
      //FIXME check this is working correctly, what if we delete one which is currently updated, better queue for removal.
      Component pos = s.getEntityManager().getComponent(obj, PositioningComponent.class);
View Full Code Here

   
  }
 
  public void removeItem(int obj) {
    Singleton s = Singleton.get();
    IdentityComponent id = (IdentityComponent) s.getEntityManager().getComponent(obj, IdentityComponent.class);
    if(id != null){
      Entity e = id.getEntity();
      if(e != null)
        s.getSceneManager().changeItemNode(e,Action.REMOVE);   
    } else {
System.out.println("ERROR!! Remove of "+id+" but no ID comp found!?! NO comps removed :-(");     
    }
View Full Code Here

TOP

Related Classes of com.l2client.component.IdentityComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.