Java Code Examples for com.badlogic.gdx.utils.ObjectMap

The following examples show how to use com.badlogic.gdx.utils.ObjectMap. These examples are extracted from open source projects. 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: talos   Source File: FileTracker.java    License: Apache License 2.0 6 votes vote down vote up
public void addSavedResourcePathsFor (FileTab currentTab, Array<String> savedResourcePaths) {

        if(savedResourcePaths == null) return;

        final ObjectMap<FileHandle, FileEntry> entries = new ObjectMap<>();
        for (String savedResourcePath : savedResourcePaths) {
            FileHandle fileHandle = Gdx.files.absolute(savedResourcePath);
            FileEntry fileEntry = new FileEntry(fileHandle, new Tracker() {
                @Override
                public void updated (FileHandle handle) {

                }
            });
            entries.put(fileHandle, fileEntry);
        }

        tabMaps.put(currentTab, entries);
    }
 
Example 2
Source Project: gdx-gltf   Source File: SeparatedDataFileResolver.java    License: Apache License 2.0 6 votes vote down vote up
private ObjectMap<Integer, ByteBuffer> loadBuffers(FileHandle path) {
	
	if(glModel.buffers != null){
		for(int i=0 ; i<glModel.buffers.size ; i++){
			GLTFBuffer glBuffer = glModel.buffers.get(i);
			ByteBuffer buffer = ByteBuffer.allocate(glBuffer.byteLength);
			buffer.order(ByteOrder.LITTLE_ENDIAN);
			if(glBuffer.uri.startsWith("data:")){
				// data:application/octet-stream;base64,
				String [] headerBody = glBuffer.uri.split(",", 2);
				String header = headerBody[0];
				// System.out.println(header);
				String body = headerBody[1];
				byte [] data = Base64Coder.decode(body);
				buffer.put(data);
			}else{
				FileHandle file = path.child(glBuffer.uri);
				buffer.put(file.readBytes());
			}
			bufferMap.put(i, buffer);
		}
	}
	return bufferMap;
}
 
Example 3
Source Project: uracer-kotd   Source File: Art.java    License: Apache License 2.0 6 votes vote down vote up
private static void loadMeshesGraphics (boolean mipmap) {
	meshTrackWall = newTexture("data/track/wall_4.png", mipmap);
	meshTrackWall.setWrap(TextureWrap.ClampToEdge, TextureWrap.ClampToEdge);

	meshMissing = newTexture("data/3d/textures/missing-mesh.png", mipmap);

	// car textures
	meshCar = new ObjectMap<String, Texture>();
	meshCar.put("car", newTexture("data/3d/textures/car.png", mipmap));
	meshCar.put("car_yellow", newTexture("data/3d/textures/car_yellow.png", mipmap));
	// meshCar.get("car").setFilter(TextureFilter.Linear, TextureFilter.Linear);
	// meshCar.get("car_yellow").setFilter(TextureFilter.Linear, TextureFilter.Linear);

	// trees
	meshTreeTrunk = newTexture("data/3d/textures/trunk_6_col.png", mipmap);
	meshTreeLeavesSpring = new Texture[7];
	for (int i = 0; i < 7; i++) {
		meshTreeLeavesSpring[i] = newTexture("data/3d/textures/leaves_" + (i + 1) + "_spring_1.png", mipmap);
	}
}
 
Example 4
Source Project: RuinsOfRevenge   Source File: ServerConnection.java    License: MIT License 6 votes vote down vote up
public ServerConnection(ServerMaster master, int tcpPort, int udpPort) throws IOException {
	this.master = master;
	this.server = new Server();
	this.queue = new LinkedBlockingQueue<>();
	this.connectedClients = new ObjectMap<>();

	Register.registerAll(server.getKryo());
	server.start();
	server.bind(tcpPort, udpPort);
	server.addListener(new QueuedListener(this) {
		@Override
		protected void queue(Runnable runnable) {
			queue.add(runnable);
		}
	});
}
 
Example 5
Source Project: gdx-skineditor   Source File: Skin.java    License: Apache License 2.0 6 votes vote down vote up
public <T> T get(String name, Class<T> type) {
	if (name == null)
		throw new IllegalArgumentException("name cannot be null.");
	if (type == null)
		throw new IllegalArgumentException("type cannot be null.");

	if (type == Drawable.class)
		return (T) getDrawable(name);
	if (type == TextureRegion.class)
		return (T) getRegion(name);
	if (type == NinePatch.class)
		return (T) getPatch(name);
	if (type == Sprite.class)
		return (T) getSprite(name);

	ObjectMap<String, Object> typeResources = resources.get(type);
	if (typeResources == null)
		throw new GdxRuntimeException("No " + type.getName() + " registered with name: " + name);
	Object resource = typeResources.get(name);
	if (resource == null)
		throw new GdxRuntimeException("No " + type.getName() + " registered with name: " + name);
	return (T) resource;
}
 
Example 6
Source Project: dice-heroes   Source File: ThesaurusLoader.java    License: GNU General Public License v3.0 6 votes vote down vote up
@Override public void loadAsync(AssetManager manager, String fileName, FileHandle file, ThesaurusLoader.ThesaurusParameter parameter) {
    Constructor constructor = new Constructor(ThesaurusData.class);
    Yaml yaml = new Yaml(constructor);
    ObjectMap<String, ThesaurusData> data = new ObjectMap<String, ThesaurusData>();
    for (Object o : yaml.loadAll(resolve(fileName).read())) {
        ThesaurusData description = (ThesaurusData) o;
        data.put(description.key, description);
    }
    if (parameter != null && parameter.other.length > 0) {
        for (String depName : parameter.other) {
            Thesaurus dep = manager.get(depName);
            data.putAll(dep.data);
        }
    }
    thesaurus = new Thesaurus(data);
}
 
Example 7
Source Project: skin-composer   Source File: RootTable.java    License: MIT License 6 votes vote down vote up
public RootTable(Main main) {
    super(main.getSkin());
    this.stage = main.getStage();
    this.main = main;
    
    previewProperties = new ObjectMap<>();
    
    scrollPaneListener = new ScrollPaneListener();
    previewFonts = new Array<>();
    
    main.getAtlasData().produceAtlas();
    
    main.getStage().addListener(new ShortcutListener(this));
    
    filesDroppedListener = (Array<FileHandle> files) -> {
        for (FileHandle fileHandle : files) {
            if (fileHandle.extension().toLowerCase(Locale.ROOT).equals("scmp")) {
                fire(new ScmpDroppedEvent(fileHandle));
                break;
            }
        }
    };
    
    main.getDesktopWorker().addFilesDroppedListener(filesDroppedListener);
}
 
Example 8
Source Project: dice-heroes   Source File: CraftingPane.java    License: GNU General Public License v3.0 6 votes vote down vote up
public CraftingPane(int elementsCount, Array<Ability> recipes) {
        super(Config.skin);
        this.inputs = new ObjectMap<Actor, ItemIcon>(elementsCount);
        this.count = elementsCount;
        this.recipes = recipes;
//        defaults().pad(2);
        for (int i = 0; i < elementsCount; i++) {
            Image image = new Image(Config.skin, "ui-crafting-slot");
            image.setName("slot#" + i);
            inputs.put(image, null);
            add(image).size(26);
            if (i != elementsCount - 1) {
                add(new Tile("ui-plus")).pad(1);
            } else {
                add(new Tile("ui-equals")).pad(1);
            }
        }
        add(output).size(26);
        setTouchable(Touchable.enabled);
    }
 
