-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
139 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
core/src/main/java/de/bitbrain/braingdx/assets/annotations/AssetSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package de.bitbrain.braingdx.assets.annotations; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Target({ElementType.TYPE, ElementType.FIELD}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface AssetSource { | ||
String directory() default ""; | ||
Class<?> assetClass(); | ||
} |
24 changes: 0 additions & 24 deletions
24
core/src/test/java/de/bitbrain/braingdx/assets/CustomSampleValidAssets.java
This file was deleted.
Oops, something went wrong.
65 changes: 65 additions & 0 deletions
65
core/src/test/java/de/bitbrain/braingdx/assets/SampleInvalidAssets.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* Copyright 2017 Miguel Gonzalez Sanchez | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package de.bitbrain.braingdx.assets; | ||
|
||
import com.badlogic.gdx.audio.Sound; | ||
import com.badlogic.gdx.graphics.Texture; | ||
import com.badlogic.gdx.graphics.g2d.BitmapFont; | ||
import com.badlogic.gdx.graphics.g2d.ParticleEmitter; | ||
import com.badlogic.gdx.maps.tiled.TiledMap; | ||
import de.bitbrain.braingdx.assets.annotations.AssetSource; | ||
|
||
public interface SampleInvalidAssets { | ||
|
||
String field1 = "texture-field1"; | ||
@AssetSource(directory = "textures", assetClass = Texture.class) String field2 = "texture-field2"; | ||
|
||
@AssetSource(directory = "textures", assetClass = Texture.class) | ||
interface Textures { | ||
String field1 = "texture-field1"; | ||
String field2 = "texture-field2"; | ||
} | ||
|
||
interface Musics { | ||
String field1 = "musics-field1"; | ||
String field2 = "musics-field2"; | ||
} | ||
|
||
@AssetSource(directory = "sounds", assetClass = Sound.class) | ||
interface Sounds { | ||
String field1 = "sounds-field1"; | ||
String field2 = "sounds-field2"; | ||
int invalid = 39; | ||
} | ||
|
||
@AssetSource(directory = "maps", assetClass = TiledMap.class) | ||
interface TiledMaps { | ||
String field1 = "tmx-field1"; | ||
String field2 = "tmx-field2"; | ||
} | ||
|
||
@AssetSource(directory = "particles", assetClass = ParticleEmitter.class) | ||
interface Particles { | ||
String field1 = "particles-field1"; | ||
String field2 = "particles-field2"; | ||
} | ||
|
||
@AssetSource(directory = "fonts", assetClass = BitmapFont.class) | ||
interface Fonts { | ||
String field1 = "fonts-field1"; | ||
String field2 = "fonts-field2"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters