skadistats.clarity.processor.entities.OnEntityUpdated Java Examples

The following examples show how to use skadistats.clarity.processor.entities.OnEntityUpdated. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: clarity-examples   Author: skadistats   File: Main.java    License: BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@OnEntityUpdated
public void onUpdated(Entity e, FieldPath[] updatedPaths, int updateCount) {
    if (!isHero(e)) {
        return;
    }
    ensureFieldPaths(e);
    boolean update = false;
    for (int i = 0; i < updateCount; i++) {
        if (updatedPaths[i].equals(mana) || updatedPaths[i].equals(maxMana)) {
            update = true;
            break;
        }
    }
    if (update) {
        System.out.format("%s (%s/%s)\n", e.getDtClass().getDtName(), e.getPropertyForFieldPath(mana), e.getPropertyForFieldPath(maxMana));
    }
}
 
Example #2
Source Project: parser   Author: odota   File: Wards.java    License: MIT License 5 votes vote down vote up
@OnEntityUpdated
public void onUpdated(Context ctx, Entity e, FieldPath[] fieldPaths, int num) {
    FieldPath p;
    if ((p = getFieldPathForEntity(e)) != null) {
        for (int i = 0; i < num; i++) {
            if (fieldPaths[i].equals(p)) {
                toProcess.add(new ProcessEntityCommand(e, p));
                break;
            }
        }
    }
}
 
Example #3
Source Project: clarity-analyzer   Author: spheenik   File: ObservableEntityList.java    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@OnEntityUpdated
public void onUpdate(Entity entity, FieldPath[] fieldPaths, int num) {
    lock.lock();
    try {
        markChange(CF_PROP);
        int i = entity.getIndex();
        ObservableEntity e = changes[i] == null ? entities[i] : changes[i];
        e.update(fieldPaths, num);
    } finally {
        lock.unlock();
    }
}
 
Example #4
Source Project: clarity-examples   Author: skadistats   File: SpawnsAndDeaths.java    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@OnEntityUpdated
public void onUpdated(Context ctx, Entity e, FieldPath[] fieldPaths, int num) {
    FieldPath p = getFieldPathForEntity(e);
    if (p != null) {
        for (int i = 0; i < num; i++) {
            if (fieldPaths[i].equals(p)) {
                processLifeStateChange(e, p);
                break;
            }
        }
    }
}