Package transientlibs.maps.units

Examples of transientlibs.maps.units.GenericUnit


            for (int x = 0; x <= screenWidthInTiles; x++) {
               
                 {
                   
                    //GenericUnit u = map.getTile(startMapX + x, startMapY + y).units.get(0);
                    GenericUnit u =map.getUnit(startMapX + x, startMapY + y, 0);
                                                       
                    if (u != null ) {
                        //Log.info("HAVE ONE");
                       
                    gridElements.get(y).get(x).setBothImages(u.getCreatures().visualInformation.cutImages.get(u.getDirection()).get(0).get(0).referencedImages);
                    gridElements.get(y).get(x).isDrawn = true;
                   
                   
                } else {
                    resetElement (x, y);
View Full Code Here


*/
public class GDXCreatureFactory extends AbstractCreatureFactory{
   
        @Override
        public GenericUnit produceUnit(int creatureID, int onX, int onY, TilelessMap onMap) {
        GenericUnit newUnit;
        newUnit = new GDXUnit(onX, onY, creatureID, onMap);
        if (onMap != null) {           
            onMap.placeUnit(onX, onY, newUnit);
            Log.info("PLACED UNIT");
        } else {
            Log.warn("No map!");
        }
       
        if (Detonator.INSTANCE.useGDXImages) {
            newUnit.setImage(newUnit.getCreatures().masterImage);
        }

        if (newUnit.getCreatures().cards != null) {
            //Log.info("DECK TIME");
            newUnit.setDeck (new Deck());
            for (Cards c : newUnit.getCreatures().cards) {
                newUnit.getDeck().addCard(c);
            }
        }

        return newUnit;
       
View Full Code Here

        }

    }

    public Unit placeUnit(int x, int y, String byCode) {
        GenericUnit result = Detonator.INSTANCE.creatureFactory.produceUnit(byCode, x, y, this);
        //placeUnit (x, y, result);

        return (Unit) result;

        //null is to avoid placing unit twice
View Full Code Here

TOP

Related Classes of transientlibs.maps.units.GenericUnit

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.