Example 9
Source Project: dice-heroes   Source File: LevelsLoader.java    License: GNU General Public License v3.0 6 votes vote down vote up
@Override @SuppressWarnings("unchecked") public void loadAsync(AssetManager manager, String fileName, FileHandle file, AssetLoaderParameters<Levels> parameter) {
    Yaml yaml = new Yaml();
    ObjectMap<String, BaseLevelDescription> data = new ObjectMap<String, BaseLevelDescription>();
    for (Object o : yaml.loadAll(resolve(fileName).read())) {
        HashMap<String, Object> value = (HashMap<String, Object>) o;
        String type = MapHelper.get(value, "type", "level");
        try {
            BaseLevelDescription desc = types.get(type).getConstructor(Map.class).newInstance(value);
            data.put(desc.name, desc);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

    }
    levels = new Levels(data);
    Config.levels = levels;
}
 
Example 10
Source Project: gdx-soundboard   Source File: MusicEventManager.java    License: MIT License 6 votes vote down vote up
/**
 * Remove an event.
 * 
 * @param stateName
 *            The name of the event.
 */
public void remove(String stateName) {
    final MusicState event = this.states.remove(stateName);
    if (event != null) {

        for (final ObjectMap.Entry<String, MusicState> entry : this.states) {
            entry.value.removeEnterTransition(stateName);
            entry.value.removeExitTransition(stateName);
        }

        event.dispose();

        if (currentState == event) {
            currentState = null;
        }
        for (int i = 0; i < listeners.size; i++) {
            final MusicEventListener observer = listeners.get(i);
            observer.stateRemoved(event);
        }
    }
}
 
Example 11
private void initMatch(PvpPlayState state) {
    Logger.debug("server: init match "+this.state.session.getMode().name);
    PvpMode mode = this.state.session.getMode();
    LevelDescription level = mode.levels.random();
    String levelName = level.name;
    Array<Fraction> fractions = new Array<Fraction>(level.fractions.size);
    for (Fraction fraction : level.fractions) {
        fractions.add(fraction);
    }
    Array<String> ids = this.state.session.getAll().keys().toArray();
    ids.shuffle();
    ObjectMap<String, String> fMap = new ObjectMap<String, String>();
    for (int i = 0; i < ids.size; i++) {
        fMap.put(ids.get(i), fractions.get(i).name);
    }
    int seed = MathUtils.random.nextInt();
    awaitSpawning(state);
    sendToAll(new Init(levelName, fMap, seed));
}
 
Example 12
@Override protected void init(final PvpPlayState state) {
    Logger.debug("client: wait for server to init");
    register(Init.class, new IMessageProcessor<Init>() {
        @Override public void receive(IParticipant from, Init message) {
            if (message.version > Config.mobileApi.getVersionCode()) {
                sendToWithCallback(state.server, new UpdateNeeded()).addListener(new IFutureListener<Boolean>() {
                    @Override public void onHappened(Boolean aBoolean) {
                        session.disconnect(false, Config.thesaurus.localize("disconnect-server-needs-update"));
                    }
                });
                return;
            } else if (message.version < Config.mobileApi.getVersionCode()) {
                session.disconnect(false, Config.thesaurus.localize("disconnect-update-needed"));
                return;
            }
            LevelDescription level = (LevelDescription) Config.levels.get(message.level);
            ObjectMap<IParticipant, Fraction> fractions = new ObjectMap<IParticipant, Fraction>();
            for (ObjectMap.Entry<String, String> e : message.fractions.entries()) {
                fractions.put(ClientMessageListener.this.state.session.getAll().get(e.key), Fraction.valueOf(e.value));
            }
            ClientMessageListener.this.state.prepare(level, fractions, message.seed);
            unregister(Init.class);
            awaitSpawns(state);
        }
    });
}
 
Example 13
Source Project: talos   Source File: InterpolationMappings.java    License: Apache License 2.0 5 votes vote down vote up
public static String getNameForInterpolation (Interpolation interpolation) {
	for (ObjectMap.Entry<String, Interpolation> name : names) {
		if (name.value == interpolation) {
			return name.key;
		}
	}
	return "fade";
}
 
Example 14
Source Project: bladecoder-adventure-engine   Source File: BladeJson.java    License: Apache License 2.0 5 votes vote down vote up
public BladeJson(World w, Mode mode, boolean init) {
	super();

	this.w = w;
	this.mode = mode;
	this.init = init;

	// Add tags for known classes to reduce .json size.
	addClassTag(SpineAnimationDesc.class);
	addClassTag(AtlasAnimationDesc.class);

	addClassTag(CharacterActor.class);
	addClassTag(AnchorActor.class);
	addClassTag(ObstacleActor.class);
	addClassTag(InteractiveActor.class);
	addClassTag(SpriteActor.class);
	addClassTag(WalkZoneActor.class);

	addClassTag(AtlasRenderer.class);
	addClassTag(ImageRenderer.class);
	addClassTag(ParticleRenderer.class);
	addClassTag(Sprite3DRenderer.class);
	addClassTag(TextRenderer.class);

	ObjectMap<String, Class<? extends Action>> classTags = ActionFactory.getClassTags();

	for (ObjectMap.Entry<String, Class<? extends Action>> e : classTags.entries()) {
		addClassTag(e.key, e.value);
	}

}
 
Example 15
Source Project: talos   Source File: FileTracker.java    License: Apache License 2.0 5 votes vote down vote up
public void update() {
    Array<FileHandle> filesToRemove = new Array<>();

    final FileTab currentTab = TalosMain.Instance().ProjectController().currentTab;

    for (ObjectMap.Entry<FileTab, ObjectMap<FileHandle, FileEntry>> tabMapEntry : tabMaps) {
        boolean isCurrentTab = tabMapEntry.key == currentTab;

        final ObjectMap<FileHandle, FileEntry> files = tabMapEntry.value;


        for (ObjectMap.Entry<FileHandle, FileEntry> entry : files) {
            final FileEntry fileEntry = entry.value;
            if(!fileEntry.fileHandle.exists()) {
                filesToRemove.add(fileEntry.fileHandle);
            }
            if(fileEntry.lastModified < fileEntry.fileHandle.lastModified()) {
                if (isCurrentTab) {
                    fileEntry.callback.updated(fileEntry.fileHandle);
                }
                fileEntry.lastModified = fileEntry.fileHandle.lastModified();
            }
        }


        for (FileHandle handle: filesToRemove) {
            files.remove(handle);
        }
    }


}
 
Example 16
Source Project: talos   Source File: ProjectData.java    License: Apache License 2.0 5 votes vote down vote up
public void setFrom (ModuleBoardWidget moduleBoardWidget) {
	final ObjectMap<ParticleEmitterWrapper, Array<ModuleWrapper>> moduleWrappers = moduleBoardWidget.moduleWrappers;
	final ObjectMap<ParticleEmitterWrapper, Array<ModuleBoardWidget.NodeConnection>> nodeConnections = moduleBoardWidget.nodeConnections;

	emitters.clear();

	for (ParticleEmitterWrapper key : moduleWrappers.keys()) {
		final EmitterData emitterData = new EmitterData();
		emitterData.name = key.getName();
		emitterData.sortPosition = key.getEmitter().getSortPosition();
		emitterData.modules.addAll(moduleWrappers.get(key));

		final Array<ModuleBoardWidget.NodeConnection> nodeConns = nodeConnections.get(key);
		if(nodeConns != null) {
			for (ModuleBoardWidget.NodeConnection nodeConn : nodeConns) {
				emitterData.connections.add(new ConnectionData(nodeConn.fromModule.getId(), nodeConn.toModule.getId(), nodeConn.fromSlot, nodeConn.toSlot));
			}
		}

		// add groups
		for(ModuleWrapperGroup group: moduleBoardWidget.getGroups(key)) {
			GroupData groupData = new GroupData();
			groupData.text = group.getText();
			groupData.modules = new Array<>();
			groupData.color = group.getFrameColor().toFloatBits();
			for(ModuleWrapper wrapper: group.getModuleWrappers()) {
				groupData.modules.add(wrapper.getId());
			}
			emitterData.groups.add(groupData);
		}

		emitters.add(emitterData);
	}
}
 
Example 17
Source Project: dice-heroes   Source File: LocLabel.java    License: GNU General Public License v3.0 5 votes vote down vote up
public void setParams(ObjectMap<String, String> params) {
    if (this.params.equals(params))
        return;
    this.params = params;
    if (getStage() != null) {
        Config.thesaurus.register(this, key, params);
    }
}
 
Example 18
Source Project: gdx-gltf   Source File: GLTFDemoUI.java    License: Apache License 2.0 5 votes vote down vote up
public void setCameras(ObjectMap<Node, Camera> cameras) {
	Array<String> cameraNames = new Array<String>();
	cameraNames.add("");
	for(Entry<Node, Camera> e : cameras){
		cameraNames.add(e.key.id);
	}
	cameraSelector.setItems();
	cameraSelector.setItems(cameraNames);
}
 
Example 19
Source Project: dice-heroes   Source File: RoomController.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override public void onRoomConnected(final int statusCode, final Room room) {
    Logger.log("room connected, status ok: " + (statusCode == GamesStatusCodes.STATUS_OK));
    if (statusCode != GamesStatusCodes.STATUS_OK) {
        die(false, Config.thesaurus.localize("disconnect-game-services-error"));
        return;
    }
    RoomController.this.room = room;
    session.setVariant(room.getVariant());
    String playerId = room.getParticipantId(Games.Players.getCurrentPlayerId(multiplayer.client));

    for (Participant participant : room.getParticipants()) {
        if (participant.getStatus() != Participant.STATUS_JOINED)
            continue;
        if (participant.getParticipantId().equals(playerId)) {
            me = new MultiplayerParticipant(participant);
        } else {
            others.add(new MultiplayerParticipant(participant));
        }
    }
    all.put(me.getId(), me);
    for (MultiplayerParticipant p : others) {
        all.put(p.getId(), p);
    }
    publicOthers = new ObjectSet<IParticipant>(others);
    publicAll = new ObjectMap<String, IParticipant>(all);

    multiplayer.updateInvites();
    Logger.log("  - room: " + RoomController.this.toString(room));
}
 
Example 20
Source Project: gdx-gltf   Source File: GLTFCameraExporter.java    License: Apache License 2.0 5 votes vote down vote up
public void export(ObjectMap<Node, Camera> cameras) {
	for(Entry<Node, Camera> entry : cameras){
		int nodeID = base.nodeMapping.indexOf(entry.key, true);
		if(nodeID < 0) throw new GdxRuntimeException("node not found");
		GLTFNode glNode = base.root.nodes.get(nodeID);
		if(base.root.cameras == null){
			base.root.cameras = new Array<GLTFCamera>();
		}
		glNode.camera = base.root.cameras.size;
		base.root.cameras.add(export(entry.value));
	}
}
 
Example 21
Source Project: gdx-gltf   Source File: GLTFMeshExporter.java    License: Apache License 2.0 5 votes vote down vote up
GLTFPrimitive exportMeshPart(MeshPart meshPart) {
	Mesh mesh = meshPart.mesh;
	GLTFPrimitive primitive = new GLTFPrimitive();
	primitive.attributes = new ObjectMap<String, Integer>();
	primitive.mode = mapPrimitiveMode(meshPart.primitiveType);
	
	GLTFPrimitive layout = layouts.get(mesh);
	if(layout != null){
		copyLayout(primitive, layout);
	}else{
		layouts.put(mesh, primitive);
		exportMesh(primitive, mesh);
	}
	
	// mesh may not have indices
	if(mesh.getNumIndices() > 0)
	{
		ShortBuffer outBuffer = base.binManager.beginShorts(meshPart.size);
		ShortBuffer inBuffer = mesh.getIndicesBuffer();
		if(meshPart.offset == 0 && meshPart.size == mesh.getNumIndices()){
			outBuffer.put(mesh.getIndicesBuffer());
		}else{
			short[] localIndices = new short[meshPart.size];
			inBuffer.position(meshPart.offset);
			inBuffer.get(localIndices);
			outBuffer.put(localIndices);
		}
		inBuffer.rewind();
		
		GLTFAccessor accessor = base.obtainAccessor();
		accessor.type = GLTFTypes.TYPE_SCALAR;
		accessor.componentType = GLTFTypes.C_SHORT;
		accessor.count = meshPart.size;
		accessor.bufferView = base.binManager.end();
		
		primitive.indices = base.root.accessors.size-1;
	}
	
	return primitive;
}
 
Example 22
Source Project: gdx-facebook   Source File: GDXFacebookGraphRequest.java    License: Apache License 2.0 5 votes vote down vote up
public String getJavascriptObjectString() {
    StringBuffer convertedParameters = new StringBuffer();

    for (ObjectMap.Entry<String, String> entry : fields) {
        convertedParameters.append(entry.key);
        convertedParameters.append(":\"");
        convertedParameters.append(entry.value.replace("\"", "\\\""));
        convertedParameters.append("\",");
    }
    if (convertedParameters.length() > 0)
        convertedParameters.deleteCharAt(convertedParameters.length() - 1);


    return convertedParameters.toString();
}
 
Example 23
Source Project: gdx-controllerutils   Source File: JamepadTest.java    License: Apache License 2.0 5 votes vote down vote up
private void updateStateOfButtons() {
    for (ObjectMap.Entry<ControllerButton, Label> entry : buttonToLabel.entries()) {
        if (selectedController == null) {
            entry.value.setColor(Color.DARK_GRAY);
        } else {
            boolean pressed = selectedController.getButton(entry.key.ordinal());
            entry.value.setColor(pressed ? RED : WHITE);
        }
    }
}
 
Example 24
Source Project: skin-composer   Source File: Dialog9Patch.java    License: MIT License 5 votes vote down vote up
public Dialog9Patch(Main main, ObjectMap<DrawableData, Drawable> drawablePairs) {
    super("", main.getSkin(), "dialog");
    previewBGcolor = new Color(Color.WHITE);
    listeners = new Array<>();
    this.main = main;
    this.drawablePairs = drawablePairs;
    
    var cursor = Utils.textureRegionToCursor(main.getSkin().getRegion("cursor_resize_horizontal"), 16, 16);
    horizontalResizeListener = new ResizeFourArrowListener(cursor);

    cursor = Utils.textureRegionToCursor(main.getSkin().getRegion("cursor_resize_vertical"), 16, 16);
    verticalResizeListener = new ResizeFourArrowListener(cursor);

    cursor = Utils.textureRegionToCursor(main.getSkin().getRegion("cursor_resize_nw"), 16, 16);
    nwResizeListener = new ResizeFourArrowListener(cursor);

    cursor = Utils.textureRegionToCursor(main.getSkin().getRegion("cursor_resize_ne"), 16, 16);
    neResizeListener = new ResizeFourArrowListener(cursor);

    filesDroppedListener = (Array<FileHandle> files) -> {
        if (files.size > 0 && files.first().extension().equalsIgnoreCase("png")) {
            Runnable runnable = () -> {
                Gdx.app.postRunnable(() -> {
                    loadImage(files.first());
                });
            };
            
            main.getDialogFactory().showDialogLoading(runnable);
        }
    };
    
    main.getDesktopWorker().addFilesDroppedListener(filesDroppedListener);
    
    populate();
}
 
Example 25
Source Project: gdx-skineditor   Source File: ColorPickerDialog.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Check if the color is already in use somewhere else in the skin
 */
public boolean isColorInUse(Color color) {

	try {
		// Check if it is already in use somewhere!
		for (String widget : SkinEditorGame.widgets) {
			String widgetStyle = "com.badlogic.gdx.scenes.scene2d.ui." + widget + "$" + widget + "Style";
			Class<?> style = Class.forName(widgetStyle);
			ObjectMap<String, ?> styles = game.skinProject.getAll(style);
			Iterator<String> it = styles.keys().iterator();
			while (it.hasNext()) {
				Object item = styles.get((String) it.next());
				Field[] fields = ClassReflection.getFields(item.getClass());
				for (Field field : fields) {

					if (field.getType() == Color.class) {

						Color c = (Color) field.get(item);
						if (color.equals(c)) {
							return true;
						}

					}

				}

			}

		}
	} catch (Exception e) {
		e.printStackTrace();

	}

	return false;
}
 
Example 26
Source Project: gdx-ai   Source File: BehaviorTreeLibrary.java    License: Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("rawtypes")
	private BehaviorTreeLibrary (FileHandleResolver resolver, AssetManager assetManager, int parseDebugLevel) {
		this.resolver = resolver;
//		this.assetManager = assetManager;
		this.repository = new ObjectMap<String, BehaviorTree<?>>();
		this.parser = new BehaviorTreeParser(parseDebugLevel);
	}
 
Example 27
Source Project: dice-heroes   Source File: LevelResult.java    License: GNU General Public License v3.0 5 votes vote down vote up
public LevelResult(ObjectIntMap<Die> addedExperience,
                   ObjectMap<Fraction, Player> players,
                   Player viewer) {
    this.addedExperience = addedExperience;
    this.players = players;
    this.viewer = viewer;
}
 
Example 28
Source Project: dice-heroes   Source File: World.java    License: GNU General Public License v3.0 5 votes vote down vote up
public World(Player viewer, ObjectMap<Fraction, Player> players, PlayerColors playerColors, LevelDescription level, Stage stage) {
    this.viewer = viewer;
    this.players = players;
    this.playerColors = playerColors;
    this.level = level;
    this.stage = stage;
    width = level.width;
    height = level.height;
}
 
Example 29
public AreaOfAttackResult(Ability ability, Creature creature, Array<Creature> targets, AttackType attackType, int level) {
    this.ability = ability;
    this.creature = creature;
    this.targets = targets;
    this.attackType = attackType;
    this.level = level;
    this.effects = new ObjectMap<Creature, CreatureEffect>();
    for (Creature c : targets) {
        CreatureEffect effect = new DelayedAttackBonusEffect(ability, attackType, level);
        effects.put(c, effect);
    }
    casterEffect = new RemoveEffectsEffect(effects);
}
 
Example 30
Source Project: RuinsOfRevenge   Source File: ResourceLoader.java    License: MIT License 5 votes vote down vote up
public ResourceLoader(FileLocation fileLocation, FileHandle resourceXml) throws IOException {
	this.fileLocation = fileLocation;
	regions = new ObjectMap<>();
	anims = new ObjectMap<>();
	skins = new ObjectMap<>();

	Element resources = new XmlReader().parse(resourceXml);
	readResourcesTag(resources);
}