Package org.freerealm.property

Examples of org.freerealm.property.Property


    public float getMovementCost() {
        float movementCost = 0;
        Iterator<Property> propertyEditor = getPropertiesIterator();
        while (propertyEditor.hasNext()) {
            Property property = propertyEditor.next();
            if (property instanceof SetMovementCost) {
                SetMovementCost setMovementCost = (SetMovementCost) property;
                if (movementCost == 0 || setMovementCost.getMovementCost() < movementCost) {
                    movementCost = setMovementCost.getMovementCost();
                }
View Full Code Here


    public void addAbility(Property ability) {
        getAbilities().add(ability);
    }

    public Property getAbility(String abilityName) {
        Property returnValue = null;
        Iterator<Property> abilityIterator = abilities.iterator();
        while (abilityIterator.hasNext()) {
            Property ability = abilityIterator.next();
            if (ability.getName().equals(abilityName)) {
                returnValue = ability;
            }
        }
        return returnValue;
    }
View Full Code Here

    public int getInputQuantity(Resource resource) {
        int inputQuantity = 0;
        Iterator propertyIterator = getPropertiesIterator();
        while (propertyIterator.hasNext()) {
            Property property = (Property) propertyIterator.next();
            if (property instanceof ProduceResource) {
                ProduceResource produceResource = (ProduceResource) property;
                inputQuantity = inputQuantity + produceResource.getInputQuantity(resource);
            }
        }
View Full Code Here

    public int getOutputQuantity(Resource resource) {
        int outputQuantity = 0;
        Iterator propertyIterator = getPropertiesIterator();
        while (propertyIterator.hasNext()) {
            Property property = (Property) propertyIterator.next();
            if (property instanceof ProduceResource) {
                ProduceResource produceResource = (ProduceResource) property;
                outputQuantity = outputQuantity + produceResource.getOutputQuantity(resource);
            }
        }
View Full Code Here

    public int getMaximumOutputQuantity(Resource resource) {
        int maximumOutputQuantity = 0;
        Iterator propertyIterator = getPropertiesIterator();
        while (propertyIterator.hasNext()) {
            Property property = (Property) propertyIterator.next();
            if (property instanceof ProduceResource) {
                ProduceResource produceResource = (ProduceResource) property;
                maximumOutputQuantity = maximumOutputQuantity + produceResource.getMaximumOutputQuantity(resource);
            }
        }
View Full Code Here

    public Iterator<Resource> getInputResourcesIterator() {
        Iterator<Resource> inputResourcesIterator = null;
        Iterator propertyIterator = getPropertiesIterator();
        while (propertyIterator.hasNext()) {
            Property property = (Property) propertyIterator.next();
            if (property instanceof ProduceResource) {
                ProduceResource produceResource = (ProduceResource) property;
                inputResourcesIterator = produceResource.getInputResourcesIterator();
            }
        }
View Full Code Here

    public Iterator<Resource> getOutputResourcesIterator() {
        Iterator<Resource> outputResourcesIterator = null;
        Iterator propertyIterator = getPropertiesIterator();
        while (propertyIterator.hasNext()) {
            Property property = (Property) propertyIterator.next();
            if (property instanceof ProduceResource) {
                ProduceResource produceResource = (ProduceResource) property;
                outputResourcesIterator = produceResource.getOutputResourcesIterator();
            }
        }
View Full Code Here

    }

    public boolean isResourceProducer() {
        Iterator propertyIterator = getPropertiesIterator();
        while (propertyIterator.hasNext()) {
            Property property = (Property) propertyIterator.next();
            if (property instanceof ProduceResource) {
                return true;
            }
        }
        return false;
View Full Code Here

TOP

Related Classes of org.freerealm.property.Property

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.