All Downloads are FREE. Search and download functionalities are using the official Maven repository.

simple.client.WorldManager Maven / Gradle / Ivy

The newest version!
package simple.client;

import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import marauroa.common.game.RPObject;
import org.openide.util.lookup.ServiceProvider;
import simple.client.api.IWorldManager;

/**
 *
 * @author Javier A. Ortiz Bultron 
 */
@ServiceProvider(service = IWorldManager.class)
public class WorldManager implements IWorldManager {

    private static final Logger LOG
            = Logger.getLogger(WorldManager.class.getSimpleName());

    private final Map world_objects = new HashMap<>();

    @Override
    public RPObject get(RPObject.ID id) {
        return world_objects.get(id);
    }

    @Override
    public Map getWorld() {
        return world_objects;
    }

    @Override
    public void showWorld() {
        LOG.log(Level.INFO, "");
        int j = 0;
        for (RPObject object : world_objects.values()) {
            j++;
            LOG.log(Level.INFO, "{0}. {1}",
                    new Object[]{j, object});
        }
        LOG.log(Level.INFO, "");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy