diff --git a/build.gradle b/build.gradle index 856bd44..a5ee297 100644 --- a/build.gradle +++ b/build.gradle @@ -2,19 +2,19 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile buildscript { ext { - kotlinVersion="1.8.10" + kotlinVersion="1.8.20" coroutineVersion="1.6.4" ktxVersion="1.11.0-rc1" jacksonVersion="2.14.2" junitVersion="5.9.2" - slf4jVersion="2.0.6" + slf4jVersion="2.0.7" semver4jVersion="3.1.0" log4jVersion="2.20.0" gdxVersion="1.11.0" - mavenResolverVersion="1.9.5" + mavenResolverVersion="1.9.7" mockitoKotlinVersion="4.1.0" eclipseCollectionsVersion="11.1.0" - fledUtilsVersion="0.1.9-SNAPSHOT" + fledUtilsVersion="0.1.10-SNAPSHOT" fledEcsVersion="0.1.9-SNAPSHOT" fledObjectUpdaterVersion="0.1.9-SNAPSHOT" } diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/DefinitionRegistryEx.kt b/definitions-builder/src/main/kotlin/fledware/definitions/DefinitionRegistryEx.kt new file mode 100644 index 0000000..27e932d --- /dev/null +++ b/definitions-builder/src/main/kotlin/fledware/definitions/DefinitionRegistryEx.kt @@ -0,0 +1,26 @@ +package fledware.definitions + +import fledware.utilities.ConcurrentHierarchyMap +import fledware.utilities.HierarchyMap +import java.util.concurrent.ConcurrentHashMap +import kotlin.reflect.KClass + + +interface DefinitionWithType { + val klass: KClass +} + +data class DefinitionWithTypeHolder( + val indexes: MutableMap> = ConcurrentHashMap() +) + +fun DefinitionRegistry>.typeIndex(): HierarchyMap { + val holder = (this as DefinitionRegistryManaged).manager.contexts + .getOrPut(DefinitionWithTypeHolder::class) { DefinitionWithTypeHolder() } + @Suppress("UNCHECKED_CAST") + return holder.indexes.computeIfAbsent(this.name) { + val index = ConcurrentHierarchyMap() + this@typeIndex.definitions.values.forEach { index.add(it.klass) } + index + } as HierarchyMap +} diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/DefinitionsManager.kt b/definitions-builder/src/main/kotlin/fledware/definitions/DefinitionsManager.kt index 8a65e19..0b0d66b 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/DefinitionsManager.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/DefinitionsManager.kt @@ -13,12 +13,15 @@ interface DefinitionsManager { val classLoader: ClassLoader /** - * all registries indexed by lifecycle name. - * - * If a Lifecycle does not create a registry, then it will not be here. + * all registries indexed by registry name. */ val registries: Map> + /** + * all instantiator factories instantiator name. + */ + val instantiatorFactories: Map> + /** * user contexts that can be used to share data. */ @@ -29,16 +32,49 @@ interface DefinitionsManager { */ val packages: List - /** - * get a registry for a given definition type. - * - * @param name the name for the registry - * @throws IllegalArgumentException if the registry doesn't exist - */ - fun registry(name: String): DefinitionRegistry - /** * */ fun tearDown() } + +/** + * finds the registry with the given name. + * + * @param name the name for the registry + * @throws IllegalArgumentException if the registry doesn't exist + */ +fun DefinitionsManager.findRegistry(name: String): DefinitionRegistry { + return registries[name] + ?: throw IllegalStateException("unable to find registry: $name") +} + +/** + * finds the registry with the given name and casts it to the + * expected registry type. + * + * @param name the name for the registry + * @param T the type to cast the registry to + * @throws IllegalArgumentException if the registry doesn't exist + * @throws ClassCastException if the registry can't be cast + */ +@Suppress("UNCHECKED_CAST") +fun DefinitionsManager.findRegistryOf(name: String): DefinitionRegistry { + return findRegistry(name) as DefinitionRegistry +} + +/** + * + */ +fun DefinitionsManager.findInstantiatorFactory(name: String): InstantiatorFactory { + return instantiatorFactories[name] + ?: throw IllegalStateException("unable to find instantiator factory: $name") +} + +/** + * + */ +@Suppress("UNCHECKED_CAST") +fun > DefinitionsManager.findInstantiatorFactoryOf(name: String): F { + return findInstantiatorFactory(name) as F +} diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/Instantiator.kt b/definitions-builder/src/main/kotlin/fledware/definitions/Instantiator.kt new file mode 100644 index 0000000..e452540 --- /dev/null +++ b/definitions-builder/src/main/kotlin/fledware/definitions/Instantiator.kt @@ -0,0 +1,41 @@ +package fledware.definitions + +import kotlin.reflect.KClass + +/** + * an instantiator for a specific definition. + * + * This is up to the implementors to define how something + * is actually created. It would be difficult to create a + * common way to create a complex object that would work + * well, be performant, and easy to use by the games that are + * actually defining entities. + * + * This part of the system can be completely left out, but + * there are some nice built-ins that can probably be used + * by things that do need to create instances. + * + * For simple objects that are self-contained, it might be + * better to put the creator right on the definition itself. + * But for object creation that is complex, or need to be cached, + * or depends on other definitions, it is probably better + * to add a little more architecture around the creation. + * + * @param I the type being instantiated + */ +interface Instantiator { + /** + * the name of the [InstantiatorFactory] that created this + */ + val factoryName: String + + /** + * the name of this [Instantiator] + */ + val instantiatorName: String + + /** + * the type that is instantiated + */ + val instantiating: KClass +} \ No newline at end of file diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/InstantiatorFactory.kt b/definitions-builder/src/main/kotlin/fledware/definitions/InstantiatorFactory.kt new file mode 100644 index 0000000..946df6c --- /dev/null +++ b/definitions-builder/src/main/kotlin/fledware/definitions/InstantiatorFactory.kt @@ -0,0 +1,40 @@ +package fledware.definitions + +interface InstantiatorFactory { + /** + * the name of this factory + */ + val factoryName: String + + /** + * All instantiators that have been created. + */ + val instantiators: Map> + + /** + * gets an instantiator if it is already created. else, + * it will create the cache the instantiator. + */ + fun getOrCreate(name: String): Instantiator +} + +/** + * + */ +interface InstantiatorFactoryManaged : InstantiatorFactory { + /** + * The [DefinitionsManager] this registry is managed by + */ + val manager: DefinitionsManager + + /** + * Called by the owning manager after all the registries have been created. + */ + fun init(manager: DefinitionsManager) + + /** + * Called to signal this registry needs to clean itself of anything + * that needs to be removed from memory. + */ + fun tearDown() +} \ No newline at end of file diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/DefinitionRegistryBuilder.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/DefinitionRegistryBuilder.kt index 08895dd..39877a9 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/builder/DefinitionRegistryBuilder.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/builder/DefinitionRegistryBuilder.kt @@ -5,6 +5,7 @@ import fledware.definitions.builder.mod.ModPackageEntry import fledware.definitions.builder.mod.SimpleModPackageEntry import fledware.definitions.exceptions.UnknownDefinitionException import fledware.definitions.exceptions.UnknownHandlerException +import kotlin.reflect.KClass /** * the name of the group for [DefinitionRegistryBuilder] @@ -21,13 +22,22 @@ val BuilderState.definitionRegistryBuilders: Map { return definitionRegistryBuilders[name] ?: throw UnknownHandlerException("unable to find DefinitionRegistryBuilder: $name") } +/** + * finds a specific [DefinitionRegistryBuilder] within the + * [definitionRegistryBuilderGroupName] group and casts it to the given types. + */ +@Suppress("UNCHECKED_CAST") +fun BuilderState.findRegistryOf(name: String): DefinitionRegistryBuilder { + return findRegistry(name) as DefinitionRegistryBuilder +} + /** * TODO: the mutators of entries need to be rethought * apply/mutate doesn't make sense for all registries. The best would be to diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/InstantiatorFactoryHolder.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/InstantiatorFactoryHolder.kt new file mode 100644 index 0000000..2c16b1a --- /dev/null +++ b/definitions-builder/src/main/kotlin/fledware/definitions/builder/InstantiatorFactoryHolder.kt @@ -0,0 +1,46 @@ +package fledware.definitions.builder + +import fledware.definitions.InstantiatorFactory +import fledware.definitions.InstantiatorFactoryManaged +import kotlin.collections.Map +import kotlin.collections.MutableMap +import kotlin.collections.mutableMapOf +import kotlin.collections.set + +val instantiatorFactoryHolderGroupName = InstantiatorFactoryHolder::class.simpleName!! + +class InstantiatorFactoryHolder : AbstractBuilderHandler() { + override val group: String + get() = instantiatorFactoryHolderGroupName + override val name: String + get() = instantiatorFactoryHolderGroupName + + val instantiators: Map> = mutableMapOf() +} + +val BuilderState.instantiatorFactoryHolder: InstantiatorFactoryHolder + get() = this.findHandlerGroupAsSingletonOf(instantiatorFactoryHolderGroupName) + +val BuilderState.instantiatorFactories: Map> + get() = this.instantiatorFactoryHolder.instantiators + +fun BuilderState.putInstantiatorFactory(factory: InstantiatorFactory) { + @Suppress("UNCHECKED_CAST") + (instantiatorFactories as MutableMap)[factory.factoryName] = + factory as InstantiatorFactoryManaged +} + +fun BuilderState.removeInstantiatorFactory(factory: InstantiatorFactory) { + (instantiatorFactories as MutableMap).remove(factory.factoryName) +} + +fun BuilderState.removeInstantiatorFactory(factory: String) { + (instantiatorFactories as MutableMap).remove(factory) +} + +fun DefinitionsBuilderFactory.withInstantiatorFactory( + factory: InstantiatorFactory +) : DefinitionsBuilderFactory { + this.putInstantiatorFactory(factory) + return this +} diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/ex/AddBuilderHandlerHandler.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/ex/AddBuilderHandlerHandler.kt index 78022a2..5a4d69b 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/builder/ex/AddBuilderHandlerHandler.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/builder/ex/AddBuilderHandlerHandler.kt @@ -34,7 +34,7 @@ open class AddBuilderHandlerHandler override val name = "AddBuilderHandler" override val processor: String = builderModEntryProcessorName - override fun processMaybe(modPackageContext: ModPackageContext, anyEntry: ModPackageEntry): Boolean { + override fun processMaybe(context: ModPackageContext, anyEntry: ModPackageEntry): Boolean { val (entry, _) = anyEntry.findAnnotatedClassOrNull(AddBuilderHandler::class) ?: return false if (!entry.klass.isSubclassOf(BuilderHandler::class)) throw IllegalArgumentException("classes annotated with @AddBuilderHandler" + diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/ex/ObjectUpdaterHandler.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/ex/ObjectUpdaterHandler.kt index fead81e..60969a2 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/builder/ex/ObjectUpdaterHandler.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/builder/ex/ObjectUpdaterHandler.kt @@ -55,7 +55,7 @@ class AddObjectUpdaterDirectiveHandler override val name: String = "AddObjectUpdaterDirective" override val processor: String = builderModEntryProcessorName - override fun processMaybe(modPackageContext: ModPackageContext, anyEntry: ModPackageEntry): Boolean { + override fun processMaybe(context: ModPackageContext, anyEntry: ModPackageEntry): Boolean { val (entry, annotation) = anyEntry.findAnnotatedClassOrNull(AddObjectUpdaterDirective::class) ?: return false if (!entry.klass.isSubclassOf(DirectiveHandler::class)) throw IllegalArgumentException( @@ -71,7 +71,7 @@ class AddObjectUpdaterDirectiveHandler ex ) } - val updater = modPackageContext.builderState.objectUpdater + val updater = context.builderState.objectUpdater when (handler) { is SelectDirective -> (updater.selects as MutableMap)[handler.name] = handler is OperationDirective -> (updater.operations as MutableMap)[handler.name] = handler @@ -104,12 +104,12 @@ open class ObjectUpdaterHandler( override val processor: String = definitionModEntryProcessorName private val parseType = object : TypeReference>() {} - override fun processMaybe(modPackageContext: ModPackageContext, anyEntry: ModPackageEntry): Boolean { + override fun processMaybe(context: ModPackageContext, anyEntry: ModPackageEntry): Boolean { val entry = anyEntry.findResourceOrNull(gatherRegex) ?: return false - val mutations = modPackageContext.readEntry(entry.path, parseType) - val objectUpdater = modPackageContext.builderState.objectUpdater + val mutations = context.readEntry(entry.path, parseType) + val objectUpdater = context.builderState.objectUpdater mutations.forEach { mutation -> - val registry = modPackageContext.builderState.findRegistry(mutation.registry) + val registry = context.builderState.findRegistry(mutation.registry) registry.mutate(mutation.definition, entry) { val target = objectUpdater.start(it) objectUpdater.executeCount(target, mutation.command) diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/ModPackageContext.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/ModPackageContext.kt index bac0cfc..a97deb1 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/ModPackageContext.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/ModPackageContext.kt @@ -53,6 +53,17 @@ fun ModPackageContext.readEntry(entry: String, klass: KClass): T { } } +/** + * reads an entry to the [T] type. + */ +fun ModPackageContext.readEntry(entry: String, klass: Class): T { + modPackage.read(entry) { + return builderState + .figureSerializer(entry) + .readAsType(it, klass) + } +} + /** * reads an entry to the [T] type. */ @@ -66,7 +77,7 @@ fun ModPackageContext.readEntry(entry: String, typeRef: TypeReference< /** * Finds an entry that starts with [entryWithoutExtension], and checks for - * each known format from [BuilderState.serialization]. + * each known format from [DefinitionsBuilderState.serializers]. * * This will return the full entry with the extension included. */ @@ -79,7 +90,7 @@ fun ModPackageContext.findEntry(entryWithoutExtension: String): String { /** * Finds an entry that starts with [entryWithoutExtension], and checks for - * each known format from [BuilderContext.serialization]. + * each known format from [DefinitionsBuilderState.serializers]. * * This will return the full entry with the extension included, or null if * no entry with any known format is found. diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/entries/AnnotatedClassEntryFactory.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/entries/AnnotatedClassEntryFactory.kt index 8f0a495..62153a8 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/entries/AnnotatedClassEntryFactory.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/entries/AnnotatedClassEntryFactory.kt @@ -13,6 +13,8 @@ class AnnotatedClassEntryFactory : AbstractBuilderHandler(), override val order: Int = 20 override fun attemptRead(modPackage: ModPackage, entry: String): List { + if (entry.endsWith("Kt.class")) + return emptyList() if (!entry.endsWith(".class")) return emptyList() val klass = modPackage.loadClass(entry).kotlin diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/packages/DirectoryModPackage.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/packages/DirectoryModPackage.kt index 4c3a16d..2c3a2e7 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/packages/DirectoryModPackage.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/packages/DirectoryModPackage.kt @@ -5,8 +5,8 @@ import java.io.InputStream class DirectoryModPackage( - override val root: File, - override val spec: String + override val spec: String, + override val root: File ) : AbstractModPackage() { override val type: String = "directory" diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/packages/DirectoryModPackageFactory.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/packages/DirectoryModPackageFactory.kt index 1e85cf4..b7a2218 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/packages/DirectoryModPackageFactory.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/packages/DirectoryModPackageFactory.kt @@ -10,6 +10,6 @@ class DirectoryModPackageFactory : AbstractModPackageFactory() { override fun actualAttemptFactory(spec: String, file: File): ModPackage? { if (!file.isDirectory) return null - return DirectoryModPackage(file, spec) + return DirectoryModPackage(spec, file) } } diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/packages/ZipModPackage.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/packages/ZipModPackage.kt deleted file mode 100644 index f4fa508..0000000 --- a/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/packages/ZipModPackage.kt +++ /dev/null @@ -1,29 +0,0 @@ -package fledware.definitions.builder.mod.packages - -import java.io.File -import java.io.InputStream -import java.util.stream.Collectors -import java.util.zip.ZipEntry -import java.util.zip.ZipFile - -class ZipModPackage( - override val root: File, - override val spec: String -) : AbstractModPackage() { - override val type: String = "zip" - val zipFile = ZipFile(root) - - override val entries: List = zipFile.stream() - .filter { !it.isDirectory } - .map { it.name } - .map { it.replace('\\', '/').removePrefix("/") } - .collect(Collectors.toList()) - - override fun read(entry: String): InputStream { - return zipFile.getInputStream(ZipEntry(entry)) - } - - override fun loadClass(entry: String): Class<*> { - throw IllegalStateException("zip files cannot have classes") - } -} \ No newline at end of file diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/packages/ZipModPackageFactory.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/packages/ZipModPackageFactory.kt index 412a66a..3419bc7 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/packages/ZipModPackageFactory.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/builder/mod/packages/ZipModPackageFactory.kt @@ -2,16 +2,41 @@ package fledware.definitions.builder.mod.packages import fledware.definitions.builder.mod.ModPackage import fledware.definitions.exceptions.ModPackageReadException +import fledware.definitions.util.md5 +import fledware.definitions.util.unzipTo import java.io.File -class ZipModPackageFactory : AbstractModPackageFactory() { +open class ZipModPackageFactory : AbstractModPackageFactory() { override val name: String = "zip" override val extension: String = "zip" override fun actualAttemptFactory(spec: String, file: File): ModPackage { if (!file.isFile) throw ModPackageReadException(spec, "zip file isn't a file: $file") - return ZipModPackage(File(spec), spec) + val unzipLocation = File(file.parent, file.nameWithoutExtension) + val hashLocation = File(unzipLocation, ".__hash") + val zipHash = file.md5() + checkPreviousUnzipLocation(file, zipHash, unzipLocation, hashLocation) + // if the unzipped location doesn't exist, extract and save the hash + if (!unzipLocation.exists()) { + file.unzipTo(unzipLocation) + hashLocation.writeText(zipHash) + } + return DirectoryModPackage(spec, unzipLocation) + } + + protected open fun checkPreviousUnzipLocation(zipLocation: File, + zipHash: String, + unzipLocation: File, + hashLocation: File) { + when { + // if nothing exists, no need to do anything + !unzipLocation.exists() -> Unit + // if there is no hash file, then delete the unzipped location + !hashLocation.exists() -> unzipLocation.deleteRecursively() + // check if the has is the same as the zip file. if not, delete + hashLocation.readText() != zipHash -> unzipLocation.deleteRecursively() + } } } diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/processors/entries/AnnotatedClassHandler.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/processors/entries/AnnotatedClassHandler.kt index 49277a9..6394ba1 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/builder/processors/entries/AnnotatedClassHandler.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/builder/processors/entries/AnnotatedClassHandler.kt @@ -15,9 +15,9 @@ class AnnotatedClassHandler( private val targetRegistry: String, private val defName: (entry: AnnotatedClassEntry) -> String ) : AbstractBuilderHandler(), ModEntryHandler { - override fun processMaybe(modPackageContext: ModPackageContext, anyEntry: ModPackageEntry): Boolean { + override fun processMaybe(context: ModPackageContext, anyEntry: ModPackageEntry): Boolean { val (entry, annotation) = anyEntry.findAnnotatedClassOrNull(annotation) ?: return false - val target = modPackageContext.builderState.findRegistry(targetRegistry) + val target = context.builderState.findRegistry(targetRegistry) val defName = defName(entry) target.apply(defName, entry, AnnotatedClassDefinition(entry.klass, annotation)) return true diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/processors/entries/AnnotatedFunctionHandler.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/processors/entries/AnnotatedFunctionHandler.kt index cde4c9b..3a2d7f2 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/builder/processors/entries/AnnotatedFunctionHandler.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/builder/processors/entries/AnnotatedFunctionHandler.kt @@ -15,9 +15,9 @@ class AnnotatedFunctionHandler( private val targetRegistry: String, private val defName: (entry: AnnotatedFunctionEntry) -> String ) : AbstractBuilderHandler(), ModEntryHandler { - override fun processMaybe(modPackageContext: ModPackageContext, anyEntry: ModPackageEntry): Boolean { + override fun processMaybe(context: ModPackageContext, anyEntry: ModPackageEntry): Boolean { val (entry, annotation) = anyEntry.findAnnotatedFunctionOrNull(annotation) ?: return false - val target = modPackageContext.builderState.findRegistry(targetRegistry) + val target = context.builderState.findRegistry(targetRegistry) val defName = defName(entry) target.apply(defName, entry, AnnotatedFunctionDefinition(entry.function, annotation)) return true diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/processors/entries/ModEntryHandler.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/processors/entries/ModEntryHandler.kt index 8d18164..a097157 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/builder/processors/entries/ModEntryHandler.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/builder/processors/entries/ModEntryHandler.kt @@ -23,21 +23,39 @@ val BuilderState.modEntryHandlers: Map get() = this.findHandlerGroupOf(modEntryHandlerGroupName) /** + * the actual processor for a single entry. This doesn't have + * to worry about threading or finding the entry. It just needs + * to check if the entry should be processed by this, and then + * does so. * + * Processing can be anything. The result doesn't have to result + * in a mutation of an object or definition. */ interface ModEntryHandler : BuilderHandler { override val group: String get() = modEntryHandlerGroupName /** + * the [fledware.definitions.builder.processors.ModEntryProcessingStep] that this + * handler is meant to be used by. * + * @see fledware.definitions.builder.processors.builderModEntryProcessorName + * for being used to mutate the builder itself + * + * @see fledware.definitions.builder.processors.definitionModEntryProcessorName + * for being used to mutate definitions */ val processor: String /** + * attempts to process [anyEntry]. + * + * If it does process the entry, return true and the ModEntryProcessingStep + * will remove this entry from further processing. * + * @return true, if the entry was processed */ - fun processMaybe(modPackageContext: ModPackageContext, anyEntry: ModPackageEntry): Boolean + fun processMaybe(context: ModPackageContext, anyEntry: ModPackageEntry): Boolean } diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/processors/entries/ResourceHandler.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/processors/entries/ResourceHandler.kt index 34b2d72..6042771 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/builder/processors/entries/ResourceHandler.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/builder/processors/entries/ResourceHandler.kt @@ -16,10 +16,10 @@ class ResourceHandler( private val targetRegistry: String, private val defName: (entry: ResourceEntry) -> String ) : AbstractBuilderHandler(), ModEntryHandler { - override fun processMaybe(modPackageContext: ModPackageContext, anyEntry: ModPackageEntry): Boolean { + override fun processMaybe(context: ModPackageContext, anyEntry: ModPackageEntry): Boolean { val entry = anyEntry.findResourceOrNull(gatherRegex) ?: return false - val result = modPackageContext.readEntry(entry.path, parseType) - val target = modPackageContext.builderState.findRegistry(targetRegistry) + val result = context.readEntry(entry.path, parseType) + val target = context.builderState.findRegistry(targetRegistry) val name = defName(entry) target.apply(name, entry, result) return true diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/registries/AnnotatedClassRegistryBuilder.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/registries/AnnotatedClassRegistryBuilder.kt index 0d2dfcc..7ff7721 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/builder/registries/AnnotatedClassRegistryBuilder.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/builder/registries/AnnotatedClassRegistryBuilder.kt @@ -1,17 +1,18 @@ package fledware.definitions.builder.registries import fledware.definitions.DefinitionRegistryManaged +import fledware.definitions.DefinitionWithType import fledware.definitions.builder.mod.ModPackageEntry import fledware.definitions.exceptions.IncompleteDefinitionException import fledware.definitions.manager.DefaultDefinitionRegistry import kotlin.reflect.KClass import kotlin.reflect.full.isSuperclassOf - +// TODO: move this to an interface and put in public place? data class AnnotatedClassDefinition( - val klass: KClass, + override val klass: KClass, val annotation: Annotation -) +): DefinitionWithType class AnnotatedClassRegistryBuilder( override val name: String, diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/registries/FullRegistryBuilder.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/registries/FullRegistryBuilder.kt new file mode 100644 index 0000000..2535f9e --- /dev/null +++ b/definitions-builder/src/main/kotlin/fledware/definitions/builder/registries/FullRegistryBuilder.kt @@ -0,0 +1,34 @@ +package fledware.definitions.builder.registries + +import fledware.definitions.DefinitionRegistryManaged +import fledware.definitions.builder.DefinitionRegistryBuilder +import fledware.definitions.builder.mod.ModPackageEntry +import fledware.definitions.manager.DefaultDefinitionRegistry + +/** + * a [DefinitionRegistryBuilder] where the raw and final definition + * is the same and never gets mutated, ony fully replaced. + */ +open class FullRegistryBuilder( + override val name: String +) : AbstractDefinitionRegistryBuilder() { + + override fun apply(name: String, + entry: ModPackageEntry, + raw: D) { + definitions.compute(name) { _, _ -> + appendFrom(name, entry) + raw + } + } + + override fun mutate(name: String, + entry: ModPackageEntry, + block: (original: D) -> D) { + throw IllegalStateException("unable to mutable annnotated classes") + } + + override fun build(): DefinitionRegistryManaged { + return DefaultDefinitionRegistry(name, definitions, definitionsFrom) + } +} \ No newline at end of file diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/serializers/BuilderSerializer.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/serializers/BuilderSerializer.kt index 75e89f0..2c1645b 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/builder/serializers/BuilderSerializer.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/builder/serializers/BuilderSerializer.kt @@ -34,6 +34,10 @@ interface BuilderSerializer : BuilderHandler { fun readAsType(input: ByteArray, type: KClass): T fun readAsType(input: String, type: KClass): T + fun readAsType(input: InputStream, type: Class): T + fun readAsType(input: ByteArray, type: Class): T + fun readAsType(input: String, type: Class): T + fun readAsType(input: InputStream, type: TypeReference): T fun readAsType(input: ByteArray, type: TypeReference): T fun readAsType(input: String, type: TypeReference): T diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/serializers/JacksonBuilderSerializer.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/serializers/JacksonBuilderSerializer.kt index 3f8c89b..df85ce1 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/builder/serializers/JacksonBuilderSerializer.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/builder/serializers/JacksonBuilderSerializer.kt @@ -52,6 +52,18 @@ open class JacksonBuilderSerializer( return mapper.readValue(input, type.javaObjectType) } + override fun readAsType(input: InputStream, type: Class): T { + return mapper.readValue(input, type) + } + + override fun readAsType(input: ByteArray, type: Class): T { + return mapper.readValue(input, type) + } + + override fun readAsType(input: String, type: Class): T { + return mapper.readValue(input, type) + } + override fun readAsType(input: InputStream, type: TypeReference): T { return mapper.readValue(input, type) } diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/std/DefaultDefinitionsBuilder.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/std/DefaultDefinitionsBuilder.kt index 8a799d5..b2d1581 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/builder/std/DefaultDefinitionsBuilder.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/builder/std/DefaultDefinitionsBuilder.kt @@ -6,6 +6,7 @@ import fledware.definitions.builder.DefinitionsBuilder import fledware.definitions.builder.DefinitionsBuilderState import fledware.definitions.builder.ModProcessingStep import fledware.definitions.builder.definitionRegistryBuilders +import fledware.definitions.builder.instantiatorFactories import fledware.definitions.builder.mod.ModPackage import fledware.definitions.builder.mod.ModPackageContext import fledware.definitions.builder.mod.ModPackageDetailsRaw @@ -17,10 +18,12 @@ import fledware.definitions.builder.mod.std.DefaultModPackageContext import fledware.definitions.builder.modProcessingSteps import fledware.definitions.builder.serializers.figureSerializer import fledware.definitions.builder.serializers.readAsType +import fledware.definitions.exceptions.DefinitionException import fledware.definitions.exceptions.ModPackageReadException import fledware.definitions.manager.DefaultDefinitionsManager import fledware.utilities.ConcurrentTypedMap import org.slf4j.LoggerFactory +import java.lang.Exception open class DefaultDefinitionsBuilder( override val state: DefinitionsBuilderState @@ -37,7 +40,8 @@ open class DefaultDefinitionsBuilder( contexts = ConcurrentTypedMap().also { state.managerContexts.values.forEach { value -> it.put(value) } }, - initialRegistries = state.definitionRegistryBuilders.values.map { it.build() } + initialRegistries = state.definitionRegistryBuilders.values.map { it.build() }, + instantiatorFactories = state.instantiatorFactories ) } @@ -68,7 +72,13 @@ open class DefaultDefinitionsBuilder( // create all the entry infos that can be processed val unhandledEntries = modPackage.entries.mapNotNull { entry -> orderedEntryParsers.firstNotNullOfOrNull { - it.attemptRead(modPackage, entry).ifEmpty { null } + try { + it.attemptRead(modPackage, entry).ifEmpty { null } + } + catch (ex: Exception) { + throw DefinitionException( + "exception in ${modPackage.name} with reading entry $entry", ex) + } } }.flatMapTo(linkedSetOf()) { it } if (logger.isDebugEnabled) { diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/builder/std/builders.kt b/definitions-builder/src/main/kotlin/fledware/definitions/builder/std/builders.kt index a96971f..01ffc7f 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/builder/std/builders.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/builder/std/builders.kt @@ -2,6 +2,7 @@ package fledware.definitions.builder.std import com.fasterxml.jackson.core.type.TypeReference import fledware.definitions.builder.DefinitionsBuilderFactory +import fledware.definitions.builder.InstantiatorFactoryHolder import fledware.definitions.builder.ex.withAddBuilderHandlerHandler import fledware.definitions.builder.ex.withObjectUpdater import fledware.definitions.builder.mod.entries.AnnotatedClassEntry @@ -41,8 +42,8 @@ fun defaultBuilder() = DefaultDefinitionsBuilderFactory() .withBuilderHandler(JarModPackageFactory()) .withBuilderHandler(AnnotatedClassEntryFactory()) .withBuilderHandler(AnnotatedFunctionEntryFactory()) - .withBuilderHandler(AnnotatedFunctionEntryFactory()) .withBuilderHandler(ResourceEntryFactory()) + .withBuilderHandler(InstantiatorFactoryHolder()) .withStandardModEntryProcessors() .withAddBuilderHandlerHandler() .withObjectUpdater() diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/AbstractInstantiatorFactory.kt b/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/AbstractInstantiatorFactory.kt new file mode 100644 index 0000000..d366ed1 --- /dev/null +++ b/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/AbstractInstantiatorFactory.kt @@ -0,0 +1,19 @@ +package fledware.definitions.instantiator + +import fledware.definitions.DefinitionsManager +import fledware.definitions.InstantiatorFactoryManaged + +abstract class AbstractInstantiatorFactory : InstantiatorFactoryManaged { + override val manager: DefinitionsManager + get() = _manager ?: throw IllegalStateException("no manager") + + private var _manager: DefinitionsManager? = null + + override fun init(manager: DefinitionsManager) { + _manager = manager + } + + override fun tearDown() { + _manager = null + } +} \ No newline at end of file diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/AnnotatedClassInstantiatorFactory.kt b/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/AnnotatedClassInstantiatorFactory.kt new file mode 100644 index 0000000..c30afa6 --- /dev/null +++ b/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/AnnotatedClassInstantiatorFactory.kt @@ -0,0 +1,31 @@ +package fledware.definitions.instantiator + +import fledware.definitions.DefinitionRegistry +import fledware.definitions.Instantiator +import fledware.definitions.builder.registries.AnnotatedClassDefinition +import java.util.concurrent.ConcurrentHashMap + +class AnnotatedClassInstantiatorFactory( + val targetRegistry: String +) : AbstractInstantiatorFactory() { + private val _instantiators: MutableMap> = ConcurrentHashMap() + + val registry: DefinitionRegistry> by lazy { + @Suppress("UNCHECKED_CAST") + manager.registries[targetRegistry] as DefinitionRegistry> + } + + @Suppress("UNCHECKED_CAST") + override val instantiators: Map> + get() = _instantiators as Map> + + override val factoryName: String + get() = targetRegistry + + @Suppress("UNCHECKED_CAST") + override fun getOrCreate(name: String): ReflectInstantiator { + return _instantiators.computeIfAbsent(name) { + ReflectInstantiator(factoryName, name, registry[name].klass) + } as ReflectInstantiator + } +} diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/ConstructorInstantiator.kt b/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/ConstructorInstantiator.kt new file mode 100644 index 0000000..98f8c48 --- /dev/null +++ b/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/ConstructorInstantiator.kt @@ -0,0 +1,56 @@ +package fledware.definitions.instantiator + +import fledware.definitions.Instantiator +import fledware.definitions.exceptions.IncompleteDefinitionException +import kotlin.reflect.KClass +import kotlin.reflect.KFunction +import kotlin.reflect.KParameter +import kotlin.reflect.cast + +/** + * an instantiator that just finds and calls the constructor with the given arguments + */ +open class ConstructorInstantiator( + final override val factoryName: String, + final override val instantiatorName: String, + final override val instantiating: KClass, + arguments: Map = mapOf() +) : Instantiator { + private val constructor: KFunction + private val arguments: Map + + init { + val argumentsCheck = mutableMapOf() + val check = instantiating.constructors.firstOrNull { + argumentsCheck.clear() + val parameters = it.parameters + if (arguments.size > parameters.size) + return@firstOrNull false + for (i in parameters.indices) { + val parameter = parameters[i] + val argument = arguments[parameter.name] + if (argument == null) { + if (!parameter.isOptional) + return@firstOrNull false + } + else { + val type = parameter.type.classifier as KClass<*> + if (!type.isInstance(argument)) + return@firstOrNull false + argumentsCheck[parameter] = argument + } + } + // they could be different parameter names, so if all the arguments + // passed in are not used, then it's considered not found as well + return@firstOrNull argumentsCheck.size == arguments.size + } + constructor = check ?: throw IncompleteDefinitionException( + factoryName, + instantiatorName, + "can't find constructor for $instantiating with $arguments" + ) + this.arguments = argumentsCheck + } + + fun create(): I = instantiating.cast(constructor.callBy(arguments)) +} \ No newline at end of file diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/ContextInstantiator.kt b/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/ContextInstantiator.kt new file mode 100644 index 0000000..15e250c --- /dev/null +++ b/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/ContextInstantiator.kt @@ -0,0 +1,32 @@ +package fledware.definitions.instantiator + +import fledware.definitions.Instantiator +import fledware.definitions.exceptions.IncompleteDefinitionException +import fledware.definitions.util.safeCallBy +import fledware.utilities.TypedMap +import kotlin.reflect.KClass +import kotlin.reflect.KFunction +import kotlin.reflect.full.cast +import kotlin.reflect.full.primaryConstructor + +open class ContextInstantiator( + final override val factoryName: String, + final override val instantiatorName: String, + final override val instantiating: KClass, + val context: TypedMap +) : Instantiator { + protected val constructor: KFunction = instantiating.primaryConstructor + ?: throw IncompleteDefinitionException( + factoryName, + instantiatorName, + "$instantiating must have a primary construct to use this instantiator") + protected val parameterToTypes = constructor.parameters + .associateWith { it.type.classifier as KClass<*> } + protected val definition = "$factoryName/$instantiatorName" + + fun create(): I { + val inputs = parameterToTypes.mapValues { context.getOrNull(it.value) } + val result = constructor.safeCallBy(definition, inputs) + return instantiating.cast(result) + } +} \ No newline at end of file diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/NotImplementedInstantiatorFactory.kt b/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/NotImplementedInstantiatorFactory.kt new file mode 100644 index 0000000..96af316 --- /dev/null +++ b/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/NotImplementedInstantiatorFactory.kt @@ -0,0 +1,15 @@ +package fledware.definitions.instantiator + +import fledware.definitions.Instantiator +import fledware.definitions.InstantiatorFactory + +class NotImplementedInstantiatorFactory( + override val factoryName: String +) : InstantiatorFactory { + override val instantiators: Map> + get() = emptyMap() + + override fun getOrCreate(name: String): Instantiator { + throw IllegalStateException("instantiation is not implemented: $factoryName/$name") + } +} \ No newline at end of file diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/NotInstantiableInstantiator.kt b/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/NotInstantiableInstantiator.kt new file mode 100644 index 0000000..69c8747 --- /dev/null +++ b/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/NotInstantiableInstantiator.kt @@ -0,0 +1,13 @@ +package fledware.definitions.instantiator + +import fledware.definitions.Instantiator +import kotlin.reflect.KClass + +/** + * placeholder for people that don't want to (or can't) deal with nullability + */ +class NotInstantiableInstantiator( + override val factoryName: String, + override val instantiatorName: String, + override val instantiating: KClass +) : Instantiator diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/ReflectInstantiator.kt b/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/ReflectInstantiator.kt new file mode 100644 index 0000000..4afe129 --- /dev/null +++ b/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/ReflectInstantiator.kt @@ -0,0 +1,130 @@ +package fledware.definitions.instantiator + +import fledware.definitions.Instantiator +import fledware.definitions.util.safeCallBy +import fledware.definitions.util.safeMutateWith +import kotlin.reflect.KClass +import kotlin.reflect.KMutableProperty1 +import kotlin.reflect.KParameter +import kotlin.reflect.full.isSubclassOf +import kotlin.reflect.full.memberProperties +import kotlin.reflect.full.primaryConstructor + +/** + * this instantiator tries to work with an entire lifecycle of a POKOs. + * It includes create methods and mutate methods so objects can try to + * be reused. This will respect access control and mutability. + * + * This also goes through great lengths to give good error messages. + * It attempts to find exactly what param is causing a type issue if + * an object cannot be created/mutated. Mainly because this will be used + * by an end user and can help debug issues when developing the game, but + * this isn't going to be used much by the developers creating the + * Lifecycle implementations. + */ +open class ReflectInstantiator( + final override val factoryName: String, + final override val instantiatorName: String, + final override val instantiating: KClass, +) : Instantiator { + + protected val constructor = instantiating.primaryConstructor + ?: throw IllegalStateException("primary constructor not found for: $instantiating") + protected val parameters = constructor.parameters.associateBy { it.name!! } + protected val properties = instantiating.memberProperties.associateBy { it.name } + protected val definition = "$factoryName/$instantiatorName" + + /** + * This tries to ensure that the types are correct for the actual + * parameter types on [instantiating]. + * + * Serialization will happen without knowing the context of what + * actual types should be. This will try to transform input to the + * expected types. + */ + fun ensureParameterTypes(input: Map): Map = buildMap { + input.forEach { (name, value) -> + if (value == null) { + this[name] = null + return@forEach + } + val parameter = parameters[name] + ?: throw IllegalArgumentException("parameter not found: $name") + this[name] = ensureType(parameter.type.classifier as KClass<*>, value) + } + } + + /** + * This tries to ensure that the types are correct for the actual + * property types on [instantiating]. + * + * Serialization will happen without knowing the context of what + * actual types should be. This will try to transform input to the + * expected types. + */ + fun ensurePropertyTypes(input: Map): Map = buildMap { + input.forEach { (name, value) -> + if (value == null) { + this[name] = null + return@forEach + } + val property = properties[name] + ?: throw IllegalArgumentException("parameter not found: $name") + this[name] = ensureType(property.returnType.classifier as KClass<*>, value) + } + } + + protected open fun ensureType(desiredType: KClass<*>, value: Any): Any { + return when { + desiredType.isInstance(value) -> value + + // check numbers. + desiredType.isSubclassOf(Number::class) && value !is Number -> value + desiredType.isSubclassOf(Number::class) && value is Number -> { + when (desiredType) { + Byte::class -> value.toByte() + Short::class -> value.toShort() + Int::class -> value.toInt() + Long::class -> value.toLong() + Float::class -> value.toFloat() + Double::class -> value.toDouble() + else -> value + } + } + + // not sure what to do... + else -> value + } + } + + open fun mutate(instance: Any, field: String, value: Any?) { + val property = properties[field] + ?: throw IllegalArgumentException("property not found: $field") + @Suppress("UNCHECKED_CAST") + val mutable = property as? KMutableProperty1 + ?: throw IllegalArgumentException("property not mutable: $field") + mutable.set(instance, value) + } + + open fun mutateWithNames(instance: Any, mutations: Map) { + check(instantiating.isInstance(instance)) { "invalid instance: $instance is not $instantiating" } + instance.safeMutateWith(definition, properties, mutations) + } + + open fun mutateWithProps(instance: Any, mutations: Map, Any?>) { + check(instantiating.isInstance(instance)) { "invalid instance: $instance is not $instantiating" } + instance.safeMutateWith(definition, mutations) + } + + @Suppress("UNCHECKED_CAST") + open fun create(): I = + constructor.safeCallBy(definition, emptyMap())!! as I + + @Suppress("UNCHECKED_CAST") + open fun createWithNames(input: Map): I = + constructor.safeCallBy(definition, parameters, input)!! as I + + @Suppress("UNCHECKED_CAST") + open fun createWithParams(input: Map): I = + constructor.safeCallBy(definition, input)!! as I +} \ No newline at end of file diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/SingletonInstantiatorFactory.kt b/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/SingletonInstantiatorFactory.kt new file mode 100644 index 0000000..b414caa --- /dev/null +++ b/definitions-builder/src/main/kotlin/fledware/definitions/instantiator/SingletonInstantiatorFactory.kt @@ -0,0 +1,20 @@ +package fledware.definitions.instantiator + +import fledware.definitions.Instantiator +import fledware.definitions.InstantiatorFactory + +open class SingletonInstantiatorFactory( + val instantiator: Instantiator +) : InstantiatorFactory { + override val factoryName: String + get() = instantiator.factoryName + + override val instantiators: Map> + get() = emptyMap() + + override fun getOrCreate(name: String): Instantiator { + return instantiator + } +} + +fun Instantiator.asSingletonFactory() = SingletonInstantiatorFactory(this) diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/manager/DefaultDefinitionRegistry.kt b/definitions-builder/src/main/kotlin/fledware/definitions/manager/DefaultDefinitionRegistry.kt index 77f00ee..56d4388 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/manager/DefaultDefinitionRegistry.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/manager/DefaultDefinitionRegistry.kt @@ -16,6 +16,5 @@ open class DefaultDefinitionRegistry( } override fun tearDown() { - } } \ No newline at end of file diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/manager/DefaultDefinitionsManager.kt b/definitions-builder/src/main/kotlin/fledware/definitions/manager/DefaultDefinitionsManager.kt index 19feb14..95d37b3 100644 --- a/definitions-builder/src/main/kotlin/fledware/definitions/manager/DefaultDefinitionsManager.kt +++ b/definitions-builder/src/main/kotlin/fledware/definitions/manager/DefaultDefinitionsManager.kt @@ -1,8 +1,8 @@ package fledware.definitions.manager -import fledware.definitions.DefinitionRegistry import fledware.definitions.DefinitionRegistryManaged import fledware.definitions.DefinitionsManager +import fledware.definitions.InstantiatorFactoryManaged import fledware.definitions.ModPackageDetails import fledware.utilities.MutableTypedMap @@ -10,7 +10,8 @@ class DefaultDefinitionsManager( override val classLoader: ClassLoader, override val packages: List, override val contexts: MutableTypedMap, - private val initialRegistries: List> + override val instantiatorFactories: Map>, + initialRegistries: List> ) : DefinitionsManager { override val registries: Map> = buildMap { initialRegistries.forEach { registry -> @@ -20,15 +21,12 @@ class DefaultDefinitionsManager( } init { - initialRegistries.forEach { it.init(this) } - } - - override fun registry(name: String): DefinitionRegistry { - return registries[name] - ?: throw IllegalArgumentException("registry not found: $name") + registries.values.forEach { it.init(this) } + instantiatorFactories.values.forEach { it.init(this) } } override fun tearDown() { - initialRegistries.forEach { it.tearDown() } + registries.values.forEach { it.tearDown() } + instantiatorFactories.values.forEach { it.tearDown() } } } \ No newline at end of file diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/manager/util.kt b/definitions-builder/src/main/kotlin/fledware/definitions/manager/util.kt new file mode 100644 index 0000000..e871c59 --- /dev/null +++ b/definitions-builder/src/main/kotlin/fledware/definitions/manager/util.kt @@ -0,0 +1,19 @@ +package fledware.definitions.manager + +import fledware.definitions.DefinitionRegistry + + +/** + * Used to walk through definitions (until block returns null), + * when one definition can lead to another. + * + * @param startName the first definition to start the walk + * @param block handed in the current definition, then returns the next definition (or null if finished) + */ +inline fun DefinitionRegistry.walk(startName: String, block: (definition: D) -> String?) { + var nameAt: String? = startName + while (nameAt != null) { + val definition = this[nameAt] + nameAt = block(definition) + } +} diff --git a/definitions-builder/src/main/kotlin/fledware/definitions/util/files.kt b/definitions-builder/src/main/kotlin/fledware/definitions/util/files.kt new file mode 100644 index 0000000..04d331f --- /dev/null +++ b/definitions-builder/src/main/kotlin/fledware/definitions/util/files.kt @@ -0,0 +1,34 @@ +package fledware.definitions.util + +import java.io.File +import java.security.DigestInputStream +import java.security.MessageDigest +import java.util.zip.ZipFile + +fun File.md5(): String { + val md = MessageDigest.getInstance("MD5") + val buffer = ByteArray(1024) + this.inputStream().use { fileInputStream -> + DigestInputStream(fileInputStream, md).use { digest -> + @Suppress("ControlFlowWithEmptyBody") + while(digest.read(buffer) > 0); + } + } + return String(md.digest()) +} + +fun File.unzipTo(location: File) { + if (location.exists()) + throw IllegalStateException("location must not exist to unzip to: $location") + location.mkdirs() + ZipFile(this).use { zipFile -> + zipFile.entries().asIterator().forEach { entry -> + if (entry.isDirectory) { + File(location, entry.name).mkdirs() + } + else { + File(location, entry.name).writeBytes(zipFile.getInputStream(entry).readAllBytes()) + } + } + } +} diff --git a/definitions-builder/src/test/kotlin/fledware/definitions/builder/ex/AddBuilderHandlerHandlerTest.kt b/definitions-builder/src/test/kotlin/fledware/definitions/builder/ex/AddBuilderHandlerHandlerTest.kt index 1c7a9ed..5c64d4b 100644 --- a/definitions-builder/src/test/kotlin/fledware/definitions/builder/ex/AddBuilderHandlerHandlerTest.kt +++ b/definitions-builder/src/test/kotlin/fledware/definitions/builder/ex/AddBuilderHandlerHandlerTest.kt @@ -3,7 +3,7 @@ package fledware.definitions.builder.ex import fledware.definitions.builder.mod.modPackageDetailsParser import fledware.definitions.builder.mod.std.DefaultModPackageDetailsParser import fledware.definitions.builder.std.defaultBuilder -import fledware.definitions.tests.testJarPath +import fledware.definitions.tests.testJarFile import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertIs @@ -13,7 +13,7 @@ class AddBuilderHandlerHandlerTest { fun canOverrideModPackageDetailsParser() { val builder = defaultBuilder().create() assertIs(builder.state.modPackageDetailsParser) - builder.withModPackage("definitions-builder-tests/add-definition-handler".testJarPath.path) + builder.withModPackage("definitions-builder-tests/add-definition-handler".testJarFile.path) assertEquals("definitions_api.tests.SomeModPackageDetailsParser", builder.state.modPackageDetailsParser::class.qualifiedName) } diff --git a/definitions-builder/src/test/kotlin/fledware/definitions/builder/ex/AddObjectUpdaterDirectiveHandlerTest.kt b/definitions-builder/src/test/kotlin/fledware/definitions/builder/ex/AddObjectUpdaterDirectiveHandlerTest.kt index cad5857..e8ecbed 100644 --- a/definitions-builder/src/test/kotlin/fledware/definitions/builder/ex/AddObjectUpdaterDirectiveHandlerTest.kt +++ b/definitions-builder/src/test/kotlin/fledware/definitions/builder/ex/AddObjectUpdaterDirectiveHandlerTest.kt @@ -1,8 +1,7 @@ package fledware.definitions.builder.ex -import fledware.definitions.builder.ex.objectUpdater import fledware.definitions.builder.std.defaultBuilder -import fledware.definitions.tests.testJarPath +import fledware.definitions.tests.testJarFile import kotlin.test.Test import kotlin.test.assertContains @@ -10,7 +9,7 @@ class AddObjectUpdaterDirectiveHandlerTest { @Test fun testBasicLoading() { val builder = defaultBuilder().create() - builder.withModPackage("definitions-builder-tests/add-object-updater-directive".testJarPath.path) + builder.withModPackage("definitions-builder-tests/add-object-updater-directive".testJarFile.path) assertContains(builder.state.objectUpdater.selects.keys, "SomeNewSelectDirective") assertContains(builder.state.objectUpdater.operations.keys, "SomeNewOperationDirective") assertContains(builder.state.objectUpdater.predicates.keys, "SomeNewPredicateDirective") diff --git a/definitions-builder/src/test/kotlin/fledware/definitions/builder/ex/ObjectUpdaterHandlerTest.kt b/definitions-builder/src/test/kotlin/fledware/definitions/builder/ex/ObjectUpdaterHandlerTest.kt index e169dab..6c7cf60 100644 --- a/definitions-builder/src/test/kotlin/fledware/definitions/builder/ex/ObjectUpdaterHandlerTest.kt +++ b/definitions-builder/src/test/kotlin/fledware/definitions/builder/ex/ObjectUpdaterHandlerTest.kt @@ -1,8 +1,7 @@ package fledware.definitions.builder.ex -import fledware.definitions.builder.ex.objectUpdater import fledware.definitions.builder.std.defaultBuilder -import fledware.definitions.tests.testJarPath +import fledware.definitions.tests.testJarFile import kotlin.test.Test import kotlin.test.assertContains @@ -10,7 +9,7 @@ class ObjectUpdaterHandlerTest { @Test fun testSimpleMutation() { val builder = defaultBuilder().create() - builder.withModPackage("definitions-builder-tests/add-object-updater-directive".testJarPath.path) + builder.withModPackage("definitions-builder-tests/add-object-updater-directive".testJarFile.path) assertContains(builder.state.objectUpdater.selects.keys, "SomeNewSelectDirective") assertContains(builder.state.objectUpdater.operations.keys, "SomeNewOperationDirective") assertContains(builder.state.objectUpdater.predicates.keys, "SomeNewPredicateDirective") diff --git a/definitions-builder/src/test/kotlin/fledware/definitions/builder/processors/entries/AnnotatedClassHandlerTest.kt b/definitions-builder/src/test/kotlin/fledware/definitions/builder/processors/entries/AnnotatedClassHandlerTest.kt index 745e750..9f6bfc7 100644 --- a/definitions-builder/src/test/kotlin/fledware/definitions/builder/processors/entries/AnnotatedClassHandlerTest.kt +++ b/definitions-builder/src/test/kotlin/fledware/definitions/builder/processors/entries/AnnotatedClassHandlerTest.kt @@ -2,7 +2,7 @@ package fledware.definitions.builder.processors.entries import fledware.definitions.builder.std.defaultBuilder import fledware.definitions.exceptions.IncompleteDefinitionException -import fledware.definitions.tests.testJarPath +import fledware.definitions.tests.testJarFile import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertFailsWith @@ -13,7 +13,7 @@ class AnnotatedClassHandlerTest { val manager = defaultBuilder() .withSomeClassAnnotation() .create() - .withModPackage("definitions-builder-tests/simple-functions-1".testJarPath.path) + .withModPackage("definitions-builder-tests/simple-functions-1".testJarFile.path) .build() val someClass = manager.someClass @@ -26,7 +26,7 @@ class AnnotatedClassHandlerTest { val manager = defaultBuilder() .withSomeDeepClassAnnotation() .create() - .withModPackage("definitions-builder-tests/simple-functions-1".testJarPath.path) + .withModPackage("definitions-builder-tests/simple-functions-1".testJarFile.path) .build() val someClass = manager.someDeepClass @@ -40,7 +40,7 @@ class AnnotatedClassHandlerTest { defaultBuilder() .withSomeDeepClassAnnotation() .create() - .withModPackage("definitions-builder-tests/simple-functions-2".testJarPath.path) + .withModPackage("definitions-builder-tests/simple-functions-2".testJarFile.path) .build() } assertEquals("lala", exception.definition) diff --git a/definitions-builder/src/test/kotlin/fledware/definitions/builder/processors/entries/AnnotatedFunctionHandlerTest.kt b/definitions-builder/src/test/kotlin/fledware/definitions/builder/processors/entries/AnnotatedFunctionHandlerTest.kt index d204eab..bf5bc1b 100644 --- a/definitions-builder/src/test/kotlin/fledware/definitions/builder/processors/entries/AnnotatedFunctionHandlerTest.kt +++ b/definitions-builder/src/test/kotlin/fledware/definitions/builder/processors/entries/AnnotatedFunctionHandlerTest.kt @@ -1,7 +1,7 @@ package fledware.definitions.builder.processors.entries import fledware.definitions.builder.std.defaultBuilder -import fledware.definitions.tests.testJarPath +import fledware.definitions.tests.testJarFile import kotlin.test.Test import kotlin.test.assertEquals @@ -12,7 +12,7 @@ class AnnotatedFunctionHandlerTest { val manager = defaultBuilder() .withSomeFunctionAnnotation() .create() - .withModPackage("definitions-builder-tests/simple-functions-1".testJarPath.path) + .withModPackage("definitions-builder-tests/simple-functions-1".testJarFile.path) .build() val someFunction = manager.someFunction diff --git a/definitions-builder/src/test/kotlin/fledware/definitions/builder/processors/entries/ResourceHandlerTest.kt b/definitions-builder/src/test/kotlin/fledware/definitions/builder/processors/entries/ResourceHandlerTest.kt index 7d67119..1c63db5 100644 --- a/definitions-builder/src/test/kotlin/fledware/definitions/builder/processors/entries/ResourceHandlerTest.kt +++ b/definitions-builder/src/test/kotlin/fledware/definitions/builder/processors/entries/ResourceHandlerTest.kt @@ -2,7 +2,7 @@ package fledware.definitions.builder.processors.entries import fledware.definitions.builder.std.defaultBuilder import fledware.definitions.exceptions.IncompleteDefinitionException -import fledware.definitions.tests.testDirectoryPath +import fledware.definitions.tests.testDirectoryFile import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.Arguments import org.junit.jupiter.params.provider.MethodSource @@ -19,14 +19,14 @@ class ResourceHandlerTest { defaultBuilder() .withSimpleFilesOthersRaw("others2") .create() - .withModPackage("definitions-builder-tests/simple-files-1".testDirectoryPath.path) + .withModPackage("definitions-builder-tests/simple-files-1".testDirectoryFile.path) .build() }), Arguments.of({ defaultBuilder() .withSimpleFilesOthers("others2") .create() - .withModPackage("definitions-builder-tests/simple-files-2".testDirectoryPath.path) + .withModPackage("definitions-builder-tests/simple-files-2".testDirectoryFile.path) .build() }) ).stream() @@ -37,7 +37,7 @@ class ResourceHandlerTest { val manager = defaultBuilder() .withSimpleFilesOthersRaw("others1") .create() - .withModPackage("definitions-builder-tests/simple-files-1".testDirectoryPath.path) + .withModPackage("definitions-builder-tests/simple-files-1".testDirectoryFile.path) .build() val others = manager.others @@ -56,8 +56,8 @@ class ResourceHandlerTest { val manager = defaultBuilder() .withSimpleFilesOthersRaw("others2") .create() - .withModPackage("definitions-builder-tests/simple-files-1".testDirectoryPath.path) - .withModPackage("definitions-builder-tests/simple-files-2".testDirectoryPath.path) + .withModPackage("definitions-builder-tests/simple-files-1".testDirectoryFile.path) + .withModPackage("definitions-builder-tests/simple-files-2".testDirectoryFile.path) .build() val other1 = manager.others["other-1"] assertEquals("hello world!", other1.someString) diff --git a/definitions-builder/src/test/kotlin/fledware/definitions/builder/processors/entries/models.kt b/definitions-builder/src/test/kotlin/fledware/definitions/builder/processors/entries/models.kt index 3ae963c..20f8f6c 100644 --- a/definitions-builder/src/test/kotlin/fledware/definitions/builder/processors/entries/models.kt +++ b/definitions-builder/src/test/kotlin/fledware/definitions/builder/processors/entries/models.kt @@ -14,6 +14,7 @@ import fledware.definitions.builder.std.withAnnotatedClassDefinitionOf import fledware.definitions.builder.std.withAnnotatedRootFunction import fledware.definitions.builder.std.withDirectoryResource import fledware.definitions.builder.std.withDirectoryResourceOf +import fledware.definitions.findRegistryOf import fledware.definitions.util.firstOfType @@ -47,8 +48,7 @@ fun DefinitionsBuilderFactory.withSimpleFilesOthers(directory: String) = @Suppress("UNCHECKED_CAST") val DefinitionsManager.others - get() = - this.registry("others") as DefinitionRegistry + get() = this.findRegistryOf("others") // ============================================================================ // @@ -63,8 +63,7 @@ fun DefinitionsBuilderFactory.withSomeFunctionAnnotation() = @Suppress("UNCHECKED_CAST") val DefinitionsManager.someFunction - get() = - this.registry("some-function") as DefinitionRegistry + get() = this.findRegistryOf("some-function") // ============================================================================ // @@ -79,8 +78,7 @@ fun DefinitionsBuilderFactory.withSomeClassAnnotation() = @Suppress("UNCHECKED_CAST") val DefinitionsManager.someClass - get() = - this.registry("some-class") as DefinitionRegistry> + get() = this.findRegistryOf>("some-class") // ============================================================================ // @@ -95,5 +93,4 @@ fun DefinitionsBuilderFactory.withSomeDeepClassAnnotation() = @Suppress("UNCHECKED_CAST") val DefinitionsManager.someDeepClass - get() = - this.registry("some-deep-class") as DefinitionRegistry> + get() = this.findRegistryOf>("some-deep-class") diff --git a/definitions-builder/src/test/kotlin/fledware/definitions/instantiator/ConstructorInstantiatorTest.kt b/definitions-builder/src/test/kotlin/fledware/definitions/instantiator/ConstructorInstantiatorTest.kt new file mode 100644 index 0000000..dfce90f --- /dev/null +++ b/definitions-builder/src/test/kotlin/fledware/definitions/instantiator/ConstructorInstantiatorTest.kt @@ -0,0 +1,71 @@ +package fledware.definitions.instantiator + +import fledware.definitions.exceptions.IncompleteDefinitionException +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertFailsWith +import kotlin.test.assertFalse + +class HelloConstructor() { + constructor(isOk: Boolean, lala: Int = 234) : this() { + this.ok = isOk + this.lala = lala + } + + constructor(lala: Int) : this() { + this.lala = lala + } + + constructor(isOk: Boolean, lala: Double) : this() { + this.ok = isOk + this.lala = lala.toInt() + } + + var ok: Boolean = false + var lala: Int = 234 +} + +class ConstructorInstantiatorTest { + @Test + fun testForEmptyConstructor() { + val instantiator = ConstructorInstantiator("test", "test", HelloConstructor::class) + val instance = instantiator.create() + assertFalse(instance.ok) + assertEquals(234, instance.lala) + } + + @Test + fun testFor2ndConstructor() { + val instantiator = ConstructorInstantiator("test", "test", HelloConstructor::class, + mapOf("isOk" to false)) + val instance = instantiator.create() + assertFalse(instance.ok) + assertEquals(234, instance.lala) + } + + @Test + fun testFor2ndConstructorWithAll() { + val instantiator = ConstructorInstantiator("test", "test", HelloConstructor::class, + mapOf("isOk" to false, "lala" to 456)) + val instance = instantiator.create() + assertFalse(instance.ok) + assertEquals(456, instance.lala) + } + + @Test + fun testForConstructorWithDifferentType() { + val instantiator = ConstructorInstantiator("test", "test", HelloConstructor::class, + mapOf("isOk" to false, "lala" to 456.0)) + val instance = instantiator.create() + assertFalse(instance.ok) + assertEquals(456, instance.lala) + } + + @Test + fun testForConstructorFailsWithInvalidType() { + assertFailsWith { + ConstructorInstantiator("test", "test", HelloConstructor::class, + mapOf("isOk" to false, "lala" to 456.0f)) + } + } +} \ No newline at end of file diff --git a/definitions-builder/src/test/kotlin/fledware/definitions/instantiator/ReflectInstantiatorTest.kt b/definitions-builder/src/test/kotlin/fledware/definitions/instantiator/ReflectInstantiatorTest.kt new file mode 100644 index 0000000..6d8e489 --- /dev/null +++ b/definitions-builder/src/test/kotlin/fledware/definitions/instantiator/ReflectInstantiatorTest.kt @@ -0,0 +1,182 @@ +package fledware.definitions.instantiator + +import fledware.definitions.exceptions.ReflectionCallException +import fledware.definitions.exceptions.ReflectionMutateException +import fledware.definitions.util.ReflectCallerReport +import fledware.definitions.util.ReflectCallerState +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertFailsWith + +data class SomeDefType(val ok: Boolean, + var blah: Int, + val stuff: String?, + val dude: String = "stuff") { + private var privateValue: Int = 1 + + @Suppress("ProtectedInFinal") + var protectedSetterValue: Boolean = true + protected set +} + +class ReflectInstantiatorTest { + val factory = ReflectInstantiator("test", "test", SomeDefType::class) + + @Test + fun testCreateWithNames() { + val map = mapOf("ok" to true, "blah" to 234, "stuff" to null, "dude" to "lala") + val instance = factory.createWithNames(map) + assertEquals(true, instance.ok) + assertEquals(234, instance.blah) + assertEquals(null, instance.stuff) + assertEquals("lala", instance.dude) + } + + @Test + fun testCreateWithNamesWithDefaults() { + val map = mapOf("ok" to true, "blah" to 234, "stuff" to null) + val instance = factory.createWithNames(map) + assertEquals(true, instance.ok) + assertEquals(234, instance.blah) + assertEquals(null, instance.stuff) + assertEquals("stuff", instance.dude) + } + + @Test + fun createWithNamesThrowsOnRequiredParam() { + val map = mapOf("ok" to true, "stuff" to "blah") + val exception = assertFailsWith { + factory.createWithNames(map) + } + assertEquals( + mapOf( + "ok" to ReflectCallerReport.valid, + "blah" to ReflectCallerReport(ReflectCallerState.InvalidNull, "must not be null"), + "stuff" to ReflectCallerReport.valid, + "dude" to ReflectCallerReport.valid + ), + exception.arguments + ) + } + + @Test + fun createWithNamesThrowsOnUnknownParam() { + val map = mapOf("ok" to true, "blah" to 234, "stuff" to null, "omg" to 123) + val exception = assertFailsWith { + factory.createWithNames(map) + } + assertEquals( + mapOf( + "ok" to ReflectCallerReport.valid, + "blah" to ReflectCallerReport.valid, + "stuff" to ReflectCallerReport.valid, + "omg" to ReflectCallerReport(ReflectCallerState.NoArgument, "parameter not found") + ), + exception.arguments + ) + } + + @Test + fun mutateWithNames() { + val map = mapOf("ok" to true, "blah" to 234, "stuff" to "blah") + val instance = factory.createWithNames(map) + assertEquals(234, instance.blah) + factory.mutateWithNames(instance, mapOf("blah" to 567)) + assertEquals(567, instance.blah) + } + + @Test + fun mutateWithNamesErrorsWithImmutableProp() { + val map = mapOf("ok" to true, "blah" to 234, "stuff" to "blah") + val instance = factory.createWithNames(map) + val exception = assertFailsWith { + factory.mutateWithNames(instance, mapOf("stuff" to "yea")) + } + assertEquals(1, exception.arguments.size) + assertEquals(ReflectCallerReport(ReflectCallerState.NotMutable, "cannot be mutated"), + exception.arguments["stuff"]) + } + + @Test + fun mutateWithNamesErrorsWithPrivateProp() { + val map = mapOf("ok" to true, "blah" to 234, "stuff" to "blah") + val instance = factory.createWithNames(map) + val exception = assertFailsWith { + factory.mutateWithNames(instance, mapOf("privateValue" to 2)) + } + assertEquals(1, exception.arguments.size) + assertEquals( + mapOf( + "privateValue" to ReflectCallerReport(ReflectCallerState.NotPublic, "setter not public: PRIVATE") + ), + exception.arguments + ) + } + + @Test + fun mutateWithNamesErrorsWithPrivateSetterProp() { + val map = mapOf("ok" to true, "blah" to 234, "stuff" to "blah") + val instance = factory.createWithNames(map) + val exception = assertFailsWith { + factory.mutateWithNames(instance, mapOf("protectedSetterValue" to false)) + } + assertEquals(1, exception.arguments.size) + assertEquals( + mapOf( + "protectedSetterValue" to ReflectCallerReport(ReflectCallerState.NotPublic, "setter not public: PROTECTED") + ), + exception.arguments + ) + } + + @Test + fun mutateWithNamesErrorsWithInvalidType() { + val map = mapOf("ok" to true, "blah" to 234, "stuff" to "blah") + val instance = factory.createWithNames(map) + val exception = assertFailsWith { + factory.mutateWithNames(instance, mapOf("stuff" to false)) + } + assertEquals(1, exception.arguments.size) + assertEquals( + mapOf( + "stuff" to ReflectCallerReport(ReflectCallerState.InvalidType, + "must be class kotlin.String: is class java.lang.Boolean (false)") + ), + exception.arguments + ) + } + + @Test + fun mutateWithNamesErrorsWithUnknownProp() { + val map = mapOf("ok" to true, "blah" to 234, "stuff" to "blah") + val instance = factory.createWithNames(map) + val exception = assertFailsWith { + factory.mutateWithNames(instance, mapOf("unknown" to "yea")) + } + assertEquals(1, exception.arguments.size) + assertEquals( + mapOf( + "unknown" to ReflectCallerReport(ReflectCallerState.NoArgument, "property not found") + ), + exception.arguments + ) + } + + @Test + fun mutateWithNamesErrorsWithMultipleIssues() { + val map = mapOf("ok" to true, "blah" to 234, "stuff" to "blah") + val instance = factory.createWithNames(map) + val exception = assertFailsWith { + factory.mutateWithNames(instance, mapOf( + "unknown" to "yea", "stuff" to "yea", "privateValue" to 2)) + } + assertEquals( + mapOf( + "stuff" to ReflectCallerReport(ReflectCallerState.NotMutable, "cannot be mutated"), + "privateValue" to ReflectCallerReport(ReflectCallerState.NotPublic, "setter not public: PRIVATE"), + "unknown" to ReflectCallerReport(ReflectCallerState.NoArgument, "property not found") + ), + exception.arguments + ) + } +} \ No newline at end of file diff --git a/definitions-builder/src/testFixtures/kotlin/fledware/definitions/tests/paths.kt b/definitions-builder/src/testFixtures/kotlin/fledware/definitions/tests/paths.kt index fd4406b..81604e8 100644 --- a/definitions-builder/src/testFixtures/kotlin/fledware/definitions/tests/paths.kt +++ b/definitions-builder/src/testFixtures/kotlin/fledware/definitions/tests/paths.kt @@ -12,21 +12,30 @@ val thisVersion by lazy { File("../../version.txt").readText() } -val String.testJarPath: File +val String.testJarFile: File get() { val version = thisVersion val lastPart = this.split('/').last() return File("$testPathPrefix/test-projects/$this/build/libs/$lastPart-$version.jar").canonicalFile } -val String.testDirectoryPath: File +val String.testJarPath: String + get() = testJarFile.canonicalPath + +val String.testDirectoryFile: File get() { thisVersion return File("$testPathPrefix/test-projects/$this/").canonicalFile } -val String.testResourcePath: File +val String.testDirectoryPath: String + get() = testDirectoryFile.canonicalPath + +val String.testResourceFile: File get() { thisVersion return File("$testPathPrefix/test-projects/$this/src/main/resources").canonicalFile } + +val String.testResourcePath: String + get() = testResourceFile.canonicalPath diff --git a/definitions-bytebuddy/build.gradle b/definitions-bytebuddy/build.gradle index 8557381..92928e9 100644 --- a/definitions-bytebuddy/build.gradle +++ b/definitions-bytebuddy/build.gradle @@ -1,9 +1,9 @@ dependencies { - api project(":definitions-api") + api project(":definitions-builder") // https://mvnrepository.com/artifact/net.bytebuddy/byte-buddy - implementation 'net.bytebuddy:byte-buddy:1.14.2' - + implementation 'net.bytebuddy:byte-buddy:1.14.4' + implementation 'net.bytebuddy:byte-buddy-agent:1.14.4' } diff --git a/definitions-bytebuddy/src/main/kotlin/fledware/definitions/bytebuddy/AppendClassLoader.kt b/definitions-bytebuddy/src/main/kotlin/fledware/definitions/bytebuddy/AppendClassLoader.kt new file mode 100644 index 0000000..bfbd11f --- /dev/null +++ b/definitions-bytebuddy/src/main/kotlin/fledware/definitions/bytebuddy/AppendClassLoader.kt @@ -0,0 +1,12 @@ +package fledware.definitions.bytebuddy + +import net.bytebuddy.dynamic.loading.InjectionClassLoader + +class AppendClassLoader : InjectionClassLoader(getSystemClassLoader(), false) { + + + + override fun doDefineClasses(typeDefinitions: MutableMap): MutableMap> { + TODO("Not yet implemented") + } +} \ No newline at end of file diff --git a/definitions-bytebuddy/src/main/kotlin/fledware/definitions/bytebuddy/AppendableClassLoader.kt b/definitions-bytebuddy/src/main/kotlin/fledware/definitions/bytebuddy/AppendableClassLoader.kt new file mode 100644 index 0000000..3c0adc4 --- /dev/null +++ b/definitions-bytebuddy/src/main/kotlin/fledware/definitions/bytebuddy/AppendableClassLoader.kt @@ -0,0 +1,103 @@ +package fledware.definitions.bytebuddy + +import java.io.IOException +import java.io.InputStream +import java.net.URL +import java.net.URLClassLoader +import java.util.Enumeration + + +class AppendableClassLoader(classpath: Array?, parent: ClassLoader?) : URLClassLoader(classpath, parent) { + private var system: ClassLoader? = getSystemClassLoader() + + + @Synchronized + @Throws(ClassNotFoundException::class) + override fun loadClass(name: String, resolve: Boolean): Class<*>? { + // First, check if the class has already been loaded + val result = findLoadedClass(name) + // checking system: jvm classes, endorsed, cmd classpath, etc. + ?: system?.attemptLoadClassSafely(name) + // checking local + ?: this.attemptLoadClassSafely(name) + // checking parent + // This call to loadClass may eventually call findClass again, in case the parent doesn't find anything. + ?: super.loadClass(name, resolve) + + if (resolve) { + resolveClass(result) + } + return result + } + + private fun ClassLoader.attemptLoadClassSafely(name: String): Class<*>? { + try { + return this.loadClass(name) + } + catch (_: ClassNotFoundException) { + } + return null + } + + override fun getResource(name: String?): URL? { + return system?.getResource(name) + ?: this.findResource(name) + ?: super.getResource(name) + } + + @Throws(IOException::class) + override fun getResources(name: String?): Enumeration { + /** + * Similar to super, but local resources are enumerated before parent resources + */ + val systemUrls: Enumeration? = system?.getResources(name) + val localUrls: Enumeration? = findResources(name) + val parentUrls: Enumeration? = parent?.getResources(name) + + val urls: MutableList = ArrayList() + +// system?.getResources(name)?.also { +// +// } +// +// systemUrls?.also { +// urls.addAll() +// } + + if (systemUrls != null) { + while (systemUrls.hasMoreElements()) { + urls.add(systemUrls.nextElement()) + } + } + if (localUrls != null) { + while (localUrls.hasMoreElements()) { + urls.add(localUrls.nextElement()) + } + } + if (parentUrls != null) { + while (parentUrls.hasMoreElements()) { + urls.add(parentUrls.nextElement()) + } + } + return object : Enumeration { + var iter: Iterator = urls.iterator() + override fun hasMoreElements(): Boolean { + return iter.hasNext() + } + + override fun nextElement(): URL? { + return iter.next() + } + } + } + + override fun getResourceAsStream(name: String?): InputStream? { + val url: URL? = getResource(name) + try { + return if (url != null) url.openStream() else null + } + catch (e: IOException) { + } + return null + } +} \ No newline at end of file diff --git a/definitions-bytebuddy/src/test/kotlin/fledware/definitions/bytebuddy/HappyHappyTests.kt b/definitions-bytebuddy/src/test/kotlin/fledware/definitions/bytebuddy/HappyHappyTests.kt index 0b2bdfd..3293944 100644 --- a/definitions-bytebuddy/src/test/kotlin/fledware/definitions/bytebuddy/HappyHappyTests.kt +++ b/definitions-bytebuddy/src/test/kotlin/fledware/definitions/bytebuddy/HappyHappyTests.kt @@ -1,10 +1,17 @@ package fledware.definitions.bytebuddy import net.bytebuddy.ByteBuddy +import net.bytebuddy.agent.ByteBuddyAgent +import net.bytebuddy.dynamic.ClassFileLocator import net.bytebuddy.dynamic.loading.ClassLoadingStrategy +import net.bytebuddy.dynamic.loading.ClassReloadingStrategy +import net.bytebuddy.dynamic.loading.MultipleParentClassLoader import net.bytebuddy.implementation.FixedValue import net.bytebuddy.implementation.MethodDelegation import net.bytebuddy.matcher.ElementMatchers +import net.bytebuddy.pool.TypePool +import java.lang.Exception +import kotlin.test.Ignore import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertIs @@ -27,11 +34,24 @@ open class ClassB : ClassA() { } } +object Stuff { + init { + try { + println("installing bb") + ByteBuddyAgent.install() + } + catch (ex: Exception) { + ex.printStackTrace() + } + } +} + class HappyHappyTests { + val buddy = ByteBuddy() @Test - fun basicThing() { + fun attemptBasicSubclass() { val dynamicType: Class<*> = buddy .subclass(ClassA::class.java) .method(ElementMatchers.named("toString")) @@ -48,12 +68,50 @@ class HappyHappyTests { assertEquals("Hello from me!", stuff.hello()) } -// @Test -// fun otherBasicThing() { -// buddy.redefine(ClassA::class.java) + @Test + @Ignore + fun attemptRedefineMethod() { + ByteBuddyAgent.install() + val typePool = TypePool.Default.ofSystemLoader(); + val classLoader = MultipleParentClassLoader(Thread.currentThread().contextClassLoader, emptyList()) + +// buddy.redefine(typePool.describe("fledware.definitions.bytebuddy.ClassA").resolve(), +// ClassFileLocator.ForClassLoader.ofSystemLoader()) // .method(ElementMatchers.named("hello")) // .intercept(MethodDelegation.to(HelloInterceptor())) // .make() -// assertEquals("Hello from me!", ClassA().hello()) -// } +// .load(ClassLoader.getSystemClassLoader(), ClassLoadingStrategy.Default.INJECTION) + buddy.redefine(ClassA::class.java) + .method(ElementMatchers.named("hello")) + .intercept(MethodDelegation.to(HelloInterceptor())) + .make() + .load(ClassLoader.getSystemClassLoader(), ClassLoadingStrategy.Default.INJECTION) + + var stuff = "" + val thread = Thread { + stuff = ClassA().hello() + } + thread.contextClassLoader = classLoader + thread.start() + thread.join() + assertEquals("Hello from me!", stuff) + } + + @Test + fun attemptInterceptMethod() { + val dynamicType: Class<*> = buddy + .subclass(ClassA::class.java) + .method(ElementMatchers.named("toString")) + .intercept(FixedValue.value("Hello World!")) + .method(ElementMatchers.named("hello")) + .intercept(MethodDelegation.to(HelloInterceptor())) + .make() + .load(javaClass.classLoader, ClassLoadingStrategy.Default.INJECTION) + .loaded + println(dynamicType.kotlin) + + val stuff = assertIs(dynamicType.getConstructor().newInstance()) + assertEquals("Hello World!", stuff.toString()) + assertEquals("Hello from me!", stuff.hello()) + } } \ No newline at end of file diff --git a/definitions-ecs-ashley/build.gradle b/definitions-ecs-ashley/build.gradle index 66badda..e00d554 100644 --- a/definitions-ecs-ashley/build.gradle +++ b/definitions-ecs-ashley/build.gradle @@ -1,5 +1,5 @@ dependencies { - api project(':definitions') + api project(':definitions-builder') api project(':definitions-ecs') api("com.badlogicgames.ashley:ashley:1.7.4"){ exclude group: 'com.badlogicgames.gdx', module: 'gdx' diff --git a/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/AshleyComponentLifecycle.kt b/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/AshleyComponentLifecycle.kt deleted file mode 100644 index db77f0a..0000000 --- a/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/AshleyComponentLifecycle.kt +++ /dev/null @@ -1,47 +0,0 @@ -package fledware.ecs.definitions.ashley - -import com.badlogic.ashley.core.Component -import fledware.definitions.DefinitionsBuilder -import fledware.definitions.DefinitionsManager -import fledware.definitions.DefinitionInstantiationLifecycle -import fledware.definitions.lifecycle.BasicClassDefinition -import fledware.definitions.lifecycle.BasicClassProcessor -import fledware.definitions.lifecycle.ClassDefinitionRegistry -import fledware.ecs.definitions.componentLifecycleName -import fledware.ecs.definitions.componentLifecycleOf -import fledware.ecs.definitions.instantiator.ComponentInstantiator - -/** - * gets the [BasicClassProcessor] for components - */ -@Suppress("UNCHECKED_CAST") -val DefinitionsBuilder.componentDefinitions: BasicClassProcessor - get() = this[componentLifecycleName] as BasicClassProcessor - -/** - * gets the [ClassDefinitionRegistry] for components - */ -@Suppress("UNCHECKED_CAST") -val DefinitionsManager.componentDefinitions: ClassDefinitionRegistry - get() = registry(componentLifecycleName) as ClassDefinitionRegistry - -/** - * Gets or creates the [AshleyComponentInstantiator] for [type]. - */ -fun DefinitionsManager.componentInstantiator(type: String): AshleyComponentInstantiator { - return instantiator(componentLifecycleName, type) as AshleyComponentInstantiator -} - -/** - * creates a component lifecycle with [AshleyComponentInstantiator] - */ -fun ashleyComponentDefinitionLifecycle() = componentLifecycleOf(AshleyComponentInstantiator.instantiated()) - -class AshleyComponentInstantiator(definition: BasicClassDefinition) - : ComponentInstantiator(definition) { - companion object { - fun instantiated() = DefinitionInstantiationLifecycle> { - AshleyComponentInstantiator(it) - } - } -} diff --git a/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/AshleyEntityInstantiator.kt b/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/AshleyEntityInstantiator.kt index b6c2225..bd1f21c 100644 --- a/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/AshleyEntityInstantiator.kt +++ b/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/AshleyEntityInstantiator.kt @@ -3,48 +3,46 @@ package fledware.ecs.definitions.ashley import com.badlogic.ashley.core.Component import com.badlogic.ashley.core.Engine import com.badlogic.ashley.core.Entity -import fledware.definitions.DefinitionsManager -import fledware.definitions.DefinitionInstantiationLifecycle -import fledware.ecs.definitions.EntityDefinition -import fledware.ecs.definitions.entityLifecycle -import fledware.ecs.definitions.entityLifecycleName -import fledware.ecs.definitions.instantiator.EntityInstantiator +import fledware.definitions.instantiator.ReflectInstantiator +import fledware.ecs.definitions.EntityInstantiator +import fledware.ecs.definitions.EntityInstantiatorFactory import fledware.utilities.get import kotlin.reflect.KClass - -/** - * Gets or creates the [AshleyEntityInstantiator] for [type]. - */ -fun DefinitionsManager.entityInstantiator(type: String): AshleyEntityInstantiator { - return instantiator(entityLifecycleName, type) as AshleyEntityInstantiator +class AshleyEntityInstantiatorFactory : EntityInstantiatorFactory() { + override fun entityInstantiator( + instantiatorName: String, + defaultComponentValues: Map>, + componentInstantiators: Map> + ): EntityInstantiator { + return AshleyEntityInstantiator( + manager.contexts.get(), + instantiatorName, + defaultComponentValues, + componentInstantiators + ) + } } -/** - * creates an entity lifecycle with [AshleyEntityInstantiator] - */ -fun ashleyEntityDefinitionLifecycle() = entityLifecycle(AshleyEntityInstantiator.instantiated()) - -class AshleyEntityInstantiator(definition: EntityDefinition, - manager: DefinitionsManager) - : EntityInstantiator(definition, manager) { - companion object { - fun instantiated() = DefinitionInstantiationLifecycle { - AshleyEntityInstantiator(it, this) - } - } +class AshleyEntityInstantiator( + val engine: Engine, + override val instantiatorName: String, + defaultComponentValues: Map>, + componentInstantiators: Map> +) : EntityInstantiator(defaultComponentValues, componentInstantiators) { - val engine = manager.contexts.get() + override val instantiating = Entity::class + @Suppress("UNCHECKED_CAST") override fun actualCreate(input: Map>): Entity { val entity = engine.createEntity() entity.add(engine.createComponent(EntityDefinitionInfo::class.java).also { - it.type = definition.defName + it.type = instantiatorName }) input.forEach { (name, values) -> val instantiator = componentInstantiators[name] ?: throw IllegalStateException("unknown component definition: $name") - val component = engine.createComponent(instantiator.clazz.java) + val component = engine.createComponent(instantiator.instantiating.java as Class) instantiator.mutateWithNames(component, values) entity.add(component) } diff --git a/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/AshleySceneInstantiator.kt b/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/AshleySceneInstantiator.kt index ee3128e..dcc7cf4 100644 --- a/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/AshleySceneInstantiator.kt +++ b/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/AshleySceneInstantiator.kt @@ -1,39 +1,39 @@ package fledware.ecs.definitions.ashley -import com.badlogic.ashley.core.Component import com.badlogic.ashley.core.Engine import com.badlogic.ashley.core.Entity import fledware.definitions.DefinitionsManager -import fledware.definitions.DefinitionInstantiationLifecycle -import fledware.definitions.UnknownDefinitionException -import fledware.ecs.definitions.SceneDefinition -import fledware.ecs.definitions.entityLifecycleName -import fledware.ecs.definitions.instantiator.SceneInstantiator -import fledware.ecs.definitions.sceneLifecycle -import fledware.ecs.definitions.sceneLifecycleName +import fledware.definitions.exceptions.UnknownDefinitionException +import fledware.definitions.findInstantiatorFactoryOf +import fledware.ecs.definitions.EntityInstance +import fledware.ecs.definitions.EntityInstantiator +import fledware.ecs.definitions.SceneInstantiator +import fledware.ecs.definitions.SceneInstantiatorFactory +import fledware.ecs.definitions.ecsEntityDefinitionRegistryName +import fledware.ecs.definitions.ecsSceneDefinitionRegistryName data class AshleyScene(val entities: List) -/** - * Gets or creates the [AshleySceneInstantiator] for [type]. - */ -fun DefinitionsManager.sceneInstantiator(type: String): AshleySceneInstantiator { - return instantiator(sceneLifecycleName, type) as AshleySceneInstantiator -} +val DefinitionsManager.ashleySceneInstantiatorFactory: AshleySceneInstantiatorFactory + get() = this.findInstantiatorFactoryOf(ecsSceneDefinitionRegistryName) -/** - * creates a scene lifecycle with [AshleySceneInstantiator] - */ -fun ashleySceneDefinitionLifecycle() = sceneLifecycle(AshleySceneInstantiator.instantiated()) +class AshleySceneInstantiatorFactory : SceneInstantiatorFactory() { + override fun sceneInstantiator( + instantiatorName: String, + entityInstantiators: Map>, + entities: List + ): AshleySceneInstantiator { + return AshleySceneInstantiator(instantiatorName, entityInstantiators, entities) + } +} class AshleySceneInstantiator( - definition: SceneDefinition, manager: DefinitionsManager) - : SceneInstantiator(definition, manager) { - companion object { - fun instantiated() = DefinitionInstantiationLifecycle { - AshleySceneInstantiator(it, this) - } - } + override val instantiatorName: String, + entityInstantiators: Map>, + entities: List +) : SceneInstantiator(entityInstantiators, entities) { + + override val instantiating = AshleyScene::class override fun setName(entity: Entity, name: String) = Unit override fun factory(entities: List) = AshleyScene(entities) @@ -41,7 +41,7 @@ class AshleySceneInstantiator( fun decorate(engine: Engine) { entities.forEach { instance -> val instantiator = entityInstantiators[instance.type] - ?: throw UnknownDefinitionException(entityLifecycleName, instance.type) + ?: throw UnknownDefinitionException(ecsEntityDefinitionRegistryName, instance.type) val entity = instantiator.createWithNames(instance.components) engine.addEntity(entity) } diff --git a/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/AshleySystemInstantiator.kt b/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/AshleySystemInstantiator.kt deleted file mode 100644 index 1fa8e5e..0000000 --- a/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/AshleySystemInstantiator.kt +++ /dev/null @@ -1,47 +0,0 @@ -package fledware.ecs.definitions.ashley - -import com.badlogic.ashley.core.EntitySystem -import fledware.definitions.DefinitionsBuilder -import fledware.definitions.DefinitionsManager -import fledware.definitions.DefinitionInstantiationLifecycle -import fledware.definitions.lifecycle.BasicClassDefinition -import fledware.definitions.lifecycle.BasicClassProcessor -import fledware.definitions.lifecycle.ClassDefinitionRegistry -import fledware.ecs.definitions.instantiator.SystemInstantiator -import fledware.ecs.definitions.systemLifecycleName -import fledware.ecs.definitions.systemLifecycleOf - -/** - * gets the [BasicClassProcessor] for systems - */ -@Suppress("UNCHECKED_CAST") -val DefinitionsBuilder.systemDefinitions: BasicClassProcessor - get() = this[systemLifecycleName] as BasicClassProcessor - -/** - * gets the [ClassDefinitionRegistry] for systems - */ -@Suppress("UNCHECKED_CAST") -val DefinitionsManager.systemDefinitions: ClassDefinitionRegistry - get() = registry(systemLifecycleName) as ClassDefinitionRegistry - -/** - * Gets or creates the [AshleySystemInstantiator] for [type]. - */ -fun DefinitionsManager.systemInstantiator(type: String): AshleySystemInstantiator { - return instantiator(systemLifecycleName, type) as AshleySystemInstantiator -} - -/** - * creates a system lifecycle with [AshleySystemInstantiator] - */ -fun ashleySystemDefinitionLifecycle() = systemLifecycleOf(AshleySystemInstantiator.instantiated()) - -class AshleySystemInstantiator(definition: BasicClassDefinition) - : SystemInstantiator(definition) { - companion object { - fun instantiated() = DefinitionInstantiationLifecycle> { - AshleySystemInstantiator(it) - } - } -} \ No newline at end of file diff --git a/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/AshleyWorldInstantiator.kt b/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/AshleyWorldInstantiator.kt index 5aa3ac6..cd73d09 100644 --- a/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/AshleyWorldInstantiator.kt +++ b/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/AshleyWorldInstantiator.kt @@ -1,52 +1,68 @@ package fledware.ecs.definitions.ashley -import com.badlogic.ashley.core.Component import com.badlogic.ashley.core.Engine import com.badlogic.ashley.core.Entity import com.badlogic.ashley.core.EntitySystem import fledware.definitions.DefinitionsManager -import fledware.definitions.DefinitionInstantiationLifecycle -import fledware.definitions.UnknownDefinitionException -import fledware.ecs.definitions.WorldDefinition -import fledware.ecs.definitions.entityLifecycleName -import fledware.ecs.definitions.instantiator.WorldInstantiator -import fledware.ecs.definitions.worldLifecycle -import fledware.ecs.definitions.worldLifecycleName - -/** - * Creates a new lifecycle for [WorldDefinition] with [AshleyWorldInstantiator]. - */ -fun ashleyWorldDefinitionLifecycle() = worldLifecycle(AshleyWorldInstantiator.instantiated()) - -/** - * Gets or creates the [AshleyWorldInstantiator] for [type]. - */ -fun DefinitionsManager.worldInstantiator(type: String): AshleyWorldInstantiator { - return instantiator(worldLifecycleName, type) as AshleyWorldInstantiator -} +import fledware.definitions.findInstantiatorFactoryOf +import fledware.definitions.instantiator.ReflectInstantiator +import fledware.ecs.definitions.EntityInstance +import fledware.ecs.definitions.EntityInstantiator +import fledware.ecs.definitions.WorldInstantiator +import fledware.ecs.definitions.WorldInstantiatorFactory +import fledware.ecs.definitions.ecsWorldDefinitionRegistryName -class AshleyWorldInstantiator(definition: WorldDefinition, - manager: DefinitionsManager) - : WorldInstantiator(definition, manager) { - companion object { - fun instantiated() = DefinitionInstantiationLifecycle { - AshleyWorldInstantiator(it, this) - } + +val DefinitionsManager.ashleyWorldInstantiatorFactory: AshleyWorldInstantiatorFactory + get() = this.findInstantiatorFactoryOf(ecsWorldDefinitionRegistryName) + +class AshleyWorldInstantiatorFactory : WorldInstantiatorFactory() { + override fun worldInstantiator( + instantiatorName: String, + systems: List>, + entities: List>>, + componentValues: Map>, + componentInstantiators: Map>, + initFunctions: List, + decoratorFunctions: List + ): AshleyWorldInstantiator { + return AshleyWorldInstantiator( + instantiatorName, + systems, + entities, + componentValues, + componentInstantiators, + initFunctions, + decoratorFunctions + ) } +} + - // engines in ashley don't have global contexts - override fun componentInstantiator(manager: DefinitionsManager, type: String) = TODO() +class AshleyWorldInstantiator( + override val instantiatorName: String, + systems: List>, + entities: List>>, + componentValues: Map>, + componentInstantiators: Map>, + initFunctions: List, + decoratorFunctions: List +) : WorldInstantiator( + systems, entities, componentValues, componentInstantiators, initFunctions, decoratorFunctions +) { fun decorateEngine(engine: Engine) { systems.forEach { - engine.addSystem(it.value.create()) + engine.addSystem(it.create()) } - entities.forEach { instance -> - val instantiator = entityInstantiators[instance.type] - ?: throw UnknownDefinitionException(entityLifecycleName, instance.type) + entities.forEach { (instance, instantiator) -> val entity = instantiator.createWithNames(instance.components) engine.addEntity(entity) } - decoratorFunctions.forEach { it.callWith(engine) } + + if (decoratorFunctions.isNotEmpty()) + TODO() + if (initFunctions.isNotEmpty()) + TODO() } } \ No newline at end of file diff --git a/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/DefinitionsApi.kt b/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/DefinitionsApi.kt index 25d8f4f..eebdb98 100644 --- a/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/DefinitionsApi.kt +++ b/definitions-ecs-ashley/src/main/kotlin/fledware/ecs/definitions/ashley/DefinitionsApi.kt @@ -1,11 +1,36 @@ package fledware.ecs.definitions.ashley +import com.badlogic.ashley.core.Component import com.badlogic.ashley.core.Engine +import com.badlogic.ashley.core.Entity +import com.badlogic.ashley.core.EntitySystem import fledware.definitions.DefinitionsManager -import fledware.ecs.definitions.instantiator.ComponentArgument +import fledware.definitions.builder.DefinitionsBuilderFactory +import fledware.ecs.definitions.ComponentArgument +import fledware.ecs.definitions.entityInstantiatorFactory +import fledware.ecs.definitions.withEcsComponents +import fledware.ecs.definitions.withEcsEntities +import fledware.ecs.definitions.withEcsScenes +import fledware.ecs.definitions.withEcsSystems +import fledware.ecs.definitions.withEcsWorlds +import fledware.ecs.definitions.worldInstantiatorFactory import fledware.utilities.get +// ================================================================== +// +// builders +// +// ================================================================== + +fun DefinitionsBuilderFactory.withAshleyEcs() = this + .withEcsComponents() + .withEcsEntities(AshleyEntityInstantiatorFactory()) + .withEcsSystems() + .withEcsScenes(AshleySceneInstantiatorFactory()) + .withEcsWorlds(AshleyWorldInstantiatorFactory()) + + // ================================================================== // // entity creation on EngineData @@ -20,7 +45,7 @@ import fledware.utilities.get * @param type the definition type for create */ fun DefinitionsManager.createDefinedEntity(type: String) = - entityInstantiator(type).create() + entityInstantiatorFactory().getOrCreate(type).create() /** * Creates an entity with the given type definition and inputs @@ -31,7 +56,7 @@ fun DefinitionsManager.createDefinedEntity(type: String) = * @param inputs the inputs for the components of the entity */ fun DefinitionsManager.createDefinedEntity(type: String, inputs: Map>) = - entityInstantiator(type).createWithNames(inputs) + entityInstantiatorFactory().getOrCreate(type).createWithNames(inputs) /** * Creates an entity with the given type definition and inputs @@ -42,7 +67,7 @@ fun DefinitionsManager.createDefinedEntity(type: String, inputs: Map) = - entityInstantiator(type).createWithArgs(inputs) + entityInstantiatorFactory().getOrCreate(type).createWithArgs(inputs) /** * Creates and adds an entity with the given type definition @@ -50,7 +75,7 @@ fun DefinitionsManager.createDefinedEntity(type: String, inputs: List().getOrCreate(type).create() .also { contexts.get().addEntity(it) } /** @@ -60,7 +85,7 @@ fun DefinitionsManager.addDefinedEntity(type: String) = * @param inputs the inputs for the components of the entity */ fun DefinitionsManager.addDefinedEntity(type: String, inputs: Map>) = - entityInstantiator(type).createWithNames(inputs) + entityInstantiatorFactory().getOrCreate(type).createWithNames(inputs) .also { contexts.get().addEntity(it) } /** @@ -70,7 +95,7 @@ fun DefinitionsManager.addDefinedEntity(type: String, inputs: Map) = - entityInstantiator(type).createWithArgs(inputs) + entityInstantiatorFactory().getOrCreate(type).createWithArgs(inputs) .also { contexts.get().addEntity(it) } @@ -86,7 +111,7 @@ fun DefinitionsManager.addDefinedEntity(type: String, inputs: List() engine.removeAllEntities() scene.decorate(engine) @@ -99,7 +124,7 @@ fun DefinitionsManager.decorateWithScene(name: String) { * @param name the name of the world definition to populate the engine with */ fun DefinitionsManager.decorateWithWorld(name: String) { - val world = this.worldInstantiator(name) + val world = this.ashleyWorldInstantiatorFactory.getOrCreate(name) val engine = contexts.get() engine.removeAllEntities() engine.removeAllSystems() diff --git a/definitions-ecs-ashley/src/test/kotlin/fledware/ecs/definitions/ashley/driver_ashley.kt b/definitions-ecs-ashley/src/test/kotlin/fledware/ecs/definitions/ashley/driver_ashley.kt index 9fbe090..88d29e6 100644 --- a/definitions-ecs-ashley/src/test/kotlin/fledware/ecs/definitions/ashley/driver_ashley.kt +++ b/definitions-ecs-ashley/src/test/kotlin/fledware/ecs/definitions/ashley/driver_ashley.kt @@ -6,25 +6,22 @@ import com.badlogic.ashley.core.Component import com.badlogic.ashley.core.Engine import com.badlogic.ashley.core.Entity import fledware.definitions.DefinitionsManager -import fledware.definitions.reader.gatherJar -import fledware.definitions.registry.DefaultDefinitionsBuilder -import fledware.definitions.tests.testJarPath -import fledware.ecs.definitions.instantiator.EntityInstantiator -import fledware.ecs.definitions.instantiator.SceneInstantiator +import fledware.definitions.builder.std.defaultBuilder +import fledware.definitions.tests.testJarFile +import fledware.ecs.definitions.EntityInstantiator +import fledware.ecs.definitions.SceneInstantiator +import fledware.ecs.definitions.entityInstantiatorFactory +import fledware.ecs.definitions.sceneInstantiatorFactory import fledware.ecs.definitions.test.ManagerDriver import kotlin.reflect.KClass -fun createAshleyManager() = DefaultDefinitionsBuilder(listOf( - ashleyComponentDefinitionLifecycle(), - ashleyEntityDefinitionLifecycle(), - ashleySceneDefinitionLifecycle(), - ashleySystemDefinitionLifecycle(), - ashleyWorldDefinitionLifecycle() -)).also { - it.gatherJar("ecs-loading".testJarPath) - it.gatherJar("ecs-loading-ashley".testJarPath) -}.build() +fun createAshleyManager() = defaultBuilder() + .withAshleyEcs() + .create() + .withModPackage("ecs-loading".testJarFile.path) + .withModPackage("ecs-loading-ashley".testJarFile.path) + .build() fun createAshleyEngine() = createAshleyManager().also { manager -> Engine().withDefinitionsManager(manager) @@ -41,8 +38,8 @@ class AshleyManagerDriver(override val manager: DefinitionsManager) : ManagerDri override val systems: List get() = engine.systems.toList() - override fun entityInstantiator(type: String): EntityInstantiator { - return manager.entityInstantiator(type) as EntityInstantiator + override fun entityInstantiator(type: String): EntityInstantiator { + return manager.entityInstantiatorFactory.getOrCreate(type) } override fun entityComponent(entity: Any, type: KClass): Any { @@ -57,8 +54,8 @@ class AshleyManagerDriver(override val manager: DefinitionsManager) : ManagerDri return (entity as Entity).definitionType } - override fun sceneInstantiator(type: String): SceneInstantiator { - return manager.sceneInstantiator(type) as SceneInstantiator + override fun sceneInstantiator(type: String): SceneInstantiator { + return manager.sceneInstantiatorFactory.getOrCreate(type) } override fun decorateWithScene(type: String) { diff --git a/definitions-ecs-fled/build.gradle b/definitions-ecs-fled/build.gradle index 6bd38fa..1f304b0 100644 --- a/definitions-ecs-fled/build.gradle +++ b/definitions-ecs-fled/build.gradle @@ -1,5 +1,5 @@ dependencies { - api project(':definitions') + api project(':definitions-builder') api project(':definitions-ecs') api "io.fledware:fledecs:$fledEcsVersion" api "org.eclipse.collections:eclipse-collections-api:$eclipseCollectionsVersion" diff --git a/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/DefinitionsApi.kt b/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/DefinitionsApi.kt index 73864b0..3a72859 100644 --- a/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/DefinitionsApi.kt +++ b/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/DefinitionsApi.kt @@ -1,21 +1,48 @@ package fledware.ecs.definitions.fled import fledware.definitions.DefinitionsManager +import fledware.definitions.builder.DefinitionsBuilderFactory +import fledware.definitions.typeIndex import fledware.ecs.AbstractSystem import fledware.ecs.Engine import fledware.ecs.EngineData import fledware.ecs.Entity import fledware.ecs.EntityFactory +import fledware.ecs.System import fledware.ecs.World import fledware.ecs.WorldData import fledware.ecs.createWorldAndFlush -import fledware.ecs.definitions.instantiator.ComponentArgument +import fledware.ecs.definitions.ComponentArgument +import fledware.ecs.definitions.componentDefinitions +import fledware.ecs.definitions.entityInstantiatorFactory +import fledware.ecs.definitions.sceneInstantiatorFactory +import fledware.ecs.definitions.withEcsComponents +import fledware.ecs.definitions.withEcsEntities +import fledware.ecs.definitions.withEcsScenes +import fledware.ecs.definitions.withEcsSystems +import fledware.ecs.definitions.withEcsWorlds +import fledware.ecs.ex.Scene import fledware.ecs.ex.importScene import fledware.ecs.util.MapperIndex import fledware.utilities.get import fledware.utilities.getOrNull +// ================================================================== +// +// builders +// +// ================================================================== + +fun DefinitionsBuilderFactory.withFledEcs() = this + .withEcsEngineEvents() + .withEcsComponents() + .withEcsEntities(FledEntityInstantiatorFactory()) + .withEcsSystems() + .withEcsScenes(FledSceneInstantiatorFactory()) + .withEcsWorlds(FledWorldInstantiatorFactory()) + + // ================================================================== // // access to the DefinitionsManager component @@ -50,7 +77,7 @@ val WorldData.definitions: DefinitionsManager * Example of this is in the ecs-loading test project. */ inline fun EngineData.definedComponentIndexOf(): MapperIndex { - val componentType = definitions.componentDefinitions.typeIndex.getOrNull() + val componentType = definitions.componentDefinitions.typeIndex().getOrNull() ?: throw IllegalArgumentException("no type found that extends: ${T::class}") return componentMapper.indexOf(componentType) } @@ -77,21 +104,21 @@ inline fun WorldData.definedComponentIndexOf(): MapperIndex // ================================================================== fun EngineData.createDefinedEntity(name: String?, type: String): Entity { - val entity = definitions.entityInstantiator(type).create() + val entity = definitions.entityInstantiatorFactory().getOrCreate(type).create() if (name != null) entity.name = name return entity } fun EngineData.createDefinedEntity(name: String?, type: String, inputs: Map>): Entity { - val entity = definitions.entityInstantiator(type).createWithNames(inputs) + val entity = definitions.entityInstantiatorFactory().getOrCreate(type).createWithNames(inputs) if (name != null) entity.name = name return entity } fun EngineData.createDefinedEntity(name: String?, type: String, inputs: List): Entity { - val entity = definitions.entityInstantiator(type).createWithArgs(inputs) + val entity = definitions.entityInstantiatorFactory().getOrCreate(type).createWithArgs(inputs) if (name != null) entity.name = name return entity @@ -157,7 +184,7 @@ data class DefinedWorldOptions(val type: String, val options: Any?) */ fun Engine.requestCreateDefinedWorld(name: String, type: String = name) { - val instantiator = data.definitions.worldInstantiator(type) + val instantiator = data.definitions.fledWorldInstantiatorFactory.getOrCreate(type) requestCreateWorld(name, DefinedWorldOptions(type, null), instantiator::decorateWorld) } @@ -169,7 +196,7 @@ fun Engine.requestCreateDefinedWorld(name: String, */ fun Engine.requestCreateDefinedWorld(nameAndType: String, componentInput: Map>) { - val instantiator = data.definitions.worldInstantiator(nameAndType) + val instantiator = data.definitions.fledWorldInstantiatorFactory.getOrCreate(nameAndType) requestCreateWorld(nameAndType, DefinedWorldOptions(nameAndType, null)) { instantiator.decorateWorldWithNames(this, componentInput) } @@ -184,7 +211,7 @@ fun Engine.requestCreateDefinedWorld(nameAndType: String, */ fun Engine.requestCreateDefinedWorld(name: String, type: String, componentInput: Map>) { - val instantiator = data.definitions.worldInstantiator(type) + val instantiator = data.definitions.fledWorldInstantiatorFactory.getOrCreate(type) requestCreateWorld(name, DefinedWorldOptions(type, null)) { instantiator.decorateWorldWithNames(this, componentInput) } @@ -200,7 +227,7 @@ fun Engine.requestCreateDefinedWorld(name: String, type: String, */ fun Engine.requestCreateDefinedWorld(name: String, type: String, componentInput: List) { - val instantiator = data.definitions.worldInstantiator(type) + val instantiator = data.definitions.fledWorldInstantiatorFactory.getOrCreate(type) requestCreateWorld(name, DefinedWorldOptions(type, null)) { instantiator.decorateWorldWithArgs(this, componentInput) } @@ -215,7 +242,7 @@ fun Engine.requestCreateDefinedWorld(name: String, type: String, */ fun Engine.requestCreateDefinedWorld(nameAndType: String, componentInput: List) { - val instantiator = data.definitions.worldInstantiator(nameAndType) + val instantiator = data.definitions.fledWorldInstantiatorFactory.getOrCreate(nameAndType) requestCreateWorld(nameAndType, DefinedWorldOptions(nameAndType, null)) { instantiator.decorateWorldWithArgs(this, componentInput) } @@ -230,7 +257,7 @@ fun Engine.requestCreateDefinedWorld(nameAndType: String, */ fun Engine.createDefinedWorldAndFlush(name: String, type: String = name): World { - val instantiator = data.definitions.worldInstantiator(type) + val instantiator = data.definitions.fledWorldInstantiatorFactory.getOrCreate(type) return createWorldAndFlush(name, DefinedWorldOptions(type, null), instantiator::decorateWorld) } @@ -242,7 +269,7 @@ fun Engine.createDefinedWorldAndFlush(name: String, */ fun Engine.createDefinedWorldAndFlush(nameAndType: String, componentInput: Map>): World { - val instantiator = data.definitions.worldInstantiator(nameAndType) + val instantiator = data.definitions.fledWorldInstantiatorFactory.getOrCreate(nameAndType) return createWorldAndFlush(nameAndType, DefinedWorldOptions(nameAndType, null)) { instantiator.decorateWorldWithNames(this, componentInput) } @@ -257,7 +284,7 @@ fun Engine.createDefinedWorldAndFlush(nameAndType: String, */ fun Engine.createDefinedWorldAndFlush(name: String, type: String, componentInput: Map>): World { - val instantiator = data.definitions.worldInstantiator(type) + val instantiator = data.definitions.fledWorldInstantiatorFactory.getOrCreate(type) return createWorldAndFlush(name, DefinedWorldOptions(type, null)) { instantiator.decorateWorldWithNames(this, componentInput) } @@ -273,7 +300,7 @@ fun Engine.createDefinedWorldAndFlush(name: String, type: String, */ fun Engine.createDefinedWorldAndFlush(name: String, type: String, componentInput: List): World { - val instantiator = data.definitions.worldInstantiator(type) + val instantiator = data.definitions.fledWorldInstantiatorFactory.getOrCreate(type) return createWorldAndFlush(name, DefinedWorldOptions(type, null)) { instantiator.decorateWorldWithArgs(this, componentInput) } @@ -288,7 +315,7 @@ fun Engine.createDefinedWorldAndFlush(name: String, type: String, */ fun Engine.createDefinedWorldAndFlush(nameAndType: String, componentInput: List): World { - val instantiator = data.definitions.worldInstantiator(nameAndType) + val instantiator = data.definitions.fledWorldInstantiatorFactory.getOrCreate(nameAndType) return createWorldAndFlush(nameAndType, DefinedWorldOptions(nameAndType, null)) { instantiator.decorateWorldWithArgs(this, componentInput) } @@ -305,6 +332,6 @@ fun Engine.createDefinedWorldAndFlush(nameAndType: String, * Creates a defined scene and immediately imports it. */ fun WorldData.importSceneFromDefinitions(name: String) { - val instantiator = engine.data.definitions.sceneInstantiator(name) + val instantiator = engine.data.definitions.fledSceneInstantiatorFactory.getOrCreate(name) importScene(instantiator.create()) } diff --git a/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/EngineApi.kt b/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/EngineApi.kt index f0ee329..9ee9b4f 100644 --- a/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/EngineApi.kt +++ b/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/EngineApi.kt @@ -16,16 +16,20 @@ data class DefinitionsManagerWrapper(val manager: DefinitionsManager) manager.contexts.put(engine) manager.contexts.put(engine.data) - val engineEvents = manager.engineEventDefinitionsOrNull + val engineEvents = manager.ecsEngineEventDefinitionsOrNull @Suppress("IfThenToSafeAccess") if (engineEvents != null) { engineEvents.definitions.values.forEach { function -> val annotation = function.annotation as EngineEvent when (annotation.type) { - EngineEventType.OnEngineStarted -> engine.events.onEngineStart += { function.callWith(it) } - EngineEventType.OnEngineShutdown -> engine.events.onEngineShutdown += { function.callWith(it) } - EngineEventType.OnWorldCreated -> engine.events.onWorldCreated += { function.callWith(it) } - EngineEventType.OnWorldDestroyed -> engine.events.onWorldDestroyed += { function.callWith(it) } + EngineEventType.OnEngineStarted -> + engine.events.onEngineStart += { function.functionWrapper.callWithContexts(it) } + EngineEventType.OnEngineShutdown -> + engine.events.onEngineShutdown += { function.functionWrapper.callWithContexts(it) } + EngineEventType.OnWorldCreated -> + engine.events.onWorldCreated += { function.functionWrapper.callWithContexts(it) } + EngineEventType.OnWorldDestroyed -> + engine.events.onWorldDestroyed += { function.functionWrapper.callWithContexts(it) } } } } diff --git a/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/EngineEventLifecycle.kt b/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/EngineEventLifecycle.kt index 983a148..23ff96d 100644 --- a/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/EngineEventLifecycle.kt +++ b/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/EngineEventLifecycle.kt @@ -1,11 +1,14 @@ package fledware.ecs.definitions.fled import fledware.definitions.DefinitionRegistry -import fledware.definitions.DefinitionsBuilder import fledware.definitions.DefinitionsManager -import fledware.definitions.RawDefinitionProcessor -import fledware.definitions.lifecycle.BasicFunctionDefinition -import fledware.definitions.lifecycle.rootFunctionLifecycle +import fledware.definitions.builder.BuilderState +import fledware.definitions.builder.DefinitionRegistryBuilder +import fledware.definitions.builder.DefinitionsBuilderFactory +import fledware.definitions.builder.findRegistryOf +import fledware.definitions.builder.registries.AnnotatedFunctionDefinition +import fledware.definitions.builder.std.withAnnotatedRootFunction +import fledware.definitions.findRegistryOf @Target(AnnotationTarget.FUNCTION) @@ -20,16 +23,17 @@ enum class EngineEventType { const val engineEventLifecycleName = "engine-events" -fun engineEventLifecycle() = rootFunctionLifecycle(engineEventLifecycleName) +fun DefinitionsBuilderFactory.withEcsEngineEvents() = + withAnnotatedRootFunction(engineEventLifecycleName) { it.path } @Suppress("UNCHECKED_CAST") -val DefinitionsManager.engineEventDefinitions: DefinitionRegistry - get() = registry(engineEventLifecycleName) as DefinitionRegistry +val DefinitionsManager.ecsEngineEventDefinitions: DefinitionRegistry + get() = findRegistryOf(engineEventLifecycleName) @Suppress("UNCHECKED_CAST") -val DefinitionsManager.engineEventDefinitionsOrNull: DefinitionRegistry? - get() = registries[engineEventLifecycleName] as? DefinitionRegistry +val DefinitionsManager.ecsEngineEventDefinitionsOrNull: DefinitionRegistry? + get() = registries[engineEventLifecycleName] as? DefinitionRegistry @Suppress("UNCHECKED_CAST") -val DefinitionsBuilder.engineEventDefinitions: RawDefinitionProcessor - get() = this[engineEventLifecycleName] as RawDefinitionProcessor +val BuilderState.engineEventDefinitions: DefinitionRegistryBuilder + get() = findRegistryOf(engineEventLifecycleName) diff --git a/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/FledComponentLifecycle.kt b/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/FledComponentLifecycle.kt deleted file mode 100644 index 3c3b529..0000000 --- a/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/FledComponentLifecycle.kt +++ /dev/null @@ -1,47 +0,0 @@ -package fledware.ecs.definitions.fled - -import fledware.definitions.DefinitionsBuilder -import fledware.definitions.DefinitionsManager -import fledware.definitions.DefinitionInstantiationLifecycle -import fledware.definitions.lifecycle.BasicClassDefinition -import fledware.definitions.lifecycle.BasicClassProcessor -import fledware.definitions.lifecycle.ClassDefinitionRegistry -import fledware.ecs.definitions.componentLifecycleName -import fledware.ecs.definitions.componentLifecycleOf -import fledware.ecs.definitions.instantiator.ComponentInstantiator - - -/** - * gets the [BasicClassProcessor] for components - */ -@Suppress("UNCHECKED_CAST") -val DefinitionsBuilder.componentDefinitions: BasicClassProcessor - get() = this[componentLifecycleName] as BasicClassProcessor - -/** - * gets the [ClassDefinitionRegistry] for components - */ -@Suppress("UNCHECKED_CAST") -val DefinitionsManager.componentDefinitions: ClassDefinitionRegistry - get() = registry(componentLifecycleName) as ClassDefinitionRegistry - -/** - * Gets or creates the [FledComponentInstantiator] for [type]. - */ -fun DefinitionsManager.componentInstantiator(type: String): FledComponentInstantiator { - return instantiator(componentLifecycleName, type) as FledComponentInstantiator -} - -/** - * creates a component lifecycle with [FledComponentInstantiator] - */ -fun fledComponentDefinitionLifecycle() = componentLifecycleOf(FledComponentInstantiator.instantiated()) - -class FledComponentInstantiator(definition: BasicClassDefinition) - : ComponentInstantiator(definition) { - companion object { - fun instantiated() = DefinitionInstantiationLifecycle> { - FledComponentInstantiator(it) - } - } -} \ No newline at end of file diff --git a/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/FledEntityLifecycle.kt b/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/FledEntityLifecycle.kt index 58182ce..eb37cbd 100644 --- a/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/FledEntityLifecycle.kt +++ b/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/FledEntityLifecycle.kt @@ -1,43 +1,40 @@ package fledware.ecs.definitions.fled -import fledware.definitions.DefinitionsManager -import fledware.definitions.DefinitionInstantiationLifecycle +import fledware.definitions.instantiator.ReflectInstantiator import fledware.ecs.EngineData import fledware.ecs.Entity -import fledware.ecs.definitions.EntityDefinition -import fledware.ecs.definitions.entityLifecycle -import fledware.ecs.definitions.entityLifecycleName -import fledware.ecs.definitions.instantiator.EntityInstantiator +import fledware.ecs.definitions.EntityInstantiator +import fledware.ecs.definitions.EntityInstantiatorFactory import fledware.utilities.get import kotlin.reflect.KClass - -/** - * Gets or creates the [FledEntityInstantiator] for [type]. - */ -fun DefinitionsManager.entityInstantiator(type: String): FledEntityInstantiator { - return instantiator(entityLifecycleName, type) as FledEntityInstantiator +class FledEntityInstantiatorFactory : EntityInstantiatorFactory() { + override fun entityInstantiator( + instantiatorName: String, + defaultComponentValues: Map>, + componentInstantiators: Map> + ): EntityInstantiator { + return FledEntityInstantiator( + instantiatorName, + manager.contexts.get(), + defaultComponentValues, + componentInstantiators + ) + } } -/** - * creates an entity lifecycle with [FledEntityInstantiator] - */ -fun fledEntityDefinitionLifecycle() = entityLifecycle(FledEntityInstantiator.instantiated()) - -class FledEntityInstantiator(definition: EntityDefinition, - manager: DefinitionsManager) - : EntityInstantiator(definition, manager) { - companion object { - fun instantiated() = DefinitionInstantiationLifecycle { - FledEntityInstantiator(it, this) - } - } +class FledEntityInstantiator( + override val instantiatorName: String, + private val engineData: EngineData, + defaultComponentValues: Map>, + componentInstantiators: Map> +) : EntityInstantiator(defaultComponentValues, componentInstantiators) { - private val engineData = manager.contexts.get() + override val instantiating = Entity::class override fun actualCreate(input: Map>): Entity { return engineData.createEntity { - add(EntityDefinitionInfo(definition.defName)) + add(EntityDefinitionInfo(instantiatorName)) input.forEach { (name, values) -> val component = componentInstantiators[name] ?: throw IllegalStateException("unknown component definition: $name") @@ -46,5 +43,6 @@ class FledEntityInstantiator(definition: EntityDefinition, } } + override fun getComponent(entity: Entity, component: KClass<*>) = entity[component] } \ No newline at end of file diff --git a/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/FledSceneLifecycle.kt b/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/FledSceneLifecycle.kt index 8069c81..aba6daf 100644 --- a/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/FledSceneLifecycle.kt +++ b/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/FledSceneLifecycle.kt @@ -1,37 +1,38 @@ package fledware.ecs.definitions.fled import fledware.definitions.DefinitionsManager -import fledware.definitions.DefinitionInstantiationLifecycle +import fledware.definitions.findInstantiatorFactoryOf import fledware.ecs.Entity -import fledware.ecs.definitions.SceneDefinition -import fledware.ecs.definitions.instantiator.SceneInstantiator -import fledware.ecs.definitions.sceneLifecycle -import fledware.ecs.definitions.sceneLifecycleName +import fledware.ecs.definitions.EntityInstance +import fledware.ecs.definitions.EntityInstantiator +import fledware.ecs.definitions.SceneInstantiator +import fledware.ecs.definitions.SceneInstantiatorFactory +import fledware.ecs.definitions.ecsSceneDefinitionRegistryName import fledware.ecs.ex.Scene import fledware.ecs.util.exec -/** - * Gets or creates the [FledSceneInstantiator] for [type]. - */ -fun DefinitionsManager.sceneInstantiator(type: String): FledSceneInstantiator { - return instantiator(sceneLifecycleName, type) as FledSceneInstantiator +val DefinitionsManager.fledSceneInstantiatorFactory: FledSceneInstantiatorFactory + get() = this.findInstantiatorFactoryOf(ecsSceneDefinitionRegistryName) + +class FledSceneInstantiatorFactory : SceneInstantiatorFactory() { + override fun sceneInstantiator( + instantiatorName: String, + entityInstantiators: Map>, + entities: List + ): FledSceneInstantiator { + return FledSceneInstantiator(instantiatorName, entityInstantiators, entities) + } } -/** - * creates a scene lifecycle with [FledSceneInstantiator] - */ -fun fledSceneDefinitionLifecycle() = sceneLifecycle(FledSceneInstantiator.instantiated()) +class FledSceneInstantiator( + override val instantiatorName: String, + entityInstantiators: Map>, + entities: List +) : SceneInstantiator(entityInstantiators, entities) { -class FledSceneInstantiator(definition: SceneDefinition, - manager: DefinitionsManager) - : SceneInstantiator(definition, manager) { - companion object { - fun instantiated() = DefinitionInstantiationLifecycle { - FledSceneInstantiator(it, this) - } - } + override val instantiating = Scene::class override fun setName(entity: Entity, name: String) = exec { entity.name = name } - override fun factory(entities: List): Scene = Scene(definition.defName, entities) + override fun factory(entities: List): Scene = Scene(instantiatorName, entities) } \ No newline at end of file diff --git a/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/FledSystemLifecycle.kt b/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/FledSystemLifecycle.kt deleted file mode 100644 index 8695037..0000000 --- a/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/FledSystemLifecycle.kt +++ /dev/null @@ -1,48 +0,0 @@ -package fledware.ecs.definitions.fled - -import fledware.definitions.DefinitionsBuilder -import fledware.definitions.DefinitionsManager -import fledware.definitions.DefinitionInstantiationLifecycle -import fledware.definitions.lifecycle.BasicClassDefinition -import fledware.definitions.lifecycle.BasicClassProcessor -import fledware.definitions.lifecycle.ClassDefinitionRegistry -import fledware.ecs.System -import fledware.ecs.definitions.instantiator.SystemInstantiator -import fledware.ecs.definitions.systemLifecycleName -import fledware.ecs.definitions.systemLifecycleOf - - -/** - * gets the [BasicClassProcessor] for systems - */ -@Suppress("UNCHECKED_CAST") -val DefinitionsBuilder.systemDefinitions: BasicClassProcessor - get() = this[systemLifecycleName] as BasicClassProcessor - -/** - * gets the [ClassDefinitionRegistry] for systems - */ -@Suppress("UNCHECKED_CAST") -val DefinitionsManager.systemDefinitions: ClassDefinitionRegistry - get() = registry(systemLifecycleName) as ClassDefinitionRegistry - -/** - * Gets or creates the [FledSystemInstantiator] for [type]. - */ -fun DefinitionsManager.systemInstantiator(type: String): FledSystemInstantiator { - return instantiator(systemLifecycleName, type) as FledSystemInstantiator -} - -/** - * creates a system lifecycle with [FledSystemInstantiator] - */ -fun fledSystemDefinitionLifecycle() = systemLifecycleOf(FledSystemInstantiator.instantiated()) - -class FledSystemInstantiator(definition: BasicClassDefinition) - : SystemInstantiator(definition) { - companion object { - fun instantiated() = DefinitionInstantiationLifecycle> { - FledSystemInstantiator(it) - } - } -} diff --git a/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/FledWorldLifecycle.kt b/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/FledWorldLifecycle.kt index 81f2d99..9967dfd 100644 --- a/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/FledWorldLifecycle.kt +++ b/definitions-ecs-fled/src/main/kotlin/fledware/ecs/definitions/fled/FledWorldLifecycle.kt @@ -1,46 +1,62 @@ package fledware.ecs.definitions.fled import fledware.definitions.DefinitionsManager -import fledware.definitions.DefinitionInstantiationLifecycle -import fledware.definitions.UnknownDefinitionException +import fledware.definitions.findInstantiatorFactoryOf +import fledware.definitions.instantiator.ReflectInstantiator import fledware.ecs.Entity import fledware.ecs.System import fledware.ecs.WorldBuilder -import fledware.ecs.definitions.WorldDefinition -import fledware.ecs.definitions.entityLifecycleName -import fledware.ecs.definitions.instantiator.ComponentArgument -import fledware.ecs.definitions.instantiator.WorldInstantiator -import fledware.ecs.definitions.worldLifecycle -import fledware.ecs.definitions.worldLifecycleName -import fledware.ecs.ex.initWith +import fledware.ecs.definitions.ComponentArgument +import fledware.ecs.definitions.EntityInstance +import fledware.ecs.definitions.EntityInstantiator +import fledware.ecs.definitions.WorldInstantiator +import fledware.ecs.definitions.WorldInstantiatorFactory +import fledware.ecs.definitions.ecsWorldDefinitionRegistryName -/** - * Gets or creates the [FledWorldInstantiator] for [type]. - */ -fun DefinitionsManager.worldInstantiator(type: String): FledWorldInstantiator { - return instantiator(worldLifecycleName, type) as FledWorldInstantiator -} +val DefinitionsManager.fledWorldInstantiatorFactory: FledWorldInstantiatorFactory + get() = this.findInstantiatorFactoryOf(ecsWorldDefinitionRegistryName) -/** - * Creates a new lifecycle for [WorldDefinition] with [FledWorldInstantiator]. - */ -fun fledWorldDefinitionLifecycle() = worldLifecycle(FledWorldInstantiator.instantiated()) +class FledWorldInstantiatorFactory : WorldInstantiatorFactory() { + override fun worldInstantiator( + instantiatorName: String, + systems: List>, + entities: List>>, + componentValues: Map>, + componentInstantiators: Map>, + initFunctions: List, + decoratorFunctions: List + ): FledWorldInstantiator { + return FledWorldInstantiator( + instantiatorName, + systems, + entities, + componentValues, + componentInstantiators, + initFunctions, + decoratorFunctions + ) + } +} @Suppress("MemberVisibilityCanBePrivate") -class FledWorldInstantiator(definition: WorldDefinition, - manager: DefinitionsManager) - : WorldInstantiator(definition, manager) { - companion object { - fun instantiated() = DefinitionInstantiationLifecycle { - FledWorldInstantiator(it, this) - } - } +class FledWorldInstantiator( + override val instantiatorName: String, + systems: List>, + entities: List>>, + componentValues: Map>, + componentInstantiators: Map>, + initFunctions: List, + decoratorFunctions: List +) : WorldInstantiator( + systems, entities, componentValues, componentInstantiators, initFunctions, decoratorFunctions +) { + fun decorateWorldWithNames(builder: WorldBuilder, contextInput: Map>) { val inputs = mutableMapOf>() - defaultContextValues.forEach { inputs[it.key] = it.value.toMutableMap() } + componentValues.forEach { inputs[it.key] = it.value.toMutableMap() } contextInput.forEach { (name, values) -> inputs.computeIfAbsent(name) { mutableMapOf() }.putAll(values) } @@ -50,7 +66,7 @@ class FledWorldInstantiator(definition: WorldDefinition, fun decorateWorldWithArgs(builder: WorldBuilder, contextInput: List) { val inputs = mutableMapOf>() - defaultContextValues.forEach { inputs[it.key] = it.value.toMutableMap() } + componentValues.forEach { inputs[it.key] = it.value.toMutableMap() } contextInput.forEach { val component = inputs.computeIfAbsent(it.componentType) { mutableMapOf() } component[it.componentField] = it.value @@ -59,27 +75,26 @@ class FledWorldInstantiator(definition: WorldDefinition, } fun decorateWorld(builder: WorldBuilder) { - actualDecorateWorld(builder, defaultContextValues) + actualDecorateWorld(builder, componentValues) } private fun actualDecorateWorld(builder: WorldBuilder, contexts: Map>) { - systems.forEach { builder.addSystem(it.value.create()) } + systems.forEach { builder.addSystem(it.create() as System) } contexts.forEach { (type, values) -> val instantiator = componentInstantiators[type] ?: throw IllegalStateException("unknown component definition: $type") builder.contexts.put(instantiator.createWithNames(values)) } - entities.forEach { instance -> - val instantiator = entityInstantiators[instance.type] - ?: throw UnknownDefinitionException(entityLifecycleName, instance.type) + entities.forEach { (instance, instantiator) -> val entity = instantiator.createWithNames(instance.components) instance.name?.also { entity.name = it } builder.importEntity(entity) } - decoratorFunctions.forEach { it.callWith(builder) } - initFunction?.also { - builder.initWith { it.callWith(world, data) } - } + + if (decoratorFunctions.isNotEmpty()) + TODO() + if (initFunctions.isNotEmpty()) + TODO() } } \ No newline at end of file diff --git a/definitions-ecs-fled/src/test/kotlin/fledware/ecs/definitions/fled/FledEntityTest.kt b/definitions-ecs-fled/src/test/kotlin/fledware/ecs/definitions/fled/FledEntityTest.kt index b8fb02a..c81fefc 100644 --- a/definitions-ecs-fled/src/test/kotlin/fledware/ecs/definitions/fled/FledEntityTest.kt +++ b/definitions-ecs-fled/src/test/kotlin/fledware/ecs/definitions/fled/FledEntityTest.kt @@ -1,8 +1,8 @@ package fledware.ecs.definitions.fled +import fledware.definitions.exceptions.ReflectionCallException import fledware.definitions.util.ReflectCallerState -import fledware.definitions.util.ReflectionCallException -import fledware.ecs.definitions.instantiator.ComponentArgument +import fledware.ecs.definitions.ComponentArgument import fledware.ecs.definitions.test.EntityTest import fledware.ecs.definitions.test.ManagerDriver import kotlin.test.Test @@ -15,11 +15,11 @@ class FledEntityTest : EntityTest() { @Test fun throwsOnMissingEntityName() { val driver = createDriver() - val entityInstantiator = driver.entityInstantiator("/person") + val entityInstantiator = driver.entityInstantiator("person") val exception = assertFailsWith { entityInstantiator.createWithNames(mapOf("placement" to mapOf("x" to 4, "y" to 4))) } - assertEquals("placement", exception.definition?.defName) + assertEquals("components/placement", exception.definition) assertEquals(ReflectCallerState.Valid, exception.arguments["x"]?.state) assertEquals(ReflectCallerState.Valid, exception.arguments["y"]?.state) assertEquals(ReflectCallerState.InvalidNull, exception.arguments["size"]?.state) @@ -28,14 +28,14 @@ class FledEntityTest : EntityTest() { @Test fun throwsOnMissingEntityArgument() { val driver = createDriver() - val entityInstantiator = driver.entityInstantiator("/person") + val entityInstantiator = driver.entityInstantiator("person") val exception = assertFailsWith { entityInstantiator.createWithArgs(listOf( ComponentArgument("placement", "x", 4), ComponentArgument("placement", "y", 4) )) } - assertEquals("placement", exception.definition?.defName) + assertEquals("components/placement", exception.definition) assertEquals(ReflectCallerState.Valid, exception.arguments["x"]?.state) assertEquals(ReflectCallerState.Valid, exception.arguments["y"]?.state) assertEquals(ReflectCallerState.InvalidNull, exception.arguments["size"]?.state) diff --git a/definitions-ecs-fled/src/test/kotlin/fledware/ecs/definitions/fled/FledWorldTest.kt b/definitions-ecs-fled/src/test/kotlin/fledware/ecs/definitions/fled/FledWorldTest.kt index fa1a93a..0623637 100644 --- a/definitions-ecs-fled/src/test/kotlin/fledware/ecs/definitions/fled/FledWorldTest.kt +++ b/definitions-ecs-fled/src/test/kotlin/fledware/ecs/definitions/fled/FledWorldTest.kt @@ -1,7 +1,7 @@ package fledware.ecs.definitions.fled import fledware.definitions.util.safeGet -import fledware.ecs.definitions.instantiator.ComponentArgument +import fledware.ecs.definitions.ComponentArgument import fledware.ecs.definitions.test.WorldTest import kotlin.test.Test import kotlin.test.assertEquals @@ -18,7 +18,7 @@ class FledWorldTest : WorldTest() { @Test fun canCreateWorldWithComponent() { val driver = createDriver() - driver.engine.createDefinedWorldAndFlush("/main") + driver.engine.createDefinedWorldAndFlush("main") val worldComponent = driver.worldComponent assertEquals(0, worldComponent.safeGet("sizeX")) assertEquals(0, worldComponent.safeGet("sizeY")) @@ -27,7 +27,7 @@ class FledWorldTest : WorldTest() { @Test fun canCreateWorldWithInputNames() { val driver = createDriver() - driver.engine.createDefinedWorldAndFlush("/main", mapOf( + driver.engine.createDefinedWorldAndFlush("main", mapOf( "world-component" to mapOf( "sizeX" to 123 ) @@ -40,7 +40,7 @@ class FledWorldTest : WorldTest() { @Test fun canCreateWorldWithInputArgs() { val driver = createDriver() - driver.engine.createDefinedWorldAndFlush("/main", listOf( + driver.engine.createDefinedWorldAndFlush("main", listOf( ComponentArgument("world-component", "sizeX", 234), ComponentArgument("world-component", "sizeY", 456) )) diff --git a/definitions-ecs-fled/src/test/kotlin/fledware/ecs/definitions/fled/driver_fled.kt b/definitions-ecs-fled/src/test/kotlin/fledware/ecs/definitions/fled/driver_fled.kt index 2aac65c..64ea2b5 100644 --- a/definitions-ecs-fled/src/test/kotlin/fledware/ecs/definitions/fled/driver_fled.kt +++ b/definitions-ecs-fled/src/test/kotlin/fledware/ecs/definitions/fled/driver_fled.kt @@ -3,14 +3,15 @@ package fledware.ecs.definitions.fled import fledware.definitions.DefinitionsManager -import fledware.definitions.reader.gatherJar -import fledware.definitions.registry.DefaultDefinitionsBuilder -import fledware.definitions.tests.testJarPath +import fledware.definitions.builder.std.defaultBuilder +import fledware.definitions.tests.testJarFile import fledware.ecs.Engine import fledware.ecs.Entity import fledware.ecs.World -import fledware.ecs.definitions.instantiator.EntityInstantiator -import fledware.ecs.definitions.instantiator.SceneInstantiator +import fledware.ecs.definitions.EntityInstantiator +import fledware.ecs.definitions.SceneInstantiator +import fledware.ecs.definitions.entityInstantiatorFactory +import fledware.ecs.definitions.sceneInstantiatorFactory import fledware.ecs.definitions.test.ManagerDriver import fledware.ecs.ex.withEntityFlags import fledware.ecs.ex.withWorldScenes @@ -18,16 +19,12 @@ import fledware.ecs.impl.DefaultEngine import kotlin.reflect.KClass -fun createFledManager() = DefaultDefinitionsBuilder(listOf( - fledComponentDefinitionLifecycle(), - fledEntityDefinitionLifecycle(), - fledSceneDefinitionLifecycle(), - fledSystemDefinitionLifecycle(), - fledWorldDefinitionLifecycle() -)).also { - it.gatherJar("ecs-loading".testJarPath) - it.gatherJar("ecs-loading-fled".testJarPath) -}.build() +fun createFledManager() = defaultBuilder() + .withFledEcs() + .create() + .withModPackage("ecs-loading".testJarFile.path) + .withModPackage("ecs-loading-fled".testJarFile.path) + .build() fun createFledEngine() = createFledManager().also { manager -> DefaultEngine() @@ -51,8 +48,8 @@ class FledManagerDriver(override val manager: DefinitionsManager) : ManagerDrive override val systems: List get() = world?.data?.systems?.values?.toList() ?: emptyList() - override fun entityInstantiator(type: String): EntityInstantiator { - return manager.entityInstantiator(type) as EntityInstantiator + override fun entityInstantiator(type: String): EntityInstantiator { + return manager.entityInstantiatorFactory.getOrCreate(type) } override fun entityComponent(entity: Any, type: KClass): Any { @@ -67,8 +64,8 @@ class FledManagerDriver(override val manager: DefinitionsManager) : ManagerDrive return (entity as Entity).definitionType } - override fun sceneInstantiator(type: String): SceneInstantiator { - return manager.sceneInstantiator(type) as SceneInstantiator + override fun sceneInstantiator(type: String): SceneInstantiator { + return manager.sceneInstantiatorFactory.getOrCreate(type) } override fun decorateWithScene(type: String) { diff --git a/definitions-ecs/build.gradle b/definitions-ecs/build.gradle index e228762..1dbfa92 100644 --- a/definitions-ecs/build.gradle +++ b/definitions-ecs/build.gradle @@ -1,7 +1,7 @@ dependencies { - api project(':definitions') + api project(':definitions-builder') - testFixturesApi testFixtures(project(":definitions")) + testFixturesApi testFixtures(project(":definitions-builder")) } test { diff --git a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/ComponentArgument.kt b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/ComponentArgument.kt similarity index 94% rename from definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/ComponentArgument.kt rename to definitions-ecs/src/main/kotlin/fledware/ecs/definitions/ComponentArgument.kt index 4eed679..bfa2561 100644 --- a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/ComponentArgument.kt +++ b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/ComponentArgument.kt @@ -1,4 +1,4 @@ -package fledware.ecs.definitions.instantiator +package fledware.ecs.definitions interface ComponentArgument { diff --git a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/ComponentLifecycle.kt b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/ComponentLifecycle.kt deleted file mode 100644 index 822512a..0000000 --- a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/ComponentLifecycle.kt +++ /dev/null @@ -1,22 +0,0 @@ -package fledware.ecs.definitions - -import fledware.definitions.DefinitionInstantiationLifecycle -import fledware.definitions.lifecycle.classLifecycleOf - -/** - * - */ -@Target(AnnotationTarget.CLASS) -annotation class EcsComponent(val name: String) - -/** - * the common name for the ecs component lifecycle. - */ -const val componentLifecycleName = "component" - -/** - * Creates a lifecycle for components - */ -inline fun componentLifecycleOf(instantiated: DefinitionInstantiationLifecycle = DefinitionInstantiationLifecycle()) = - classLifecycleOf(componentLifecycleName, instantiated) - { _, raw -> (raw.annotation as EcsComponent).name } diff --git a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/Components.kt b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/Components.kt new file mode 100644 index 0000000..7c26367 --- /dev/null +++ b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/Components.kt @@ -0,0 +1,57 @@ +package fledware.ecs.definitions + +import fledware.definitions.DefinitionRegistry +import fledware.definitions.DefinitionsManager +import fledware.definitions.builder.BuilderState +import fledware.definitions.builder.DefinitionRegistryBuilder +import fledware.definitions.builder.DefinitionsBuilderFactory +import fledware.definitions.builder.findRegistryOf +import fledware.definitions.builder.registries.AnnotatedClassDefinition +import fledware.definitions.builder.registries.AnnotatedClassRegistryBuilder +import fledware.definitions.builder.std.withAnnotatedClassDefinitionOf +import fledware.definitions.builder.withInstantiatorFactory +import fledware.definitions.findInstantiatorFactoryOf +import fledware.definitions.findRegistryOf +import fledware.definitions.instantiator.AnnotatedClassInstantiatorFactory +import fledware.definitions.util.firstOfType + +/** + * + */ +@Target(AnnotationTarget.CLASS) +annotation class EcsComponent(val name: String) + + +/** + * the common name for the ecs component lifecycle. + */ +const val ecsComponentsRegistryName = "components" + +/** + * + */ +val DefinitionsManager.componentDefinitions: DefinitionRegistry> + get() = this.findRegistryOf(ecsComponentsRegistryName) + +/** + * + */ +val DefinitionsManager.componentInstantiatorFactory: AnnotatedClassInstantiatorFactory + get() = this.findInstantiatorFactoryOf(ecsComponentsRegistryName) + +/** + * + */ +val BuilderState.componentDefinitions: DefinitionRegistryBuilder, AnnotatedClassDefinition> + get() = this.findRegistryOf(ecsComponentsRegistryName) + +/** + * creates a [AnnotatedClassRegistryBuilder] for the [EcsComponent] annotation, + * requires the types to extend [T], and adds the AnnotatedClassHandler entry + * processors for ecs finding components. + */ +inline fun DefinitionsBuilderFactory.withEcsComponents() = this + .withAnnotatedClassDefinitionOf(ecsComponentsRegistryName) { + it.annotations.firstOfType().name + } + .withInstantiatorFactory(AnnotatedClassInstantiatorFactory(ecsComponentsRegistryName)) diff --git a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/Entity.kt b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/Entity.kt new file mode 100644 index 0000000..48e68b0 --- /dev/null +++ b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/Entity.kt @@ -0,0 +1,155 @@ +package fledware.ecs.definitions + +import fledware.definitions.DefinitionRegistry +import fledware.definitions.DefinitionsManager +import fledware.definitions.Instantiator +import fledware.definitions.builder.BuilderState +import fledware.definitions.builder.DefinitionRegistryBuilder +import fledware.definitions.builder.DefinitionsBuilderFactory +import fledware.definitions.builder.findRegistryOf +import fledware.definitions.builder.std.withDirectoryResourceOf +import fledware.definitions.builder.withInstantiatorFactory +import fledware.definitions.findInstantiatorFactoryOf +import fledware.definitions.findRegistryOf +import fledware.definitions.instantiator.AbstractInstantiatorFactory +import fledware.definitions.instantiator.ReflectInstantiator +import fledware.definitions.manager.walk +import java.util.concurrent.ConcurrentHashMap +import kotlin.reflect.KClass + + +data class EntityDefinition( + val extends: String?, + val components: Map> = emptyMap() +) + +data class EntityRawDefinition( + val extends: String?, + val components: Map>? +) + +const val ecsEntityDefinitionRegistryName = "entities" + +fun DefinitionsBuilderFactory.withEcsEntities() = + withDirectoryResourceOf( + ecsEntityDefinitionRegistryName, + ecsEntityDefinitionRegistryName + ) + +fun DefinitionsBuilderFactory.withEcsEntities( + entityInstantiatorFactory: EntityInstantiatorFactory +) = withDirectoryResourceOf( + ecsEntityDefinitionRegistryName, + ecsEntityDefinitionRegistryName +).withInstantiatorFactory(entityInstantiatorFactory) + +val DefinitionsManager.entityDefinitions: DefinitionRegistry + get() = this.findRegistryOf(ecsEntityDefinitionRegistryName) + +val DefinitionsManager.entityInstantiatorFactory: EntityInstantiatorFactory + get() = this.findInstantiatorFactoryOf(ecsEntityDefinitionRegistryName) + +@Suppress("UNCHECKED_CAST") +fun DefinitionsManager.entityInstantiatorFactory() = + entityInstantiatorFactory as EntityInstantiatorFactory + +val BuilderState.entityDefinitions: DefinitionRegistryBuilder + get() = this.findRegistryOf(ecsEntityDefinitionRegistryName) + + +abstract class EntityInstantiatorFactory : AbstractInstantiatorFactory() { + + override val factoryName: String + get() = ecsEntityDefinitionRegistryName + + override val instantiators: Map> + get() = _instantiators + + protected val _instantiators = ConcurrentHashMap>() + + protected abstract fun entityInstantiator( + instantiatorName: String, + defaultComponentValues: Map>, + componentInstantiators: Map> + ): EntityInstantiator + + override fun getOrCreate(name: String): EntityInstantiator { + return _instantiators.computeIfAbsent(name) { + val initialComponentValues: Map> = buildMap { + manager.entityDefinitions.walk(name) { definition -> + definition.components.forEach { (name, args) -> + this[name] = args + this.getOrDefault(name, emptyMap()) + } + definition.extends + } + } + val componentInstantiators = buildMap { + initialComponentValues.keys.forEach { componentName -> + this[componentName] = manager.componentInstantiatorFactory.getOrCreate(componentName) + } + } + val defaultComponentValues = initialComponentValues.mapValues { (name, values) -> + val component = componentInstantiators[name]!! + component.ensureParameterTypes(values) + } + entityInstantiator( + name, + defaultComponentValues, + componentInstantiators + ) + } + } +} + +abstract class EntityInstantiator( + val defaultComponentValues: Map>, + val componentInstantiators: Map> +) : Instantiator { + override val factoryName: String + get() = ecsEntityDefinitionRegistryName + + protected abstract fun actualCreate(input: Map>): E + + protected abstract fun getComponent(entity: E, component: KClass): Any + + fun mutateWithNames(entity: E, mutations: Map>) { + mutations.forEach { (name, values) -> + val component = componentInstantiators[name] + ?: throw IllegalStateException("unknown component definition: $name") + val componentInstance = getComponent(entity, component.instantiating) + component.mutateWithNames(componentInstance, values) + } + } + + fun mutateWithArgs(entity: E, mutations: List) { + mutations.forEach { + val component = componentInstantiators[it.componentType] + ?: throw IllegalStateException("unknown component definition: ${it.componentType}") + val componentInstance = getComponent(entity, component.instantiating) + component.mutate(componentInstance, it.componentField, it.value) + } + } + + fun create(): E { + return actualCreate(defaultComponentValues) + } + + fun createWithNames(componentInput: Map>): E { + val inputs = mutableMapOf>() + defaultComponentValues.forEach { inputs[it.key] = it.value.toMutableMap() } + componentInput.forEach { (name, values) -> + inputs.computeIfAbsent(name) { mutableMapOf() }.putAll(values) + } + return actualCreate(inputs) + } + + fun createWithArgs(componentInput: List): E { + val inputs = mutableMapOf>() + defaultComponentValues.forEach { inputs[it.key] = it.value.toMutableMap() } + componentInput.forEach { + val component = inputs.computeIfAbsent(it.componentType) { mutableMapOf() } + component[it.componentField] = it.value + } + return actualCreate(inputs) + } +} diff --git a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/EntityLifecycle.kt b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/EntityLifecycle.kt deleted file mode 100644 index 428758a..0000000 --- a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/EntityLifecycle.kt +++ /dev/null @@ -1,58 +0,0 @@ -package fledware.ecs.definitions - -import fledware.definitions.Definition -import fledware.definitions.DefinitionsBuilder -import fledware.definitions.DefinitionsManager -import fledware.definitions.DefinitionInstantiationLifecycle -import fledware.definitions.lifecycle.directoryResourceWithRawLifecycle -import fledware.definitions.processor.ObjectUpdaterRawAggregator -import fledware.definitions.registry.SimpleDefinitionRegistry - - -data class EntityDefinition( - override val defName: String, - val extends: String?, - val components: Map> = emptyMap() -) : Definition - -data class EntityRawDefinition( - val extends: String?, - val components: Map>? -) - -/** - * - */ -typealias EntityDefinitionsRegistry = SimpleDefinitionRegistry - -/** - * gets the EntityDefinitionsRegistry - */ -@Suppress("UNCHECKED_CAST") -val DefinitionsManager.entityDefinitions: EntityDefinitionsRegistry - get() = registry(entityLifecycleName) as EntityDefinitionsRegistry - -/** - * - */ -typealias EntityDefinitionsAggregator = ObjectUpdaterRawAggregator - -/** - * gets the EntityDefinitionsAggregator - */ -@Suppress("UNCHECKED_CAST") -val DefinitionsBuilder.entityDefinitions: EntityDefinitionsAggregator - get() = this[entityLifecycleName] as EntityDefinitionsAggregator - -/** - * - */ -const val entityLifecycleName = "entity" - -/** - * - */ -fun entityLifecycle(instantiated: DefinitionInstantiationLifecycle = DefinitionInstantiationLifecycle()) = - directoryResourceWithRawLifecycle( - "entities", entityLifecycleName, instantiated) - diff --git a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/Scene.kt b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/Scene.kt new file mode 100644 index 0000000..194c017 --- /dev/null +++ b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/Scene.kt @@ -0,0 +1,124 @@ +package fledware.ecs.definitions + +import fledware.definitions.DefinitionRegistry +import fledware.definitions.DefinitionsManager +import fledware.definitions.Instantiator +import fledware.definitions.builder.BuilderState +import fledware.definitions.builder.DefinitionRegistryBuilder +import fledware.definitions.builder.DefinitionsBuilderFactory +import fledware.definitions.builder.findRegistryOf +import fledware.definitions.builder.std.withDirectoryResourceOf +import fledware.definitions.builder.withInstantiatorFactory +import fledware.definitions.exceptions.UnknownDefinitionException +import fledware.definitions.findInstantiatorFactoryOf +import fledware.definitions.findRegistryOf +import fledware.definitions.instantiator.AbstractInstantiatorFactory +import fledware.definitions.manager.walk +import java.util.concurrent.ConcurrentHashMap + +/** + * + */ +data class SceneRawDefinition( + val extends: String?, + val entities: List? +) + +/** + * + */ +data class SceneDefinition(val extends: String?, + val entities: List) + +const val ecsSceneDefinitionRegistryName = "scenes" + +fun DefinitionsBuilderFactory.withEcsScenes() = + withDirectoryResourceOf( + ecsSceneDefinitionRegistryName, + ecsSceneDefinitionRegistryName + ) + +fun > DefinitionsBuilderFactory.withEcsScenes( + sceneInstantiatorFactory: SceneInstantiatorFactory +) = withDirectoryResourceOf( + ecsSceneDefinitionRegistryName, + ecsSceneDefinitionRegistryName +).withInstantiatorFactory(sceneInstantiatorFactory) + +val DefinitionsManager.sceneDefinitions: DefinitionRegistry + get() = this.findRegistryOf(ecsSceneDefinitionRegistryName) + +val DefinitionsManager.sceneInstantiatorFactory: SceneInstantiatorFactory> + get() = this.findInstantiatorFactoryOf(ecsSceneDefinitionRegistryName) + +@Suppress("UNCHECKED_CAST") +fun > DefinitionsManager.sceneInstantiatorFactory() = + sceneInstantiatorFactory as SceneInstantiatorFactory + +val BuilderState.sceneDefinitions: DefinitionRegistryBuilder + get() = this.findRegistryOf(ecsSceneDefinitionRegistryName) + + +abstract class SceneInstantiatorFactory> : AbstractInstantiatorFactory() { + override val factoryName: String + get() = ecsSceneDefinitionRegistryName + + override val instantiators: Map> + get() = _instantiators + + protected val _instantiators = ConcurrentHashMap() + + protected abstract fun sceneInstantiator( + instantiatorName: String, + entityInstantiators: Map>, + entities: List + ): I + + override fun getOrCreate(name: String): I { + return _instantiators.computeIfAbsent(name) { + val entityInstantiators = mutableMapOf>() + val entities: List = buildList { + manager.sceneDefinitions.walk(name) { + it.entities.forEach { entity -> + entityInstantiators.computeIfAbsent(entity.type) { + manager.entityInstantiatorFactory().getOrCreate(entity.type) + } + this.add(entity) + } + it.extends + } + } + + sceneInstantiator( + name, + entityInstantiators, + entities + ) + } + } +} + + +abstract class SceneInstantiator( + val entityInstantiators: Map>, + val entities: List +) : Instantiator { + + override val factoryName: String + get() = ecsSceneDefinitionRegistryName + + protected abstract fun setName(entity: E, name: String) + + protected abstract fun factory(entities: List): S + + open fun create(): S { + val entities = entities.map { instance -> + val instantiator = entityInstantiators[instance.type] + ?: throw UnknownDefinitionException(ecsEntityDefinitionRegistryName, instance.type) + val entity = instantiator.createWithNames(instance.components) + instance.name?.also { setName(entity, it) } + entity + } + return factory(entities) + } +} \ No newline at end of file diff --git a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/SceneLifecycle.kt b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/SceneLifecycle.kt deleted file mode 100644 index d1a29c9..0000000 --- a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/SceneLifecycle.kt +++ /dev/null @@ -1,52 +0,0 @@ -package fledware.ecs.definitions - -import fledware.definitions.Definition -import fledware.definitions.DefinitionsBuilder -import fledware.definitions.DefinitionsManager -import fledware.definitions.DefinitionInstantiationLifecycle -import fledware.definitions.lifecycle.directoryResourceWithRawLifecycle -import fledware.definitions.processor.ObjectUpdaterRawAggregator -import fledware.definitions.registry.SimpleDefinitionRegistry - -/** - * - */ -data class SceneRawDefinition( - val extends: String?, - val entities: List? -) - -/** - * - */ -data class SceneDefinition(override val defName: String, - val extends: String?, - val entities: List) - : Definition - - -/** - * gets the SceneDefinitionRegistry - */ -@Suppress("UNCHECKED_CAST") -val DefinitionsManager.sceneDefinitions: SimpleDefinitionRegistry - get() = registry(sceneLifecycleName) as SimpleDefinitionRegistry - -/** - * gets the SceneDefinitionProcessor - */ -@Suppress("UNCHECKED_CAST") -val DefinitionsBuilder.sceneDefinitions: ObjectUpdaterRawAggregator - get() = this[sceneLifecycleName] as ObjectUpdaterRawAggregator - -/** - * - */ -const val sceneLifecycleName = "scene" - -/** - * - */ -fun sceneLifecycle(instantiated: DefinitionInstantiationLifecycle = DefinitionInstantiationLifecycle()) = - directoryResourceWithRawLifecycle( - "scenes", sceneLifecycleName, instantiated) diff --git a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/System.kt b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/System.kt new file mode 100644 index 0000000..e27bd8e --- /dev/null +++ b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/System.kt @@ -0,0 +1,61 @@ +package fledware.ecs.definitions + +import fledware.definitions.DefinitionRegistry +import fledware.definitions.DefinitionsManager +import fledware.definitions.builder.BuilderState +import fledware.definitions.builder.DefinitionRegistryBuilder +import fledware.definitions.builder.DefinitionsBuilderFactory +import fledware.definitions.builder.findRegistryOf +import fledware.definitions.builder.registries.AnnotatedClassDefinition +import fledware.definitions.builder.std.withAnnotatedClassDefinitionOf +import fledware.definitions.builder.withInstantiatorFactory +import fledware.definitions.findInstantiatorFactoryOf +import fledware.definitions.findRegistryOf +import fledware.definitions.instantiator.AnnotatedClassInstantiatorFactory +import fledware.definitions.util.firstOfType + + +/** + * + */ +@Target(AnnotationTarget.CLASS) +annotation class EcsSystem(val name: String) + +/** + * the common name for the ecs system lifecycle. + */ +const val ecsSystemRegistryName = "systems" + +/** + * + */ +val DefinitionsManager.systemDefinitions: DefinitionRegistry> + get() = this.findRegistryOf(ecsSystemRegistryName) + +/** + * + */ +val DefinitionsManager.systemInstantiatorFactory: AnnotatedClassInstantiatorFactory + get() = this.findInstantiatorFactoryOf(ecsSystemRegistryName) + +/** + * + */ +@Suppress("UNCHECKED_CAST") +fun DefinitionsManager.systemInstantiatorFactory() = + systemInstantiatorFactory as AnnotatedClassInstantiatorFactory + +/** + * + */ +val BuilderState.systemDefinitions: DefinitionRegistryBuilder, AnnotatedClassDefinition> + get() = this.findRegistryOf(ecsSystemRegistryName) + +/** + * + */ +inline fun DefinitionsBuilderFactory.withEcsSystems() = this + .withAnnotatedClassDefinitionOf(ecsSystemRegistryName) { + it.annotations.firstOfType().name + } + .withInstantiatorFactory(AnnotatedClassInstantiatorFactory(ecsSystemRegistryName)) diff --git a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/SystemLifecycle.kt b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/SystemLifecycle.kt deleted file mode 100644 index ea1da23..0000000 --- a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/SystemLifecycle.kt +++ /dev/null @@ -1,23 +0,0 @@ -package fledware.ecs.definitions - -import fledware.definitions.DefinitionInstantiationLifecycle -import fledware.definitions.lifecycle.classLifecycleOf - - -/** - * - */ -@Target(AnnotationTarget.CLASS) -annotation class EcsSystem(val name: String) - -/** - * the common name for the ecs system lifecycle. - */ -const val systemLifecycleName = "system" - -/** - * Creates a lifecycle for systems - */ -inline fun systemLifecycleOf(instantiated: DefinitionInstantiationLifecycle = DefinitionInstantiationLifecycle()) = - classLifecycleOf(systemLifecycleName, instantiated) - { _, raw -> (raw.annotation as EcsSystem).name } diff --git a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/World.kt b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/World.kt new file mode 100644 index 0000000..89fc5b4 --- /dev/null +++ b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/World.kt @@ -0,0 +1,157 @@ +package fledware.ecs.definitions + +import fledware.definitions.DefinitionRegistry +import fledware.definitions.DefinitionsManager +import fledware.definitions.Instantiator +import fledware.definitions.builder.BuilderState +import fledware.definitions.builder.DefinitionRegistryBuilder +import fledware.definitions.builder.DefinitionsBuilderFactory +import fledware.definitions.builder.findRegistryOf +import fledware.definitions.builder.std.withDirectoryResourceOf +import fledware.definitions.builder.withInstantiatorFactory +import fledware.definitions.findInstantiatorFactoryOf +import fledware.definitions.findRegistryOf +import fledware.definitions.instantiator.AbstractInstantiatorFactory +import fledware.definitions.instantiator.ReflectInstantiator +import fledware.definitions.manager.walk +import java.util.concurrent.ConcurrentHashMap +import kotlin.reflect.KClass + + +data class WorldDefinition( + val extends: String?, + val initFunction: String?, + val decoratorFunctions: List = emptyList(), + val systems: List = emptyList(), + val contexts: Map> = emptyMap(), + val entities: List = emptyList() +) + +data class WorldRawDefinition( + val extends: String?, + val initFunction: String?, + val decoratorFunctions: List?, + val systems: Set?, + val contexts: Map>?, + val entities: List? +) + +const val ecsWorldDefinitionRegistryName = "worlds" + +fun DefinitionsBuilderFactory.withEcsWorlds() = + withDirectoryResourceOf( + ecsWorldDefinitionRegistryName, + ecsWorldDefinitionRegistryName + ) + +fun > DefinitionsBuilderFactory.withEcsWorlds( + worldInstantiatorFactory: WorldInstantiatorFactory +) = withDirectoryResourceOf( + ecsWorldDefinitionRegistryName, + ecsWorldDefinitionRegistryName +).withInstantiatorFactory(worldInstantiatorFactory) + +val DefinitionsManager.worldDefinitions: DefinitionRegistry + get() = this.findRegistryOf(ecsWorldDefinitionRegistryName) + +val DefinitionsManager.worldInstantiatorFactory: WorldInstantiatorFactory> + get() = this.findInstantiatorFactoryOf(ecsWorldDefinitionRegistryName) + +val BuilderState.worldDefinitions: DefinitionRegistryBuilder + get() = this.findRegistryOf(ecsWorldDefinitionRegistryName) + + +abstract class WorldInstantiatorFactory> : AbstractInstantiatorFactory() { + override val factoryName: String + get() = ecsWorldDefinitionRegistryName + + override val instantiators: Map> + get() = _instantiators + + protected val _instantiators = ConcurrentHashMap() + + protected abstract fun worldInstantiator( + instantiatorName: String, + systems: List>, + entities: List>>, + componentValues: Map>, + componentInstantiators: Map>, + initFunctions: List, + decoratorFunctions: List + ): I + + override fun getOrCreate(name: String): I { + return _instantiators.computeIfAbsent(name) { + + val systems = mutableMapOf>() + val entities = mutableListOf>>() + val initialComponentValues = mutableMapOf>() + val componentInstantiators = mutableMapOf>() + val initFunctions = mutableListOf() + val decoratorFunctions = mutableListOf() + + manager.worldDefinitions.walk(name) { worldDefinition -> + worldDefinition.systems.forEach { systemName -> + systems.computeIfAbsent(systemName) { + manager.systemInstantiatorFactory().getOrCreate(systemName) + } + } + worldDefinition.entities.forEach { entity -> + entities += entity to manager.entityInstantiatorFactory().getOrCreate(entity.type) + } + worldDefinition.contexts.forEach { (name, args) -> + initialComponentValues[name] = args + initialComponentValues.getOrDefault(name, emptyMap()) + componentInstantiators.computeIfAbsent(name) { + manager.componentInstantiatorFactory.getOrCreate(name) + } + } + + worldDefinition.initFunction?.also { initFunction -> + if (initFunction !in initFunctions) + initFunctions += initFunction + } + worldDefinition.decoratorFunctions.forEach { decoratorFunction -> + if (decoratorFunction !in decoratorFunctions) + decoratorFunctions += decoratorFunction + } + + worldDefinition.extends + } + + // reverse the functions so the parents are initialized/decorated first + initFunctions.reverse() + decoratorFunctions.reverse() + + val componentValues = initialComponentValues.mapValues { (name, values) -> + val component = componentInstantiators[name]!! + component.ensureParameterTypes(values) + } + + worldInstantiator( + name, + systems.values.toList(), + entities, + componentValues, + componentInstantiators, + initFunctions, + decoratorFunctions + ) + } + } +} + + +abstract class WorldInstantiator( + val systems: List>, + val entities: List>>, + val componentValues: Map>, + val componentInstantiators: Map>, + val initFunctions: List, + val decoratorFunctions: List +) : Instantiator { + override val factoryName: String + get() = ecsWorldDefinitionRegistryName + + override val instantiating: KClass + get() = Any::class +} diff --git a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/WorldLifecycle.kt b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/WorldLifecycle.kt deleted file mode 100644 index 2f3f1f6..0000000 --- a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/WorldLifecycle.kt +++ /dev/null @@ -1,65 +0,0 @@ -package fledware.ecs.definitions - -import fledware.definitions.Definition -import fledware.definitions.DefinitionsBuilder -import fledware.definitions.DefinitionsManager -import fledware.definitions.DefinitionInstantiationLifecycle -import fledware.definitions.lifecycle.directoryResourceWithRawLifecycle -import fledware.definitions.processor.ObjectUpdaterRawAggregator -import fledware.definitions.registry.SimpleDefinitionRegistry - - -data class WorldDefinition( - override val defName: String, - val extends: String?, - val initFunction: String?, - val decoratorFunctions: List = emptyList(), - val systems: List = emptyList(), - val contexts: Map> = emptyMap(), - val entities: List = emptyList() -) : Definition - -data class WorldRawDefinition( - val extends: String?, - val initFunction: String?, - val decoratorFunctions: List?, - val systems: Set?, - val contexts: Map>?, - val entities: List? -) - -/** - * - */ -typealias WorldDefinitionsRegistry = SimpleDefinitionRegistry - -/** - * gets the WorldDefinitionsRegistry - */ -@Suppress("UNCHECKED_CAST") -val DefinitionsManager.worldDefinitions: WorldDefinitionsRegistry - get() = registry(worldLifecycleName) as WorldDefinitionsRegistry - -/** - * - */ -typealias WorldDefinitionsAggregator = ObjectUpdaterRawAggregator - -/** - * gets the WorldDefinitionsAggregator - */ -@Suppress("UNCHECKED_CAST") -val DefinitionsBuilder.worldDefinitions: WorldDefinitionsAggregator - get() = this[worldLifecycleName] as WorldDefinitionsAggregator - -/** - * - */ -const val worldLifecycleName = "world" - -/** - * - */ -fun worldLifecycle(instantiated: DefinitionInstantiationLifecycle = DefinitionInstantiationLifecycle()) = - directoryResourceWithRawLifecycle( - "worlds", worldLifecycleName, instantiated) diff --git a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/ComponentInstantiator.kt b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/ComponentInstantiator.kt deleted file mode 100644 index 108dd73..0000000 --- a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/ComponentInstantiator.kt +++ /dev/null @@ -1,10 +0,0 @@ -package fledware.ecs.definitions.instantiator - -import fledware.definitions.instantiator.ReflectInstantiator -import fledware.definitions.lifecycle.BasicClassDefinition -import kotlin.reflect.KClass - - -@Suppress("UNCHECKED_CAST") -abstract class ComponentInstantiator(definition: BasicClassDefinition) - : ReflectInstantiator, C>(definition, definition.klass as KClass) diff --git a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/EntityInstantiator.kt b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/EntityInstantiator.kt index 2148d18..488d09a 100644 --- a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/EntityInstantiator.kt +++ b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/EntityInstantiator.kt @@ -1,91 +1,92 @@ -package fledware.ecs.definitions.instantiator - -import fledware.definitions.DefinitionInstantiator -import fledware.definitions.DefinitionsManager -import fledware.definitions.ex.walk -import fledware.ecs.definitions.EntityDefinition -import fledware.ecs.definitions.componentLifecycleName -import fledware.ecs.definitions.entityDefinitions -import kotlin.collections.component1 -import kotlin.collections.component2 -import kotlin.collections.set -import kotlin.reflect.KClass - -abstract class EntityInstantiator( - final override val definition: EntityDefinition, - protected val manager: DefinitionsManager -) : DefinitionInstantiator { - - @Suppress("UNCHECKED_CAST") - protected open fun componentInstantiator(manager: DefinitionsManager, type: String) = - manager.instantiator(componentLifecycleName, type) as ComponentInstantiator - - protected abstract fun actualCreate(input: Map>): E - protected abstract fun getComponent(entity: E, component: KClass): Any - - - val defaultComponentValues: Map> - - val componentInstantiators: Map> - - init { - val defaultComponentValues: Map> = buildMap { - manager.entityDefinitions.walk(definition.defName) { definition -> - definition.components.forEach { (name, args) -> - this[name] = args + this.getOrDefault(name, emptyMap()) - } - definition.extends - } - } - componentInstantiators = buildMap { - defaultComponentValues.keys.forEach { componentName -> - this[componentName] = componentInstantiator(manager, componentName) - } - } - this.defaultComponentValues = defaultComponentValues.mapValues { (name, values) -> - val component = componentInstantiators[name]!! - component.ensureParameterTypes(values) - } - } - - fun mutateWithNames(entity: E, mutations: Map>) { - mutations.forEach { (name, values) -> - val component = componentInstantiators[name] - ?: throw IllegalStateException("unknown component definition: $name") - val componentInstance = getComponent(entity, component.clazz) - component.mutateWithNames(componentInstance, values) - } - } - - fun mutateWithArgs(entity: E, mutations: List) { - mutations.forEach { - val component = componentInstantiators[it.componentType] - ?: throw IllegalStateException("unknown component definition: ${it.componentType}") - val componentInstance = getComponent(entity, component.clazz) - component.mutate(componentInstance, it.componentField, it.value) - } - } - - fun create(): E { - return actualCreate(defaultComponentValues) - } - - fun createWithNames(componentInput: Map>): E { - val inputs = mutableMapOf>() - defaultComponentValues.forEach { inputs[it.key] = it.value.toMutableMap() } - componentInput.forEach { (name, values) -> - inputs.computeIfAbsent(name) { mutableMapOf() }.putAll(values) - } - return actualCreate(inputs) - } - - fun createWithArgs(componentInput: List): E { - val inputs = mutableMapOf>() - defaultComponentValues.forEach { inputs[it.key] = it.value.toMutableMap() } - componentInput.forEach { - val component = inputs.computeIfAbsent(it.componentType) { mutableMapOf() } - component[it.componentField] = it.value - } - return actualCreate(inputs) - } -} \ No newline at end of file +//package fledware.ecs.definitions.instantiator +// +//import fledware.definitions.Instantiator +//import fledware.definitions.DefinitionsManager +//import fledware.definitions.ex.walk +//import fledware.ecs.definitions.ComponentArgument +//import fledware.ecs.definitions.EntityDefinition +//import fledware.ecs.definitions.componentLifecycleName +//import fledware.ecs.definitions.entityDefinitions +//import kotlin.collections.component1 +//import kotlin.collections.component2 +//import kotlin.collections.set +//import kotlin.reflect.KClass +// +//abstract class EntityInstantiator( +// final override val definition: EntityDefinition, +// protected val manager: DefinitionsManager +//) : Instantiator { +// +// @Suppress("UNCHECKED_CAST") +// protected open fun componentInstantiator(manager: DefinitionsManager, type: String) = +// manager.instantiator(componentLifecycleName, type) as ComponentInstantiator +// +// protected abstract fun actualCreate(input: Map>): E +// protected abstract fun getComponent(entity: E, component: KClass): Any +// +// +// val defaultComponentValues: Map> +// +// val componentInstantiators: Map> +// +// init { +// val defaultComponentValues: Map> = buildMap { +// manager.entityDefinitions.walk(definition.defName) { definition -> +// definition.components.forEach { (name, args) -> +// this[name] = args + this.getOrDefault(name, emptyMap()) +// } +// definition.extends +// } +// } +// componentInstantiators = buildMap { +// defaultComponentValues.keys.forEach { componentName -> +// this[componentName] = componentInstantiator(manager, componentName) +// } +// } +// this.defaultComponentValues = defaultComponentValues.mapValues { (name, values) -> +// val component = componentInstantiators[name]!! +// component.ensureParameterTypes(values) +// } +// } +// +// fun mutateWithNames(entity: E, mutations: Map>) { +// mutations.forEach { (name, values) -> +// val component = componentInstantiators[name] +// ?: throw IllegalStateException("unknown component definition: $name") +// val componentInstance = getComponent(entity, component.clazz) +// component.mutateWithNames(componentInstance, values) +// } +// } +// +// fun mutateWithArgs(entity: E, mutations: List) { +// mutations.forEach { +// val component = componentInstantiators[it.componentType] +// ?: throw IllegalStateException("unknown component definition: ${it.componentType}") +// val componentInstance = getComponent(entity, component.clazz) +// component.mutate(componentInstance, it.componentField, it.value) +// } +// } +// +// fun create(): E { +// return actualCreate(defaultComponentValues) +// } +// +// fun createWithNames(componentInput: Map>): E { +// val inputs = mutableMapOf>() +// defaultComponentValues.forEach { inputs[it.key] = it.value.toMutableMap() } +// componentInput.forEach { (name, values) -> +// inputs.computeIfAbsent(name) { mutableMapOf() }.putAll(values) +// } +// return actualCreate(inputs) +// } +// +// fun createWithArgs(componentInput: List): E { +// val inputs = mutableMapOf>() +// defaultComponentValues.forEach { inputs[it.key] = it.value.toMutableMap() } +// componentInput.forEach { +// val component = inputs.computeIfAbsent(it.componentType) { mutableMapOf() } +// component[it.componentField] = it.value +// } +// return actualCreate(inputs) +// } +//} \ No newline at end of file diff --git a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/SceneInstantiator.kt b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/SceneInstantiator.kt index b15ac98..b8b870c 100644 --- a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/SceneInstantiator.kt +++ b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/SceneInstantiator.kt @@ -1,48 +1,48 @@ -package fledware.ecs.definitions.instantiator - -import fledware.definitions.DefinitionInstantiator -import fledware.definitions.DefinitionsManager -import fledware.definitions.UnknownDefinitionException -import fledware.definitions.ex.walk -import fledware.ecs.definitions.EntityInstance -import fledware.ecs.definitions.SceneDefinition -import fledware.ecs.definitions.entityLifecycleName -import fledware.ecs.definitions.sceneDefinitions - -abstract class SceneInstantiator( - final override val definition: SceneDefinition, - protected val manager: DefinitionsManager -) : DefinitionInstantiator { - - protected val entityInstantiators: Map> - - protected val entities: List = buildList { - val entityInstantiators = mutableMapOf>() - manager.sceneDefinitions.walk(definition.defName) { - it.entities.forEach { entity -> - entityInstantiators.computeIfAbsent(entity.type) { entityInstantiator(manager, entity.type) } - this.add(entity) - } - it.extends - } - this@SceneInstantiator.entityInstantiators = entityInstantiators - } - - @Suppress("UNCHECKED_CAST") - protected open fun entityInstantiator(manager: DefinitionsManager, type: String) = - manager.instantiator(entityLifecycleName, type) as EntityInstantiator - - protected abstract fun setName(entity: E, name: String) - protected abstract fun factory(entities: List): S - - open fun create(): S { - val entities = entities.map { instance -> - val instantiator = entityInstantiators[instance.type] - ?: throw UnknownDefinitionException(entityLifecycleName, instance.type) - val entity = instantiator.createWithNames(instance.components) - instance.name?.also { setName(entity, it) } - entity - } - return factory(entities) - } -} \ No newline at end of file +//package fledware.ecs.definitions.instantiator +// +//import fledware.definitions.DefinitionInstantiator +//import fledware.definitions.DefinitionsManager +//import fledware.definitions.UnknownDefinitionException +//import fledware.definitions.ex.walk +//import fledware.ecs.definitions.EntityInstance +//import fledware.ecs.definitions.SceneDefinition +//import fledware.ecs.definitions.entityLifecycleName +//import fledware.ecs.definitions.sceneDefinitions +// +//abstract class SceneInstantiator( +// final override val definition: SceneDefinition, +// protected val manager: DefinitionsManager +//) : DefinitionInstantiator { +// +// protected val entityInstantiators: Map> +// +// protected val entities: List = buildList { +// val entityInstantiators = mutableMapOf>() +// manager.sceneDefinitions.walk(definition.defName) { +// it.entities.forEach { entity -> +// entityInstantiators.computeIfAbsent(entity.type) { entityInstantiator(manager, entity.type) } +// this.add(entity) +// } +// it.extends +// } +// this@SceneInstantiator.entityInstantiators = entityInstantiators +// } +// +// @Suppress("UNCHECKED_CAST") +// protected open fun entityInstantiator(manager: DefinitionsManager, type: String) = +// manager.instantiator(entityLifecycleName, type) as EntityInstantiator +// +// protected abstract fun setName(entity: E, name: String) +// protected abstract fun factory(entities: List): S +// +// open fun create(): S { +// val entities = entities.map { instance -> +// val instantiator = entityInstantiators[instance.type] +// ?: throw UnknownDefinitionException(entityLifecycleName, instance.type) +// val entity = instantiator.createWithNames(instance.components) +// instance.name?.also { setName(entity, it) } +// entity +// } +// return factory(entities) +// } +//} \ No newline at end of file diff --git a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/SystemInstantiator.kt b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/SystemInstantiator.kt index fcb86a1..487d5d5 100644 --- a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/SystemInstantiator.kt +++ b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/SystemInstantiator.kt @@ -1,10 +1,12 @@ -package fledware.ecs.definitions.instantiator - -import fledware.definitions.instantiator.ConstructorInstantiator -import fledware.definitions.lifecycle.BasicClassDefinition -import kotlin.reflect.KClass - - -@Suppress("UNCHECKED_CAST") -abstract class SystemInstantiator(definition: BasicClassDefinition) - : ConstructorInstantiator, S>(definition, definition.klass as KClass) +//package fledware.ecs.definitions.instantiator +// +//import fledware.definitions.instantiator.ReflectInstantiator +//import kotlin.reflect.KClass +// +// +//@Suppress("UNCHECKED_CAST") +//abstract class SystemInstantiator( +// factoryName: String, +// instantiatorName: String, +// instantiating: KClass, +//) : ReflectInstantiator(factoryName, instantiatorName, instantiating) diff --git a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/WorldInstantiator.kt b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/WorldInstantiator.kt index 8a37c16..536fb98 100644 --- a/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/WorldInstantiator.kt +++ b/definitions-ecs/src/main/kotlin/fledware/ecs/definitions/instantiator/WorldInstantiator.kt @@ -1,77 +1,77 @@ -package fledware.ecs.definitions.instantiator - -import fledware.definitions.DefinitionInstantiator -import fledware.definitions.DefinitionsManager -import fledware.definitions.builtin.functionDefinitions -import fledware.definitions.ex.walk -import fledware.ecs.definitions.EntityInstance -import fledware.ecs.definitions.WorldDefinition -import fledware.ecs.definitions.componentLifecycleName -import fledware.ecs.definitions.entityLifecycleName -import fledware.ecs.definitions.systemLifecycleName -import fledware.ecs.definitions.worldDefinitions - -abstract class WorldInstantiator( - final override val definition: WorldDefinition, - protected val manager: DefinitionsManager -) : DefinitionInstantiator { - - val systems: Map> = buildMap { - manager.worldDefinitions.walk(definition.defName) { - definition.systems.forEach { systemName -> - this.computeIfAbsent(systemName) { systemInstantiator(manager, systemName) } - } - definition.extends - } - } - - val decoratorFunctions = definition.decoratorFunctions.map { manager.functionDefinitions[it] } - val initFunction = definition.initFunction?.let { manager.functionDefinitions[it] } - - - val componentInstantiators: Map> - val defaultContextValues: Map> - init { - val defaultComponentValues: Map> = buildMap { - manager.worldDefinitions.walk(definition.defName) { - it.contexts.forEach { (name, args) -> - this[name] = args + this.getOrDefault(name, emptyMap()) - } - it.extends - } - } - componentInstantiators = buildMap { - defaultComponentValues.keys.forEach { componentName -> - this[componentName] = componentInstantiator(manager, componentName) - } - } - this.defaultContextValues = defaultComponentValues.mapValues { (name, values) -> - val component = componentInstantiators[name]!! - component.ensureParameterTypes(values) - } - } - - val entityInstantiators = mutableMapOf>() - val entities = mutableListOf() - init { - manager.worldDefinitions.walk(definition.defName) { - it.entities.forEach { entity -> - entityInstantiators.computeIfAbsent(entity.type) { entityInstantiator(manager, entity.type) } - entities.add(entity) - } - it.extends - } - } - - @Suppress("UNCHECKED_CAST") - protected open fun componentInstantiator(manager: DefinitionsManager, type: String) = - manager.instantiator(componentLifecycleName, type) as ComponentInstantiator - - @Suppress("UNCHECKED_CAST") - protected open fun entityInstantiator(manager: DefinitionsManager, type: String) = - manager.instantiator(entityLifecycleName, type) as EntityInstantiator - - @Suppress("UNCHECKED_CAST") - protected open fun systemInstantiator(manager: DefinitionsManager, type: String) = - manager.instantiator(systemLifecycleName, type) as SystemInstantiator -} \ No newline at end of file +//package fledware.ecs.definitions.instantiator +// +//import fledware.definitions.DefinitionInstantiator +//import fledware.definitions.DefinitionsManager +//import fledware.definitions.builtin.functionDefinitions +//import fledware.definitions.ex.walk +//import fledware.ecs.definitions.EntityInstance +//import fledware.ecs.definitions.WorldDefinition +//import fledware.ecs.definitions.componentLifecycleName +//import fledware.ecs.definitions.entityLifecycleName +//import fledware.ecs.definitions.systemLifecycleName +//import fledware.ecs.definitions.worldDefinitions +// +//abstract class WorldInstantiator( +// final override val definition: WorldDefinition, +// protected val manager: DefinitionsManager +//) : DefinitionInstantiator { +// +// val systems: Map> = buildMap { +// manager.worldDefinitions.walk(definition.defName) { +// definition.systems.forEach { systemName -> +// this.computeIfAbsent(systemName) { systemInstantiator(manager, systemName) } +// } +// definition.extends +// } +// } +// +// val decoratorFunctions = definition.decoratorFunctions.map { manager.functionDefinitions[it] } +// val initFunction = definition.initFunction?.let { manager.functionDefinitions[it] } +// +// +// val componentInstantiators: Map> +// val defaultContextValues: Map> +// init { +// val defaultComponentValues: Map> = buildMap { +// manager.worldDefinitions.walk(definition.defName) { +// it.contexts.forEach { (name, args) -> +// this[name] = args + this.getOrDefault(name, emptyMap()) +// } +// it.extends +// } +// } +// componentInstantiators = buildMap { +// defaultComponentValues.keys.forEach { componentName -> +// this[componentName] = componentInstantiator(manager, componentName) +// } +// } +// this.defaultContextValues = defaultComponentValues.mapValues { (name, values) -> +// val component = componentInstantiators[name]!! +// component.ensureParameterTypes(values) +// } +// } +// +// val entityInstantiators = mutableMapOf>() +// val entities = mutableListOf() +// init { +// manager.worldDefinitions.walk(definition.defName) { +// it.entities.forEach { entity -> +// entityInstantiators.computeIfAbsent(entity.type) { entityInstantiator(manager, entity.type) } +// entities.add(entity) +// } +// it.extends +// } +// } +// +// @Suppress("UNCHECKED_CAST") +// protected open fun componentInstantiator(manager: DefinitionsManager, type: String) = +// manager.instantiator(componentLifecycleName, type) as ComponentInstantiator +// +// @Suppress("UNCHECKED_CAST") +// protected open fun entityInstantiator(manager: DefinitionsManager, type: String) = +// manager.instantiator(entityLifecycleName, type) as EntityInstantiator +// +// @Suppress("UNCHECKED_CAST") +// protected open fun systemInstantiator(manager: DefinitionsManager, type: String) = +// manager.instantiator(systemLifecycleName, type) as SystemInstantiator +//} \ No newline at end of file diff --git a/definitions-ecs/src/test/kotlin/fledware/ecs/definitions/BasicLoadingTest.kt b/definitions-ecs/src/test/kotlin/fledware/ecs/definitions/BasicLoadingTest.kt index bf7f7ac..9422370 100644 --- a/definitions-ecs/src/test/kotlin/fledware/ecs/definitions/BasicLoadingTest.kt +++ b/definitions-ecs/src/test/kotlin/fledware/ecs/definitions/BasicLoadingTest.kt @@ -1,36 +1,42 @@ package fledware.ecs.definitions -import fledware.definitions.tests.manager -import fledware.definitions.tests.testJarPath +import fledware.definitions.builder.std.defaultBuilder +import fledware.definitions.tests.testJarFile import kotlin.test.Test import kotlin.test.assertEquals // TODO: test actual values class BasicLoadingTest { @Test - fun loadingTest() = manager( - lifecycles = listOf(entityLifecycle(), sceneLifecycle(), worldLifecycle()), - "ecs-loading".testJarPath.absolutePath - ) { manager -> - assertEquals(setOf("/map", "/person", "/coolguy", "/coolguy2"), - manager.entityDefinitions.definitions.keys) - assertEquals(setOf("/two-person"), - manager.sceneDefinitions.definitions.keys) - assertEquals(setOf("/empty-scene", "/main"), - manager.worldDefinitions.definitions.keys) + fun loadingTest() { + val builder = defaultBuilder() + .withEcsEntities() + .withEcsScenes() + .withEcsWorlds() + .create() + builder.withModPackage("ecs-loading".testJarFile.absolutePath) + assertEquals(setOf("map", "person", "coolguy", "coolguy2"), + builder.state.entityDefinitions.definitions.keys) + assertEquals(setOf("two-person"), + builder.state.sceneDefinitions.definitions.keys) + assertEquals(setOf("empty-scene", "main"), + builder.state.worldDefinitions.definitions.keys) } @Test - fun loadingOverrideTest() = manager( - lifecycles = listOf(entityLifecycle(), sceneLifecycle(), worldLifecycle()), - "ecs-loading".testJarPath.absolutePath, - "ecs-loading-override".testJarPath.absolutePath - ) { manager -> - assertEquals(setOf("/map", "/person", "/coolguy", "/coolguy2"), - manager.entityDefinitions.definitions.keys) - assertEquals(setOf("/two-person", "/three-person"), - manager.sceneDefinitions.definitions.keys) - assertEquals(setOf("/empty-scene", "/main"), - manager.worldDefinitions.definitions.keys) + fun loadingOverrideTest() { + val builder = defaultBuilder() + .withEcsEntities() + .withEcsScenes() + .withEcsWorlds() + .create() + builder.withModPackage("ecs-loading".testJarFile.absolutePath) + builder.withModPackage("ecs-loading-override".testJarFile.absolutePath) + assertEquals(setOf("map", "person", "coolguy", "coolguy2"), + builder.state.entityDefinitions.definitions.keys) + assertEquals(setOf("two-person", "three-person"), + builder.state.sceneDefinitions.definitions.keys) + assertEquals(setOf("empty-scene", "main"), + builder.state.worldDefinitions.definitions.keys) } } \ No newline at end of file diff --git a/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/EntityTest.kt b/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/EntityTest.kt index 9f251aa..b9a99c7 100644 --- a/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/EntityTest.kt +++ b/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/EntityTest.kt @@ -1,16 +1,13 @@ package fledware.ecs.definitions.test -import fledware.definitions.DefinitionException -import fledware.definitions.util.DefinitionReflectionException +import fledware.definitions.exceptions.DefinitionException +import fledware.definitions.exceptions.DefinitionReflectionException import fledware.definitions.util.ReflectCallerState import fledware.definitions.util.safeGet -import fledware.ecs.definitions.entityDefinitions -import fledware.ecs.definitions.instantiator.ComponentArgument -import fledware.ecs.definitions.instantiator.EntityInstantiator +import fledware.ecs.definitions.ComponentArgument import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertFailsWith -import kotlin.test.assertNull abstract class EntityTest { @@ -18,7 +15,7 @@ abstract class EntityTest { @Test fun canCreatePersonEntityWithArgs() = testCreatedPersonEntity { - entityInstantiator("/person").createWithArgs(listOf( + entityInstantiator("person").createWithArgs(listOf( ComponentArgument("placement", "x", 1), ComponentArgument("placement", "y", 2), ComponentArgument("placement", "size", 3) @@ -27,7 +24,7 @@ abstract class EntityTest { @Test fun canCreatePersonEntityWithMap() = testCreatedPersonEntity { - entityInstantiator("/person").createWithNames(mapOf( + entityInstantiator("person").createWithNames(mapOf( "placement" to mapOf( "x" to 1, "y" to 2, @@ -40,18 +37,17 @@ abstract class EntityTest { val driver = createDriver() val placementClass = driver.componentClass("placement") val entity = driver.block() - assertEquals("/person", driver.entityDefinitionType(entity)) + assertEquals("person", driver.entityDefinitionType(entity)) assertEquals(1, driver.entityComponent(entity, placementClass).safeGet("x")) assertEquals(2, driver.entityComponent(entity, placementClass).safeGet("y")) assertEquals(3, driver.entityComponent(entity, placementClass).safeGet("size")) } - @Test fun throwsOnMissingIncorrectNamesType() { val driver = createDriver() - val entityInstantiator = driver.entityInstantiator("/person") + val entityInstantiator = driver.entityInstantiator("person") val exception = assertFailsWith { entityInstantiator.createWithNames(mapOf("placement" to mapOf("size" to "big!", "x" to 4, "y" to 4))) } as DefinitionReflectionException @@ -61,7 +57,7 @@ abstract class EntityTest { @Test fun throwsOnMissingIncorrectArgumentType() { val driver = createDriver() - val entityInstantiator = driver.entityInstantiator("/person") + val entityInstantiator = driver.entityInstantiator("person") val exception = assertFailsWith { entityInstantiator.createWithArgs(listOf( ComponentArgument("placement", "x", 4), @@ -73,7 +69,7 @@ abstract class EntityTest { } private fun assertMissingPlacementException(exception: DefinitionReflectionException) { - assertEquals("placement", exception.definition?.defName) + assertEquals("components/placement", exception.definition) assertEquals(ReflectCallerState.Valid, exception.arguments["x"]?.state) assertEquals(ReflectCallerState.Valid, exception.arguments["y"]?.state) assertEquals(ReflectCallerState.InvalidType, exception.arguments["size"]?.state) @@ -84,24 +80,24 @@ abstract class EntityTest { @Test fun entityCanExtendAnotherEntity() { val driver = createDriver() - val person = driver.entityInstantiator("/person") - assertNull(person.definition.extends) + val person = driver.entityInstantiator("person") +// assertNull(person.definition.extends) assertEquals(mapOf( "placement" to mapOf(), "movement" to mapOf("deltaX" to 0, "deltaY" to 0), "health" to mapOf("health" to 5) ), person.defaultComponentValues) - val coolguy = driver.entityInstantiator("/coolguy") - assertEquals("/person", coolguy.definition.extends) + val coolguy = driver.entityInstantiator("coolguy") +// assertEquals("/person", coolguy.definition.extends) assertEquals(mapOf( "placement" to mapOf(), "movement" to mapOf("deltaX" to 0, "deltaY" to 0), "health" to mapOf("health" to 10) ), coolguy.defaultComponentValues) - val coolguy2 = driver.entityInstantiator("/coolguy2") - assertEquals("/coolguy", coolguy2.definition.extends) + val coolguy2 = driver.entityInstantiator("coolguy2") +// assertEquals("/coolguy", coolguy2.definition.extends) assertEquals(mapOf( "placement" to mapOf(), "movement" to mapOf("deltaX" to 1, "deltaY" to 1), diff --git a/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/SceneTest.kt b/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/SceneTest.kt index 718c3b3..83501bd 100644 --- a/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/SceneTest.kt +++ b/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/SceneTest.kt @@ -13,7 +13,7 @@ abstract class SceneTest { assertEquals(0, driver.entities.size) assertEquals(0, driver.systems.size) - driver.decorateWithWorld("/empty-scene") + driver.decorateWithWorld("empty-scene") assertEquals(0, driver.entities.size) assertEquals(2, driver.systems.size) } @@ -21,7 +21,7 @@ abstract class SceneTest { @Test fun canCreateSceneObject() { val driver = createDriver() - val sceneInstantiator = driver.sceneInstantiator("/two-person") + val sceneInstantiator = driver.sceneInstantiator("two-person") val scene = sceneInstantiator.create() assertNotNull(scene) } @@ -29,8 +29,8 @@ abstract class SceneTest { @Test fun canLoadDefinedScene() { val driver = createDriver() - driver.decorateWithWorld("/empty-scene") - driver.decorateWithScene("/two-person") + driver.decorateWithWorld("empty-scene") + driver.decorateWithScene("two-person") assertEquals(3, driver.entities.size) assertEquals(2, driver.systems.size) } diff --git a/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/SystemTest.kt b/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/SystemTest.kt index 99a3679..22662d3 100644 --- a/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/SystemTest.kt +++ b/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/SystemTest.kt @@ -16,7 +16,7 @@ abstract class SystemTest { val placementClass = driver.componentClass("placement") val movementClass = driver.componentClass("movement") - driver.decorateWithWorld("/main") + driver.decorateWithWorld("main") val entity1 = driver.entities.first { driver.entityComponentOrNull(it, placementClass)?.safeGet("x") == 1 } val entity8 = driver.entities.first { driver.entityComponentOrNull(it, placementClass)?.safeGet("x") == 8 } @@ -50,7 +50,7 @@ abstract class SystemTest { val placementClass = driver.componentClass("placement") val healthClass = driver.componentClass("health") - driver.decorateWithWorld("/main") + driver.decorateWithWorld("main") val entity1 = driver.entities.first { driver.entityComponentOrNull(it, placementClass)?.safeGet("x") == 1 } assertTrue(entity1 in driver.entities) diff --git a/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/WorldTest.kt b/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/WorldTest.kt index 25abd30..5a5521a 100644 --- a/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/WorldTest.kt +++ b/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/WorldTest.kt @@ -1,6 +1,6 @@ package fledware.ecs.definitions.test -import fledware.definitions.UnknownDefinitionException +import fledware.definitions.exceptions.UnknownDefinitionException import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertFailsWith @@ -15,7 +15,7 @@ abstract class WorldTest { assertEquals(0, driver.systems.size) assertEquals(0, driver.entities.size) driver.update() - driver.decorateWithWorld("/main") + driver.decorateWithWorld("main") assertEquals(2, driver.systems.size) assertEquals(3, driver.entities.size) driver.update() @@ -25,9 +25,9 @@ abstract class WorldTest { fun throwsOnUnknownWorld() { val driver = createDriver() val exception = assertFailsWith { - driver.decorateWithWorld("/unknown-world") + driver.decorateWithWorld("unknown-world") } - assertEquals("unknown definition /unknown-world for world", exception.message) + assertEquals("unknown definition unknown-world for worlds", exception.message) } } \ No newline at end of file diff --git a/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/driver.kt b/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/driver.kt index c295df0..0edc401 100644 --- a/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/driver.kt +++ b/definitions-ecs/src/testFixtures/kotlin/fledware/ecs/definitions/test/driver.kt @@ -1,10 +1,11 @@ package fledware.ecs.definitions.test import fledware.definitions.DefinitionsManager -import fledware.definitions.lifecycle.BasicClassDefinition -import fledware.ecs.definitions.componentLifecycleName -import fledware.ecs.definitions.instantiator.EntityInstantiator -import fledware.ecs.definitions.instantiator.SceneInstantiator +import fledware.definitions.builder.registries.AnnotatedClassDefinition +import fledware.definitions.findRegistryOf +import fledware.ecs.definitions.EntityInstantiator +import fledware.ecs.definitions.SceneInstantiator +import fledware.ecs.definitions.ecsComponentsRegistryName import kotlin.reflect.KClass /** @@ -18,17 +19,17 @@ interface ManagerDriver { fun componentClass(name: String): KClass { val definition = manager - .registry(componentLifecycleName) - .definitions[name] as BasicClassDefinition<*> + .findRegistryOf(ecsComponentsRegistryName) + .definitions[name] as AnnotatedClassDefinition<*> return definition.klass } - fun entityInstantiator(type: String): EntityInstantiator + fun entityInstantiator(type: String): EntityInstantiator fun entityComponent(entity: Any, type: KClass): Any fun entityComponentOrNull(entity: Any, type: KClass): Any? fun entityDefinitionType(entity: Any): String - fun sceneInstantiator(type: String): SceneInstantiator + fun sceneInstantiator(type: String): SceneInstantiator fun decorateWithScene(type: String) fun decorateWithWorld(type: String) diff --git a/definitions-libgdx/build.gradle b/definitions-libgdx/build.gradle index 10b5f69..69fc9a5 100644 --- a/definitions-libgdx/build.gradle +++ b/definitions-libgdx/build.gradle @@ -1,13 +1,10 @@ dependencies { - implementation project(':definitions') + implementation project(':definitions-builder') api "com.badlogicgames.gdx:gdx:$gdxVersion" api "com.badlogicgames.gdx:gdx-freetype:$gdxVersion" - testImplementation "io.fledware:fledecs:$fledEcsVersion" - testImplementation project(":definitions-ecs") - - testFixturesApi testFixtures(project(":definitions")) + testFixturesApi testFixtures(project(":definitions-builder")) testFixturesApi "com.badlogicgames.gdx:gdx:$gdxVersion" testFixturesApi "com.badlogicgames.gdx:gdx-freetype:$gdxVersion" testFixturesApi "com.badlogicgames.gdx:gdx-backend-headless:$gdxVersion" @@ -20,5 +17,5 @@ dependencies { test { - it.dependsOn(":test-projects:simplegame:build") + it.dependsOn(":test-projects:definitions-libgdx-tests:all-resource-types:build") } \ No newline at end of file diff --git a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/AssetManager.kt b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/AssetManager.kt index 8f163e8..5e5fab8 100644 --- a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/AssetManager.kt +++ b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/AssetManager.kt @@ -1,9 +1,10 @@ package fledware.definitions.libgdx +import com.badlogic.gdx.Gdx import com.badlogic.gdx.assets.AssetDescriptor import com.badlogic.gdx.assets.AssetLoaderParameters import com.badlogic.gdx.assets.AssetManager -import com.badlogic.gdx.assets.loaders.resolvers.ClasspathFileHandleResolver +import com.badlogic.gdx.assets.loaders.FileHandleResolver import com.badlogic.gdx.files.FileHandle import com.badlogic.gdx.graphics.g2d.BitmapFont import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator @@ -12,21 +13,23 @@ import com.badlogic.gdx.graphics.g2d.freetype.FreetypeFontLoader import com.badlogic.gdx.maps.tiled.TideMapLoader import com.badlogic.gdx.maps.tiled.TiledMap import com.badlogic.gdx.maps.tiled.TmxMapLoader -import fledware.definitions.DefinitionsBuilder +import fledware.definitions.DefinitionRegistry import fledware.definitions.DefinitionsManager -import fledware.definitions.reader.RawDefinitionReader -import fledware.definitions.reader.findEntryOrNull +import fledware.definitions.builder.DefinitionsBuilderFactory +import fledware.definitions.builder.mod.ModPackageContext +import fledware.definitions.builder.mod.findEntryOrNull +import fledware.definitions.builder.mod.readEntry +import fledware.utilities.get +import java.io.File import kotlin.reflect.KClass -import kotlin.reflect.full.isSubclassOf /** * a common way of finding params to be loaded by the AssetManager */ -fun RawDefinitionReader.findParametersOrNull(entry: String, paramClass: KClass): T? { - val paramEntry = findEntryOrNull("$entry.params") ?: return null - val serializer = serialization.figureSerializer(paramEntry) - return serializer.readValue(read(paramEntry), paramClass.java) +fun ModPackageContext.findParametersOrNull(entry: String, paramClass: KClass): T? { + val entryParams = this.findEntryOrNull("$entry.params") ?: return null + return this.readEntry(entryParams, paramClass) } /** @@ -40,7 +43,7 @@ fun RawDefinitionReader.findParametersOrNull(entry: String, paramClass * @return a new asset manager that is able to load defined assets. */ fun createAssetManager(): AssetManager { - val resolver = ClasspathFileHandleResolver() + val resolver = DefinitionsFileHandleResolver() val result = AssetManager(resolver) result.setLoader(TiledMap::class.java, ".tmx", TmxMapLoader(resolver)) result.setLoader(TiledMap::class.java, ".tide", TideMapLoader(resolver)) @@ -50,39 +53,43 @@ fun createAssetManager(): AssetManager { } /** - * Adds the [assetManager] to [DefinitionsBuilder.contexts] and returns - * this [DefinitionsBuilder]. This will also result in the built [DefinitionsManager] + * Adds the [assetManager] to [DefinitionsBuilderFactory.contexts] and returns + * this [DefinitionsBuilderFactory]. This will also result in the built [DefinitionsManager] * to have the same [assetManager] instance. */ -fun DefinitionsBuilder.withAssetManager( +fun DefinitionsBuilderFactory.withAssetManager( assetManager: AssetManager = createAssetManager() -): DefinitionsBuilder { - this.contexts.add(assetManager) +): DefinitionsBuilderFactory { + this.withContext(assetManager) return this } /** * loads all definitions to the given [assetManager] */ -fun DefinitionsManager.loadAll(assetManager: AssetManager) { - registries.values.forEach { registry -> - val type = registry.lifecycle.definition.type - if (type.isSubclassOf(LibGdxDefinition::class)) { - registry.definitions.values.forEach { - assetManager.load((it as LibGdxDefinition<*>).assetDescriptor) - } +fun DefinitionsManager.loadAllAssets(assetManager: AssetManager = this.contexts.get()) { + fun DefinitionRegistry.attemptLoad() { + definitions.values.forEach { + val definition = it as? LibGdxDefinition<*> ?: return + assetManager.load(definition.assetDescriptor) } } + registries.values.forEach { it.attemptLoad() } } /** - * convenience method for creating a descriptor + * convenience method for creating an [AssetDescriptor] */ inline fun descriptor(file: FileHandle, params: AssetLoaderParameters? = null) = AssetDescriptor(file, A::class.java, params) /** - * convenience method for creating a descriptor + * */ -inline fun descriptor(file: String, params: AssetLoaderParameters? = null) = - AssetDescriptor(file, A::class.java, params) +class DefinitionsFileHandleResolver : FileHandleResolver { + override fun resolve(fileName: String): FileHandle { + if (File(fileName).exists()) + return Gdx.files.absolute(fileName) + return Gdx.files.classpath(fileName) + } +} diff --git a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/DefinitionAssetDescriptor.kt b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/DefinitionAssetDescriptor.kt new file mode 100644 index 0000000..a36873e --- /dev/null +++ b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/DefinitionAssetDescriptor.kt @@ -0,0 +1,12 @@ +package fledware.definitions.libgdx + +import com.badlogic.gdx.assets.AssetDescriptor +import com.badlogic.gdx.assets.AssetLoaderParameters +import com.badlogic.gdx.files.FileHandle + +class DefinitionAssetDescriptor( + file: FileHandle, + type: Class, + params: AssetLoaderParameters? = null +) : AssetDescriptor(file, type, params) { +} \ No newline at end of file diff --git a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/LibGdxDefinition.kt b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/LibGdxDefinition.kt index 4ae2623..1688d60 100644 --- a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/LibGdxDefinition.kt +++ b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/LibGdxDefinition.kt @@ -1,7 +1,6 @@ package fledware.definitions.libgdx import com.badlogic.gdx.assets.AssetDescriptor -import fledware.definitions.Definition /** * The DefinitionsManager is not an asset lifecycle handler. @@ -9,7 +8,12 @@ import fledware.definitions.Definition * to instantiate those things. For this reason, we do not actually * load any assets into memory. */ -interface LibGdxDefinition : Definition { +interface LibGdxDefinition { + /** + * the AssetDescriptor that can be used for working + * with an AssetManager + */ + val assetDescriptor: AssetDescriptor /** * gets a new asset for this definition. * @@ -20,10 +24,4 @@ interface LibGdxDefinition : Definition { * parameters will not be respected. */ fun getNew(): T - - /** - * the AssetDescriptor that can be used for working - * with an AssetManager - */ - val assetDescriptor: AssetDescriptor } diff --git a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/LibGdxFiles.kt b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/LibGdxFiles.kt index 5315ba3..5b2c11c 100644 --- a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/LibGdxFiles.kt +++ b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/LibGdxFiles.kt @@ -6,17 +6,21 @@ import com.badlogic.gdx.Files import com.badlogic.gdx.Gdx import com.badlogic.gdx.files.FileHandle import com.badlogic.gdx.utils.GdxRuntimeException -import fledware.definitions.DefinitionsBuilder -import fledware.definitions.reader.RawDefinitionReader -import fledware.definitions.registry.DefaultDefinitionsBuilder +import fledware.definitions.builder.DefinitionsBuilder +import fledware.definitions.builder.mod.ModPackageContext +import fledware.definitions.builder.mod.packages.DirectoryModPackage +import fledware.definitions.builder.mod.packages.JarModPackage import java.io.File import java.io.InputStream import java.net.URL -/** - * Tries to find a full-featured FileHandle - */ -fun RawDefinitionReader.fileHandle(entry: String): FileHandle = Gdx.files.classpath(entry) +fun ModPackageContext.fileHandle(entry: String): FileHandle { + return when (this.modPackage) { + is DirectoryModPackage -> Gdx.files.absolute(File(this.modPackage.root.path, entry).canonicalPath) + is JarModPackage -> Gdx.files.classpath(entry) + else -> throw IllegalStateException("unable to find GDX file handle for ${this.modPackage}") + } +} /** * must be called if files are to be read from archives by libgdx. @@ -25,8 +29,7 @@ fun RawDefinitionReader.fileHandle(entry: String): FileHandle = Gdx.files.classp * but before any gather methods are called on this builder. */ fun DefinitionsBuilder.setupLibGdxFilesWrapper() { - val wrapper = (this as DefaultDefinitionsBuilder).classLoaderWrapper - Gdx.files = LibGdxFilesWrapper(wrapper::currentLoader, Gdx.files) + Gdx.files = LibGdxFilesWrapper(this.state.classLoaderWrapper::currentLoader, Gdx.files) } /** diff --git a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/LibGdxModEntryHandler.kt b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/LibGdxModEntryHandler.kt new file mode 100644 index 0000000..8eb90fd --- /dev/null +++ b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/LibGdxModEntryHandler.kt @@ -0,0 +1,65 @@ +package fledware.definitions.libgdx + +import com.badlogic.gdx.files.FileHandle +import fledware.definitions.builder.AbstractBuilderHandler +import fledware.definitions.builder.DefinitionRegistryBuilder +import fledware.definitions.builder.findRegistry +import fledware.definitions.builder.mod.ModPackageContext +import fledware.definitions.builder.mod.ModPackageEntry +import fledware.definitions.builder.mod.entries.ResourceEntry +import fledware.definitions.builder.processors.definitionModEntryProcessorName +import fledware.definitions.builder.processors.entries.ModEntryHandler +import fledware.definitions.builder.processors.entries.findResourceOrNull +import fledware.definitions.util.removePrefixAndExtension +import kotlin.reflect.KClass + +/** + * a basic entry handler for a LibGdx entry. + * + * This will attempt to find the basic information of a [ResourceEntry] + * with the given [gatherRegex]. It will also try to find parameters + * of the given entry. see [findParametersOrNull]. + * + * @param T the libgdx specific type + * @param + */ +abstract class LibGdxModEntryHandler>( + private val directoryPrefix: String, + private val gatherRegex: Regex, + private val targetRegistry: String, + private val parameterType: KClass

? +) : AbstractBuilderHandler(), ModEntryHandler { + override val processor: String + get() = definitionModEntryProcessorName + + protected abstract fun factoryDefinition(context: ModPackageContext, + entry: ResourceEntry, + entryName: String, + entryFile: FileHandle, + parameters: P?): D + + protected open fun apply(target: DefinitionRegistryBuilder, + entry: ResourceEntry, + entryName: String, + definition: D) { + target.apply(entryName, entry, definition) + } + + protected open fun readParameters(context: ModPackageContext, entry: ResourceEntry): P? { + if (parameterType == null) + return null + return context.findParametersOrNull(entry.path, parameterType) + } + + override fun processMaybe(context: ModPackageContext, anyEntry: ModPackageEntry): Boolean { + val entry = anyEntry.findResourceOrNull(gatherRegex) ?: return false + val entryFile = context.fileHandle(entry.path) + val entryName = entry.path.removePrefixAndExtension(directoryPrefix) + val parameters = readParameters(context, entry) + + val definition = factoryDefinition(context, entry, entryName, entryFile, parameters) + val target = context.builderState.findRegistry(targetRegistry) + apply(target, entry, entryName, definition) + return true + } +} \ No newline at end of file diff --git a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/LibGdxSimpleLifecycle.kt b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/LibGdxSimpleLifecycle.kt index c64205a..55a1a40 100644 --- a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/LibGdxSimpleLifecycle.kt +++ b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/LibGdxSimpleLifecycle.kt @@ -1,61 +1,61 @@ -package fledware.definitions.libgdx - -import fledware.definitions.Definition -import fledware.definitions.DefinitionLifecycle -import fledware.definitions.DefinitionInstantiationLifecycle -import fledware.definitions.Lifecycle -import fledware.definitions.RawDefinitionLifecycle -import fledware.definitions.ResourceSelectionInfo -import fledware.definitions.SelectionInfo -import fledware.definitions.SimpleDefinitionLifecycle -import fledware.definitions.SimpleRawDefinitionLifecycle -import fledware.definitions.processor.RawDefinitionAggregator -import fledware.definitions.reader.RawDefinitionReader -import fledware.definitions.reader.removePrefixAndExtension -import fledware.definitions.registry.SimpleDefinitionRegistry -import fledware.utilities.globToRegex -import kotlin.reflect.KClass - -abstract class LibGdxSimpleLifecycle : Lifecycle { - - abstract val directory: String - abstract val rawDefinitionType: KClass - abstract val definitionType: KClass - abstract val parameterType: KClass

? - abstract val extensions: String - val entryRegex by lazy { "$directory/**.$extensions".globToRegex() } - - abstract fun gatherHit(reader: RawDefinitionReader, entry: String, name: String, parameters: P?): R - abstract fun gatherResult(name: String, final: R): D - - override val rawDefinition: RawDefinitionLifecycle by lazy { - SimpleRawDefinitionLifecycle(rawDefinitionType) { Processor() } - } - - override val definition: DefinitionLifecycle by lazy { - SimpleDefinitionLifecycle(definitionType) { - check(it != null) - @Suppress("UNCHECKED_CAST") - val definitions = it.definitions as Map - @Suppress("UNCHECKED_CAST") - val ordered = it.orderedDefinitions as List - SimpleDefinitionRegistry(definitions, ordered, it.fromDefinitions) - } - } - - override val instantiated = DefinitionInstantiationLifecycle() - - protected inner class Processor : RawDefinitionAggregator() { - override fun process(reader: RawDefinitionReader, info: SelectionInfo): Boolean { - val resource = info as? ResourceSelectionInfo ?: return false - if (!entryRegex.matches(resource.entry)) return false - val name = resource.entry.removePrefixAndExtension(directory) - val parameters = parameterType?.let { reader.findParametersOrNull(resource.entry, it) } - val raw = gatherHit(reader, resource.entry, name, parameters) - apply(name, resource.from, raw) - return true - } - - override fun result(name: String, final: R): D = gatherResult(name, final) - } -} +//package fledware.definitions.libgdx +// +//import fledware.definitions.Definition +//import fledware.definitions.DefinitionLifecycle +//import fledware.definitions.DefinitionInstantiationLifecycle +//import fledware.definitions.Lifecycle +//import fledware.definitions.RawDefinitionLifecycle +//import fledware.definitions.ResourceSelectionInfo +//import fledware.definitions.SelectionInfo +//import fledware.definitions.SimpleDefinitionLifecycle +//import fledware.definitions.SimpleRawDefinitionLifecycle +//import fledware.definitions.processor.RawDefinitionAggregator +//import fledware.definitions.reader.RawDefinitionReader +//import fledware.definitions.reader.removePrefixAndExtension +//import fledware.definitions.registry.SimpleDefinitionRegistry +//import fledware.utilities.globToRegex +//import kotlin.reflect.KClass +// +//abstract class LibGdxSimpleLifecycle> : Lifecycle { +// +// abstract val directory: String +// abstract val rawDefinitionType: KClass +// abstract val definitionType: KClass +// abstract val parameterType: KClass

? +// abstract val extensions: String +// val entryRegex by lazy { "$directory/**.$extensions".globToRegex() } +// +// abstract fun gatherHit(reader: RawDefinitionReader, entry: String, name: String, parameters: P?): R +// abstract fun gatherResult(name: String, final: R): D +// +// override val rawDefinition: RawDefinitionLifecycle by lazy { +// SimpleRawDefinitionLifecycle(rawDefinitionType) { Processor() } +// } +// +// override val definition: DefinitionLifecycle by lazy { +// SimpleDefinitionLifecycle(definitionType) { +// check(it != null) +// @Suppress("UNCHECKED_CAST") +// val definitions = it.definitions as Map +// @Suppress("UNCHECKED_CAST") +// val ordered = it.orderedDefinitions as List +// SimpleDefinitionRegistry(definitions, ordered, it.fromDefinitions) +// } +// } +// +// override val instantiated = DefinitionInstantiationLifecycle() +// +// protected inner class Processor : RawDefinitionAggregator() { +// override fun process(reader: RawDefinitionReader, info: SelectionInfo): Boolean { +// val resource = info as? ResourceSelectionInfo ?: return false +// if (!entryRegex.matches(resource.entry)) return false +// val name = resource.entry.removePrefixAndExtension(directory) +// val parameters = parameterType?.let { reader.findParametersOrNull(resource.entry, it) } +// val raw = gatherHit(reader, resource.entry, name, parameters) +// apply(name, resource.from, raw) +// return true +// } +// +// override fun result(name: String, final: R): D = gatherResult(name, final) +// } +//} diff --git a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/LoadCommands.kt b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/LoadCommands.kt index 53bb401..ff2972d 100644 --- a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/LoadCommands.kt +++ b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/LoadCommands.kt @@ -1,26 +1,26 @@ -package fledware.definitions.libgdx - -import com.badlogic.gdx.assets.AssetManager -import fledware.definitions.ex.BlockingLoadCommand -import fledware.definitions.ex.LoadCommandState -import fledware.utilities.getOrNull -import java.util.concurrent.CountDownLatch - - -data class LoadAssetsCommand(override val name: String = "LoadAssets", - override val weight: Int = 500) : BlockingLoadCommand { - override val finished = CountDownLatch(1) - private lateinit var assetManager: AssetManager - - override fun invoke(context: LoadCommandState) { - assetManager = context.manager.contexts.getOrNull() - ?: throw IllegalStateException( - "AssetManager is required in contexts to use LoadAssetsCommand") - context.manager.loadAll(assetManager) - } - - override fun update() { - if (assetManager.update()) - finished.countDown() - } -} +//package fledware.definitions.libgdx +// +//import com.badlogic.gdx.assets.AssetManager +//import fledware.definitions.ex.BlockingLoadCommand +//import fledware.definitions.ex.LoadCommandState +//import fledware.utilities.getOrNull +//import java.util.concurrent.CountDownLatch +// +// +//data class LoadAssetsCommand(override val name: String = "LoadAssets", +// override val weight: Int = 500) : BlockingLoadCommand { +// override val finished = CountDownLatch(1) +// private lateinit var assetManager: AssetManager +// +// override fun invoke(context: LoadCommandState) { +// assetManager = context.manager.contexts.getOrNull() +// ?: throw IllegalStateException( +// "AssetManager is required in contexts to use LoadAssetsCommand") +// context.manager.loadAll(assetManager) +// } +// +// override fun update() { +// if (assetManager.update()) +// finished.countDown() +// } +//} diff --git a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/BitmapFontLifecycle.kt b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/BitmapFontLifecycle.kt index fe8b9a8..0538546 100644 --- a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/BitmapFontLifecycle.kt +++ b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/BitmapFontLifecycle.kt @@ -1,94 +1,94 @@ -package fledware.definitions.libgdx.lifecycles - -import com.badlogic.gdx.assets.AssetDescriptor -import com.badlogic.gdx.assets.loaders.BitmapFontLoader -import com.badlogic.gdx.files.FileHandle -import com.badlogic.gdx.graphics.Texture -import com.badlogic.gdx.graphics.g2d.BitmapFont -import fledware.definitions.DefinitionsManager -import fledware.definitions.libgdx.LibGdxDefinition -import fledware.definitions.libgdx.LibGdxSimpleLifecycle -import fledware.definitions.libgdx.descriptor -import fledware.definitions.libgdx.fileHandle -import fledware.definitions.reader.RawDefinitionReader -import fledware.definitions.registry.SimpleDefinitionRegistry - - -// ================================================================== +//package fledware.definitions.libgdx.lifecycles // -// definitions +//import com.badlogic.gdx.assets.AssetDescriptor +//import com.badlogic.gdx.assets.loaders.BitmapFontLoader +//import com.badlogic.gdx.files.FileHandle +//import com.badlogic.gdx.graphics.Texture +//import com.badlogic.gdx.graphics.g2d.BitmapFont +//import fledware.definitions.DefinitionsManager +//import fledware.definitions.libgdx.LibGdxDefinition +//import fledware.definitions.libgdx.LibGdxSimpleLifecycle +//import fledware.definitions.libgdx.descriptor +//import fledware.definitions.libgdx.fileHandle +//import fledware.definitions.reader.RawDefinitionReader +//import fledware.definitions.registry.SimpleDefinitionRegistry // -// ================================================================== - -data class BitmapFontDefinition(override val defName: String, - override val assetDescriptor: AssetDescriptor) - : LibGdxDefinition { - override fun getNew(): BitmapFont { - return BitmapFont(assetDescriptor.file) - } -} - -data class BitmapFontRawDefinitionParameters( - val flip: Boolean?, - val genMipMaps: Boolean?, - val minFilter: Texture.TextureFilter?, - val magFilter: Texture.TextureFilter?) { - fun toParameters(): BitmapFontLoader.BitmapFontParameter { - val result = BitmapFontLoader.BitmapFontParameter() - flip?.also { result.flip = it } - genMipMaps?.also { result.genMipMaps = it } - minFilter?.also { result.minFilter = it } - magFilter?.also { result.magFilter = it } - return result - } -} - -data class BitmapFontRawDefinition( - val file: FileHandle, - val parameters: BitmapFontRawDefinitionParameters? -) - - -// ================================================================== // -// registry +//// ================================================================== +//// +//// definitions +//// +//// ================================================================== // -// ================================================================== - -@Suppress("UNCHECKED_CAST") -val DefinitionsManager.bitmapFontDefinitions: SimpleDefinitionRegistry - get() = registry(BitmapFontLifecycle.name) as SimpleDefinitionRegistry - - -// ================================================================== +//data class BitmapFontDefinition(override val defName: String, +// override val assetDescriptor: AssetDescriptor) +// : LibGdxDefinition { +// override fun getNew(): BitmapFont { +// return BitmapFont(assetDescriptor.file) +// } +//} // -// lifecycle +//data class BitmapFontRawDefinitionParameters( +// val flip: Boolean?, +// val genMipMaps: Boolean?, +// val minFilter: Texture.TextureFilter?, +// val magFilter: Texture.TextureFilter?) { +// fun toParameters(): BitmapFontLoader.BitmapFontParameter { +// val result = BitmapFontLoader.BitmapFontParameter() +// flip?.also { result.flip = it } +// genMipMaps?.also { result.genMipMaps = it } +// minFilter?.also { result.minFilter = it } +// magFilter?.also { result.magFilter = it } +// return result +// } +//} // -// ================================================================== - -class BitmapFontLifecycle : LibGdxSimpleLifecycle< - BitmapFontRawDefinition, - BitmapFontRawDefinitionParameters, - BitmapFontDefinition>() { - companion object { - const val name = "font" - } - - override val name = BitmapFontLifecycle.name - override val directory = "fonts" - override val rawDefinitionType = BitmapFontRawDefinition::class - override val definitionType = BitmapFontDefinition::class - override val parameterType = BitmapFontRawDefinitionParameters::class - override val extensions: String = "fnt" - - override fun gatherHit(reader: RawDefinitionReader, - entry: String, - name: String, - parameters: BitmapFontRawDefinitionParameters?): BitmapFontRawDefinition { - return BitmapFontRawDefinition(reader.fileHandle(entry), parameters) - } - - override fun gatherResult(name: String, final: BitmapFontRawDefinition): BitmapFontDefinition { - return BitmapFontDefinition(name, descriptor(final.file, final.parameters?.toParameters())) - } -} +//data class BitmapFontRawDefinition( +// val file: FileHandle, +// val parameters: BitmapFontRawDefinitionParameters? +//) +// +// +//// ================================================================== +//// +//// registry +//// +//// ================================================================== +// +//@Suppress("UNCHECKED_CAST") +//val DefinitionsManager.bitmapFontDefinitions: SimpleDefinitionRegistry +// get() = registry(BitmapFontLifecycle.name) as SimpleDefinitionRegistry +// +// +//// ================================================================== +//// +//// lifecycle +//// +//// ================================================================== +// +//class BitmapFontLifecycle : LibGdxSimpleLifecycle< +// BitmapFontRawDefinition, +// BitmapFontRawDefinitionParameters, +// BitmapFontDefinition>() { +// companion object { +// const val name = "font" +// } +// +// override val name = BitmapFontLifecycle.name +// override val directory = "fonts" +// override val rawDefinitionType = BitmapFontRawDefinition::class +// override val definitionType = BitmapFontDefinition::class +// override val parameterType = BitmapFontRawDefinitionParameters::class +// override val extensions: String = "fnt" +// +// override fun gatherHit(reader: RawDefinitionReader, +// entry: String, +// name: String, +// parameters: BitmapFontRawDefinitionParameters?): BitmapFontRawDefinition { +// return BitmapFontRawDefinition(reader.fileHandle(entry), parameters) +// } +// +// override fun gatherResult(name: String, final: BitmapFontRawDefinition): BitmapFontDefinition { +// return BitmapFontDefinition(name, descriptor(final.file, final.parameters?.toParameters())) +// } +//} diff --git a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/FreeTypeFontLifecycle.kt b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/FreeTypeFontLifecycle.kt index 9e929d1..649bc30 100644 --- a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/FreeTypeFontLifecycle.kt +++ b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/FreeTypeFontLifecycle.kt @@ -1,250 +1,250 @@ -package fledware.definitions.libgdx.lifecycles - -import com.badlogic.gdx.assets.AssetDescriptor -import com.badlogic.gdx.files.FileHandle -import com.badlogic.gdx.graphics.Color -import com.badlogic.gdx.graphics.Texture -import com.badlogic.gdx.graphics.g2d.BitmapFont -import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator -import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.Hinting -import com.badlogic.gdx.graphics.g2d.freetype.FreetypeFontLoader -import com.fasterxml.jackson.core.type.TypeReference -import fledware.definitions.DefinitionLifecycle -import fledware.definitions.DefinitionsManager -import fledware.definitions.IncompleteDefinitionException -import fledware.definitions.DefinitionInstantiationLifecycle -import fledware.definitions.Lifecycle -import fledware.definitions.RawDefinitionLifecycle -import fledware.definitions.ResourceSelectionInfo -import fledware.definitions.SelectionInfo -import fledware.definitions.libgdx.LibGdxDefinition -import fledware.definitions.libgdx.descriptor -import fledware.definitions.libgdx.fileHandle -import fledware.definitions.processor.RawDefinitionAggregator -import fledware.definitions.reader.RawDefinitionReader -import fledware.definitions.reader.removePrefixAndExtension -import fledware.definitions.registry.SimpleDefinitionRegistry -import fledware.utilities.globToRegex - - -// ================================================================== -// -// definitions -// -// ================================================================== - -data class FreeTypeFontDefinition(override val defName: String, - val ttfFile: FileHandle, - override val assetDescriptor: AssetDescriptor) - : LibGdxDefinition { - override fun getNew(): BitmapFont { - val parameters = assetDescriptor.params as? FreetypeFontLoader.FreeTypeFontLoaderParameter - ?: throw IllegalStateException("parameters not found") - val generator = FreeTypeFontGenerator(ttfFile) - try { - return generator.generateFont(parameters.fontParameters) - } - finally { - generator.dispose() - } - } -} - -data class FreeTypeFontRawDefinitionParameters( - val size: Int?, - val mono: Boolean?, - val hinting: Hinting?, - val color: Color?, - val gamma: Float?, - val renderCount: Int?, - val borderWidth: Float?, - val borderColor: Color?, - val borderStraight: Boolean?, - val borderGamma: Float?, - val shadowOffsetX: Int?, - val shadowOffsetY: Int?, - val shadowColor: Color?, - val spaceX: Int?, - val spaceY: Int?, - val padTop: Int?, - val padLeft: Int?, - val padBottom: Int?, - val padRight: Int?, - val characters: String?, - val kerning: Boolean?, - val flip: Boolean?, - val genMipMaps: Boolean?, - val minFilter: Texture.TextureFilter?, - val magFilter: Texture.TextureFilter?, - val incremental: Boolean? -) { - fun toParameters(): FreeTypeFontGenerator.FreeTypeFontParameter { - val result = FreeTypeFontGenerator.FreeTypeFontParameter() - size?.also { result.size = size } - mono?.also { result.mono = mono } - hinting?.also { result.hinting = hinting } - color?.also { result.color = color } - gamma?.also { result.gamma = gamma } - renderCount?.also { result.renderCount = renderCount } - borderWidth?.also { result.borderWidth = borderWidth } - borderColor?.also { result.borderColor = borderColor } - borderStraight?.also { result.borderStraight = borderStraight } - borderGamma?.also { result.borderGamma = borderGamma } - shadowOffsetX?.also { result.shadowOffsetX = shadowOffsetX } - shadowOffsetY?.also { result.shadowOffsetY = shadowOffsetY } - shadowColor?.also { result.shadowColor = shadowColor } - spaceX?.also { result.spaceX = spaceX } - spaceY?.also { result.spaceY = spaceY } - padTop?.also { result.padTop = padTop } - padLeft?.also { result.padLeft = padLeft } - padBottom?.also { result.padBottom = padBottom } - padRight?.also { result.padRight = padRight } - characters?.also { result.characters = characters } - kerning?.also { result.kerning = kerning } - flip?.also { result.flip = flip } - genMipMaps?.also { result.genMipMaps = genMipMaps } - minFilter?.also { result.minFilter = minFilter } - magFilter?.also { result.magFilter = magFilter } - incremental?.also { result.incremental = incremental } - return result - } - - fun overrideWith(overrides: FreeTypeFontRawDefinitionParameters) = FreeTypeFontRawDefinitionParameters( - overrides.size ?: this.size, - overrides.mono ?: this.mono, - overrides.hinting ?: this.hinting, - overrides.color ?: this.color, - overrides.gamma ?: this.gamma, - overrides.renderCount ?: this.renderCount, - overrides.borderWidth ?: this.borderWidth, - overrides.borderColor ?: this.borderColor, - overrides.borderStraight ?: this.borderStraight, - overrides.borderGamma ?: this.borderGamma, - overrides.shadowOffsetX ?: this.shadowOffsetX, - overrides.shadowOffsetY ?: this.shadowOffsetY, - overrides.shadowColor ?: this.shadowColor, - overrides.spaceX ?: this.spaceX, - overrides.spaceY ?: this.spaceY, - overrides.padTop ?: this.padTop, - overrides.padLeft ?: this.padLeft, - overrides.padBottom ?: this.padBottom, - overrides.padRight ?: this.padRight, - overrides.characters ?: this.characters, - overrides.kerning ?: this.kerning, - overrides.flip ?: this.flip, - overrides.genMipMaps ?: this.genMipMaps, - overrides.minFilter ?: this.minFilter, - overrides.magFilter ?: this.magFilter, - overrides.incremental ?: this.incremental - ) -} - -data class FreeTypeFontRawDefinition( - val ttfFile: String?, - val parameters: FreeTypeFontRawDefinitionParameters? -) - - -// ================================================================== -// -// processor -// -// ================================================================== - -class FreeTypeFontDefinitionProcessor - : RawDefinitionAggregator() { - private val typeRef = object : TypeReference>() {} - private val fontFileLookups = mutableMapOf() - private val ttfRegex = "fonts/**.ttf".globToRegex() - private val ttfParamsRegex = "fonts/**.ttf.params.*".globToRegex() - - /** - * the gather algorithm is a little difficult here because the param file - * and the ttf file can be overloaded separately. This allows definitions - * to override specific values for just a single font or override an - * entire ttf without changing any of the defined params. - * - * It should also be pointed out that if two params have the same name - * in different ttf file params, that will cause an override. - */ - override fun process(reader: RawDefinitionReader, info: SelectionInfo): Boolean { - val resource = info as? ResourceSelectionInfo ?: return false - when { - ttfRegex.matches(resource.entry) -> { - val fontName = resource.entry.removePrefixAndExtension("fonts") - fontFileLookups[fontName] = reader.fileHandle(resource.entry) - } - ttfParamsRegex.matches(resource.entry) -> { - val fontName = resource.entry.removePrefixAndExtension("fonts").substringBeforeLast(".ttf.params") - val serializer = serialization.figureSerializerOrNull(resource.entry) ?: return false - val fonts = serializer.readValue(reader.read(resource.entry), typeRef) - fonts.forEach { (name, params) -> - apply(name, resource.from, FreeTypeFontRawDefinition(fontName, params)) - } - } - else -> return false - } - return true - } - - override fun combine(original: FreeTypeFontRawDefinition, new: FreeTypeFontRawDefinition): FreeTypeFontRawDefinition { - val originalParams = original.parameters - val newParams = new.parameters - val parameters = when { - originalParams != null && newParams != null -> originalParams.overrideWith(newParams) - originalParams != null -> originalParams - newParams != null -> newParams - else -> null - } - return FreeTypeFontRawDefinition(new.ttfFile ?: original.ttfFile, parameters) - } - - override fun result(name: String, final: FreeTypeFontRawDefinition): FreeTypeFontDefinition { - val fontFileKey = final.ttfFile - ?: throw IncompleteDefinitionException(lifecycle.rawDefinition.type, name, "no ttf font set") - val fontFileHandle = fontFileLookups[fontFileKey] - ?: throw IncompleteDefinitionException(lifecycle.rawDefinition.type, name, "no ttf font found") - val params = FreetypeFontLoader.FreeTypeFontLoaderParameter() - params.fontFileName = fontFileHandle.path() - params.fontParameters = final.parameters?.toParameters() - ?: throw IncompleteDefinitionException(lifecycle.rawDefinition.type, name, "no font params found") - - return FreeTypeFontDefinition(name, fontFileHandle, descriptor("$name.ttf", params)) - } -} - - -// ================================================================== -// -// registry -// -// ================================================================== - -@Suppress("UNCHECKED_CAST") -val DefinitionsManager.trueTypeFontDefinitions: SimpleDefinitionRegistry - get() = registry(FreeTypeFontLifecycle.name) as SimpleDefinitionRegistry - - -// ================================================================== -// -// lifecycle -// -// ================================================================== - -class FreeTypeFontLifecycle : Lifecycle { - companion object { - const val name = "ttf" - } - - override val name = FreeTypeFontLifecycle.name - - override val rawDefinition = RawDefinitionLifecycle { - FreeTypeFontDefinitionProcessor() - } - - override val definition = DefinitionLifecycle { definitions, ordered, froms -> - SimpleDefinitionRegistry(definitions, ordered, froms) - } - - override val instantiated = DefinitionInstantiationLifecycle() -} +//package fledware.definitions.libgdx.lifecycles +// +//import com.badlogic.gdx.assets.AssetDescriptor +//import com.badlogic.gdx.files.FileHandle +//import com.badlogic.gdx.graphics.Color +//import com.badlogic.gdx.graphics.Texture +//import com.badlogic.gdx.graphics.g2d.BitmapFont +//import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator +//import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.Hinting +//import com.badlogic.gdx.graphics.g2d.freetype.FreetypeFontLoader +//import com.fasterxml.jackson.core.type.TypeReference +//import fledware.definitions.DefinitionLifecycle +//import fledware.definitions.DefinitionsManager +//import fledware.definitions.IncompleteDefinitionException +//import fledware.definitions.DefinitionInstantiationLifecycle +//import fledware.definitions.Lifecycle +//import fledware.definitions.RawDefinitionLifecycle +//import fledware.definitions.ResourceSelectionInfo +//import fledware.definitions.SelectionInfo +//import fledware.definitions.libgdx.LibGdxDefinition +//import fledware.definitions.libgdx.descriptor +//import fledware.definitions.libgdx.fileHandle +//import fledware.definitions.processor.RawDefinitionAggregator +//import fledware.definitions.reader.RawDefinitionReader +//import fledware.definitions.reader.removePrefixAndExtension +//import fledware.definitions.registry.SimpleDefinitionRegistry +//import fledware.utilities.globToRegex +// +// +//// ================================================================== +//// +//// definitions +//// +//// ================================================================== +// +//data class FreeTypeFontDefinition(override val defName: String, +// val ttfFile: FileHandle, +// override val assetDescriptor: AssetDescriptor) +// : LibGdxDefinition { +// override fun getNew(): BitmapFont { +// val parameters = assetDescriptor.params as? FreetypeFontLoader.FreeTypeFontLoaderParameter +// ?: throw IllegalStateException("parameters not found") +// val generator = FreeTypeFontGenerator(ttfFile) +// try { +// return generator.generateFont(parameters.fontParameters) +// } +// finally { +// generator.dispose() +// } +// } +//} +// +//data class FreeTypeFontRawDefinitionParameters( +// val size: Int?, +// val mono: Boolean?, +// val hinting: Hinting?, +// val color: Color?, +// val gamma: Float?, +// val renderCount: Int?, +// val borderWidth: Float?, +// val borderColor: Color?, +// val borderStraight: Boolean?, +// val borderGamma: Float?, +// val shadowOffsetX: Int?, +// val shadowOffsetY: Int?, +// val shadowColor: Color?, +// val spaceX: Int?, +// val spaceY: Int?, +// val padTop: Int?, +// val padLeft: Int?, +// val padBottom: Int?, +// val padRight: Int?, +// val characters: String?, +// val kerning: Boolean?, +// val flip: Boolean?, +// val genMipMaps: Boolean?, +// val minFilter: Texture.TextureFilter?, +// val magFilter: Texture.TextureFilter?, +// val incremental: Boolean? +//) { +// fun toParameters(): FreeTypeFontGenerator.FreeTypeFontParameter { +// val result = FreeTypeFontGenerator.FreeTypeFontParameter() +// size?.also { result.size = size } +// mono?.also { result.mono = mono } +// hinting?.also { result.hinting = hinting } +// color?.also { result.color = color } +// gamma?.also { result.gamma = gamma } +// renderCount?.also { result.renderCount = renderCount } +// borderWidth?.also { result.borderWidth = borderWidth } +// borderColor?.also { result.borderColor = borderColor } +// borderStraight?.also { result.borderStraight = borderStraight } +// borderGamma?.also { result.borderGamma = borderGamma } +// shadowOffsetX?.also { result.shadowOffsetX = shadowOffsetX } +// shadowOffsetY?.also { result.shadowOffsetY = shadowOffsetY } +// shadowColor?.also { result.shadowColor = shadowColor } +// spaceX?.also { result.spaceX = spaceX } +// spaceY?.also { result.spaceY = spaceY } +// padTop?.also { result.padTop = padTop } +// padLeft?.also { result.padLeft = padLeft } +// padBottom?.also { result.padBottom = padBottom } +// padRight?.also { result.padRight = padRight } +// characters?.also { result.characters = characters } +// kerning?.also { result.kerning = kerning } +// flip?.also { result.flip = flip } +// genMipMaps?.also { result.genMipMaps = genMipMaps } +// minFilter?.also { result.minFilter = minFilter } +// magFilter?.also { result.magFilter = magFilter } +// incremental?.also { result.incremental = incremental } +// return result +// } +// +// fun overrideWith(overrides: FreeTypeFontRawDefinitionParameters) = FreeTypeFontRawDefinitionParameters( +// overrides.size ?: this.size, +// overrides.mono ?: this.mono, +// overrides.hinting ?: this.hinting, +// overrides.color ?: this.color, +// overrides.gamma ?: this.gamma, +// overrides.renderCount ?: this.renderCount, +// overrides.borderWidth ?: this.borderWidth, +// overrides.borderColor ?: this.borderColor, +// overrides.borderStraight ?: this.borderStraight, +// overrides.borderGamma ?: this.borderGamma, +// overrides.shadowOffsetX ?: this.shadowOffsetX, +// overrides.shadowOffsetY ?: this.shadowOffsetY, +// overrides.shadowColor ?: this.shadowColor, +// overrides.spaceX ?: this.spaceX, +// overrides.spaceY ?: this.spaceY, +// overrides.padTop ?: this.padTop, +// overrides.padLeft ?: this.padLeft, +// overrides.padBottom ?: this.padBottom, +// overrides.padRight ?: this.padRight, +// overrides.characters ?: this.characters, +// overrides.kerning ?: this.kerning, +// overrides.flip ?: this.flip, +// overrides.genMipMaps ?: this.genMipMaps, +// overrides.minFilter ?: this.minFilter, +// overrides.magFilter ?: this.magFilter, +// overrides.incremental ?: this.incremental +// ) +//} +// +//data class FreeTypeFontRawDefinition( +// val ttfFile: String?, +// val parameters: FreeTypeFontRawDefinitionParameters? +//) +// +// +//// ================================================================== +//// +//// processor +//// +//// ================================================================== +// +//class FreeTypeFontDefinitionProcessor +// : RawDefinitionAggregator() { +// private val typeRef = object : TypeReference>() {} +// private val fontFileLookups = mutableMapOf() +// private val ttfRegex = "fonts/**.ttf".globToRegex() +// private val ttfParamsRegex = "fonts/**.ttf.params.*".globToRegex() +// +// /** +// * the gather algorithm is a little difficult here because the param file +// * and the ttf file can be overloaded separately. This allows definitions +// * to override specific values for just a single font or override an +// * entire ttf without changing any of the defined params. +// * +// * It should also be pointed out that if two params have the same name +// * in different ttf file params, that will cause an override. +// */ +// override fun process(reader: RawDefinitionReader, info: SelectionInfo): Boolean { +// val resource = info as? ResourceSelectionInfo ?: return false +// when { +// ttfRegex.matches(resource.entry) -> { +// val fontName = resource.entry.removePrefixAndExtension("fonts") +// fontFileLookups[fontName] = reader.fileHandle(resource.entry) +// } +// ttfParamsRegex.matches(resource.entry) -> { +// val fontName = resource.entry.removePrefixAndExtension("fonts").substringBeforeLast(".ttf.params") +// val serializer = serialization.figureSerializerOrNull(resource.entry) ?: return false +// val fonts = serializer.readValue(reader.read(resource.entry), typeRef) +// fonts.forEach { (name, params) -> +// apply(name, resource.from, FreeTypeFontRawDefinition(fontName, params)) +// } +// } +// else -> return false +// } +// return true +// } +// +// override fun combine(original: FreeTypeFontRawDefinition, new: FreeTypeFontRawDefinition): FreeTypeFontRawDefinition { +// val originalParams = original.parameters +// val newParams = new.parameters +// val parameters = when { +// originalParams != null && newParams != null -> originalParams.overrideWith(newParams) +// originalParams != null -> originalParams +// newParams != null -> newParams +// else -> null +// } +// return FreeTypeFontRawDefinition(new.ttfFile ?: original.ttfFile, parameters) +// } +// +// override fun result(name: String, final: FreeTypeFontRawDefinition): FreeTypeFontDefinition { +// val fontFileKey = final.ttfFile +// ?: throw IncompleteDefinitionException(lifecycle.rawDefinition.type, name, "no ttf font set") +// val fontFileHandle = fontFileLookups[fontFileKey] +// ?: throw IncompleteDefinitionException(lifecycle.rawDefinition.type, name, "no ttf font found") +// val params = FreetypeFontLoader.FreeTypeFontLoaderParameter() +// params.fontFileName = fontFileHandle.path() +// params.fontParameters = final.parameters?.toParameters() +// ?: throw IncompleteDefinitionException(lifecycle.rawDefinition.type, name, "no font params found") +// +// return FreeTypeFontDefinition(name, fontFileHandle, descriptor("$name.ttf", params)) +// } +//} +// +// +//// ================================================================== +//// +//// registry +//// +//// ================================================================== +// +//@Suppress("UNCHECKED_CAST") +//val DefinitionsManager.trueTypeFontDefinitions: SimpleDefinitionRegistry +// get() = registry(FreeTypeFontLifecycle.name) as SimpleDefinitionRegistry +// +// +//// ================================================================== +//// +//// lifecycle +//// +//// ================================================================== +// +//class FreeTypeFontLifecycle : Lifecycle { +// companion object { +// const val name = "ttf" +// } +// +// override val name = FreeTypeFontLifecycle.name +// +// override val rawDefinition = RawDefinitionLifecycle { +// FreeTypeFontDefinitionProcessor() +// } +// +// override val definition = DefinitionLifecycle { definitions, ordered, froms -> +// SimpleDefinitionRegistry(definitions, ordered, froms) +// } +// +// override val instantiated = DefinitionInstantiationLifecycle() +//} diff --git a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/MenuLifecycle.kt b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/MenuLifecycle.kt index a1a98d9..55e2847 100644 --- a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/MenuLifecycle.kt +++ b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/MenuLifecycle.kt @@ -1,2 +1,2 @@ -package fledware.definitions.libgdx.lifecycles - +//package fledware.definitions.libgdx.lifecycles +// diff --git a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/MusicLifecycle.kt b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/MusicLifecycle.kt index eece924..393dcc4 100644 --- a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/MusicLifecycle.kt +++ b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/MusicLifecycle.kt @@ -1,69 +1,69 @@ -package fledware.definitions.libgdx.lifecycles - -import com.badlogic.gdx.Gdx -import com.badlogic.gdx.assets.AssetDescriptor -import com.badlogic.gdx.audio.Music -import com.badlogic.gdx.files.FileHandle -import fledware.definitions.DefinitionsManager -import fledware.definitions.libgdx.LibGdxDefinition -import fledware.definitions.libgdx.LibGdxSimpleLifecycle -import fledware.definitions.libgdx.descriptor -import fledware.definitions.libgdx.fileHandle -import fledware.definitions.reader.RawDefinitionReader -import fledware.definitions.registry.SimpleDefinitionRegistry -import kotlin.reflect.KClass - - -// ================================================================== +//package fledware.definitions.libgdx.lifecycles // -// definitions +//import com.badlogic.gdx.Gdx +//import com.badlogic.gdx.assets.AssetDescriptor +//import com.badlogic.gdx.audio.Music +//import com.badlogic.gdx.files.FileHandle +//import fledware.definitions.DefinitionsManager +//import fledware.definitions.libgdx.LibGdxDefinition +//import fledware.definitions.libgdx.LibGdxSimpleLifecycle +//import fledware.definitions.libgdx.descriptor +//import fledware.definitions.libgdx.fileHandle +//import fledware.definitions.reader.RawDefinitionReader +//import fledware.definitions.registry.SimpleDefinitionRegistry +//import kotlin.reflect.KClass // -// ================================================================== - -data class MusicDefinition(override val defName: String, - override val assetDescriptor: AssetDescriptor) - : LibGdxDefinition { - override fun getNew(): Music { - return Gdx.audio.newMusic(assetDescriptor.file) - } -} - -data class MusicRawDefinition(val file: FileHandle) - - -// ================================================================== // -// registry +//// ================================================================== +//// +//// definitions +//// +//// ================================================================== // -// ================================================================== - -@Suppress("UNCHECKED_CAST") -val DefinitionsManager.musicDefinitions: SimpleDefinitionRegistry - get() = registry(MusicLifecycle.name) as SimpleDefinitionRegistry - - -// ================================================================== +//data class MusicDefinition(override val defName: String, +// override val assetDescriptor: AssetDescriptor) +// : LibGdxDefinition { +// override fun getNew(): Music { +// return Gdx.audio.newMusic(assetDescriptor.file) +// } +//} // -// lifecycle +//data class MusicRawDefinition(val file: FileHandle) // -// ================================================================== - - -class MusicLifecycle : LibGdxSimpleLifecycle() { - companion object { - const val name = "music" - } - - override val name = MusicLifecycle.name - override val directory = "music" - override val rawDefinitionType = MusicRawDefinition::class - override val definitionType = MusicDefinition::class - override val parameterType: KClass? = null - override val extensions: String = "{ogg,wav,mp3}" - - override fun gatherHit(reader: RawDefinitionReader, entry: String, name: String, parameters: Nothing?) = - MusicRawDefinition(reader.fileHandle(entry)) - - override fun gatherResult(name: String, final: MusicRawDefinition) = - MusicDefinition(name, descriptor(final.file)) -} +// +//// ================================================================== +//// +//// registry +//// +//// ================================================================== +// +//@Suppress("UNCHECKED_CAST") +//val DefinitionsManager.musicDefinitions: SimpleDefinitionRegistry +// get() = registry(MusicLifecycle.name) as SimpleDefinitionRegistry +// +// +//// ================================================================== +//// +//// lifecycle +//// +//// ================================================================== +// +// +//class MusicLifecycle : LibGdxSimpleLifecycle() { +// companion object { +// const val name = "music" +// } +// +// override val name = MusicLifecycle.name +// override val directory = "music" +// override val rawDefinitionType = MusicRawDefinition::class +// override val definitionType = MusicDefinition::class +// override val parameterType: KClass? = null +// override val extensions: String = "{ogg,wav,mp3}" +// +// override fun gatherHit(reader: RawDefinitionReader, entry: String, name: String, parameters: Nothing?) = +// MusicRawDefinition(reader.fileHandle(entry)) +// +// override fun gatherResult(name: String, final: MusicRawDefinition) = +// MusicDefinition(name, descriptor(final.file)) +//} diff --git a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/ScreenLifecycle.kt b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/ScreenLifecycle.kt index 5828236..d9914e6 100644 --- a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/ScreenLifecycle.kt +++ b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/ScreenLifecycle.kt @@ -1,71 +1,71 @@ -package fledware.definitions.libgdx.lifecycles - -import com.badlogic.gdx.Screen -import fledware.definitions.DefinitionsBuilder -import fledware.definitions.DefinitionsManager -import fledware.definitions.DefinitionInstantiationLifecycle -import fledware.definitions.RawDefinitionFrom -import fledware.definitions.RawDefinitionFromParent -import fledware.definitions.instantiator.ContextInstantiator -import fledware.definitions.lifecycle.BasicClassDefinition -import fledware.definitions.lifecycle.BasicClassProcessor -import fledware.definitions.lifecycle.ClassDefinitionRegistry -import fledware.definitions.lifecycle.classLifecycleOf -import kotlin.reflect.KClass - -/** - * - */ -@Target(AnnotationTarget.CLASS) -annotation class GdxScreen(val name: String) - -/** - * gets the [ClassDefinitionRegistry] for gdx-screens - */ -@Suppress("UNCHECKED_CAST") -val DefinitionsManager.screenDefinitions: ClassDefinitionRegistry - get() = registry(screenLifecycleName) as ClassDefinitionRegistry - -/** - * gets the [BasicClassProcessor] for gdx-screens - */ -@Suppress("UNCHECKED_CAST") -val DefinitionsBuilder.screenDefinitions: BasicClassProcessor - get() = this[screenLifecycleName] as BasicClassProcessor - -/** - * the common name for the gdx-screen lifecycle. - */ -const val screenLifecycleName = "gdx-screen" - -/** - * Creates a lifecycle for gdx-screens - */ -fun screenLifecycle() = - classLifecycleOf(screenLifecycleName, DefinitionInstantiationLifecycle> { - @Suppress("UNCHECKED_CAST") - val screenKClass = it.klass as KClass - ContextInstantiator(it, screenKClass, contexts) - }) - { _, raw -> (raw.annotation as GdxScreen).name } - -/** - * - */ -fun DefinitionsManager.gdxScreenInstantiator(type: String): ContextInstantiator, Screen> { - @Suppress("UNCHECKED_CAST") - return instantiator(screenLifecycleName, type) as ContextInstantiator, Screen> -} - -/** - * Convenience method for manually adding a gdx screen. - * - * The class must still be annotated with [GdxScreen] - */ -fun DefinitionsBuilder.addGdxScreen(klass: KClass, - from: RawDefinitionFrom? = null) { - val annotation = klass.annotations.first { it is GdxScreen } as GdxScreen - screenDefinitions.apply(annotation.name, - from ?: RawDefinitionFromParent(annotation.name), - BasicClassDefinition(klass, annotation)) -} +//package fledware.definitions.libgdx.lifecycles +// +//import com.badlogic.gdx.Screen +//import fledware.definitions.DefinitionsBuilder +//import fledware.definitions.DefinitionsManager +//import fledware.definitions.DefinitionInstantiationLifecycle +//import fledware.definitions.RawDefinitionFrom +//import fledware.definitions.RawDefinitionFromParent +//import fledware.definitions.instantiator.ContextInstantiator +//import fledware.definitions.lifecycle.BasicClassDefinition +//import fledware.definitions.lifecycle.BasicClassProcessor +//import fledware.definitions.lifecycle.ClassDefinitionRegistry +//import fledware.definitions.lifecycle.classLifecycleOf +//import kotlin.reflect.KClass +// +///** +// * +// */ +//@Target(AnnotationTarget.CLASS) +//annotation class GdxScreen(val name: String) +// +///** +// * gets the [ClassDefinitionRegistry] for gdx-screens +// */ +//@Suppress("UNCHECKED_CAST") +//val DefinitionsManager.screenDefinitions: ClassDefinitionRegistry +// get() = registry(screenLifecycleName) as ClassDefinitionRegistry +// +///** +// * gets the [BasicClassProcessor] for gdx-screens +// */ +//@Suppress("UNCHECKED_CAST") +//val DefinitionsBuilder.screenDefinitions: BasicClassProcessor +// get() = this[screenLifecycleName] as BasicClassProcessor +// +///** +// * the common name for the gdx-screen lifecycle. +// */ +//const val screenLifecycleName = "gdx-screen" +// +///** +// * Creates a lifecycle for gdx-screens +// */ +//fun screenLifecycle() = +// classLifecycleOf(screenLifecycleName, DefinitionInstantiationLifecycle> { +// @Suppress("UNCHECKED_CAST") +// val screenKClass = it.klass as KClass +// ContextInstantiator(it, screenKClass, contexts) +// }) +// { _, raw -> (raw.annotation as GdxScreen).name } +// +///** +// * +// */ +//fun DefinitionsManager.gdxScreenInstantiator(type: String): ContextInstantiator, Screen> { +// @Suppress("UNCHECKED_CAST") +// return instantiator(screenLifecycleName, type) as ContextInstantiator, Screen> +//} +// +///** +// * Convenience method for manually adding a gdx screen. +// * +// * The class must still be annotated with [GdxScreen] +// */ +//fun DefinitionsBuilder.addGdxScreen(klass: KClass, +// from: RawDefinitionFrom? = null) { +// val annotation = klass.annotations.first { it is GdxScreen } as GdxScreen +// screenDefinitions.apply(annotation.name, +// from ?: RawDefinitionFromParent(annotation.name), +// BasicClassDefinition(klass, annotation)) +//} diff --git a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/SkinLifecycle.kt b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/SkinLifecycle.kt index 6ce3e75..9b8d1d3 100644 --- a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/SkinLifecycle.kt +++ b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/SkinLifecycle.kt @@ -1,70 +1,70 @@ -package fledware.definitions.libgdx.lifecycles - -import com.badlogic.gdx.assets.AssetDescriptor -import com.badlogic.gdx.files.FileHandle -import com.badlogic.gdx.scenes.scene2d.ui.Skin -import fledware.definitions.DefinitionsManager -import fledware.definitions.reader.RawDefinitionReader -import fledware.definitions.libgdx.LibGdxDefinition -import fledware.definitions.libgdx.LibGdxSimpleLifecycle -import fledware.definitions.libgdx.fileHandle -import fledware.definitions.registry.SimpleDefinitionRegistry -import kotlin.reflect.KClass - - -// ================================================================== -// -// definitions -// -// ================================================================== - -data class SkinDefinition(override val defName: String, - override val assetDescriptor: AssetDescriptor) - : LibGdxDefinition { - override fun getNew(): Skin { - return Skin(assetDescriptor.file) - } -} - -data class SkinRawDefinition(val file: FileHandle) - - -// ================================================================== -// -// registry -// -// ================================================================== - -@Suppress("UNCHECKED_CAST") -val DefinitionsManager.skinDefinitions: SimpleDefinitionRegistry - get() = registry(SkinLifecycle.name) as SimpleDefinitionRegistry - - -// ================================================================== -// -// lifecycle -// -// ================================================================== - - -class SkinLifecycle : LibGdxSimpleLifecycle() { - companion object { - const val name = "skin" - } - - override val name = SkinLifecycle.name - override val directory = "skins" - override val rawDefinitionType = SkinRawDefinition::class - override val definitionType = SkinDefinition::class - override val parameterType: KClass? = null - override val extensions: String = "json" - - override fun gatherHit(reader: RawDefinitionReader, entry: String, name: String, parameters: Nothing?): SkinRawDefinition { - return SkinRawDefinition(reader.fileHandle(entry)) - } - - override fun gatherResult(name: String, final: SkinRawDefinition): SkinDefinition { - return SkinDefinition(name, AssetDescriptor(final.file, Skin::class.java)) - } -} - +//package fledware.definitions.libgdx.lifecycles +// +//import com.badlogic.gdx.assets.AssetDescriptor +//import com.badlogic.gdx.files.FileHandle +//import com.badlogic.gdx.scenes.scene2d.ui.Skin +//import fledware.definitions.DefinitionsManager +//import fledware.definitions.reader.RawDefinitionReader +//import fledware.definitions.libgdx.LibGdxDefinition +//import fledware.definitions.libgdx.LibGdxSimpleLifecycle +//import fledware.definitions.libgdx.fileHandle +//import fledware.definitions.registry.SimpleDefinitionRegistry +//import kotlin.reflect.KClass +// +// +//// ================================================================== +//// +//// definitions +//// +//// ================================================================== +// +//data class SkinDefinition(override val defName: String, +// override val assetDescriptor: AssetDescriptor) +// : LibGdxDefinition { +// override fun getNew(): Skin { +// return Skin(assetDescriptor.file) +// } +//} +// +//data class SkinRawDefinition(val file: FileHandle) +// +// +//// ================================================================== +//// +//// registry +//// +//// ================================================================== +// +//@Suppress("UNCHECKED_CAST") +//val DefinitionsManager.skinDefinitions: SimpleDefinitionRegistry +// get() = registry(SkinLifecycle.name) as SimpleDefinitionRegistry +// +// +//// ================================================================== +//// +//// lifecycle +//// +//// ================================================================== +// +// +//class SkinLifecycle : LibGdxSimpleLifecycle() { +// companion object { +// const val name = "skin" +// } +// +// override val name = SkinLifecycle.name +// override val directory = "skins" +// override val rawDefinitionType = SkinRawDefinition::class +// override val definitionType = SkinDefinition::class +// override val parameterType: KClass? = null +// override val extensions: String = "json" +// +// override fun gatherHit(reader: RawDefinitionReader, entry: String, name: String, parameters: Nothing?): SkinRawDefinition { +// return SkinRawDefinition(reader.fileHandle(entry)) +// } +// +// override fun gatherResult(name: String, final: SkinRawDefinition): SkinDefinition { +// return SkinDefinition(name, AssetDescriptor(final.file, Skin::class.java)) +// } +//} +// diff --git a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/SoundLifecycle.kt b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/SoundLifecycle.kt deleted file mode 100644 index ae84f68..0000000 --- a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/SoundLifecycle.kt +++ /dev/null @@ -1,70 +0,0 @@ -package fledware.definitions.libgdx.lifecycles - -import com.badlogic.gdx.Gdx -import com.badlogic.gdx.assets.AssetDescriptor -import com.badlogic.gdx.audio.Sound -import com.badlogic.gdx.files.FileHandle -import fledware.definitions.DefinitionsManager -import fledware.definitions.reader.RawDefinitionReader -import fledware.definitions.libgdx.LibGdxDefinition -import fledware.definitions.libgdx.LibGdxSimpleLifecycle -import fledware.definitions.libgdx.descriptor -import fledware.definitions.libgdx.fileHandle -import fledware.definitions.registry.SimpleDefinitionRegistry -import kotlin.reflect.KClass - - -// ================================================================== -// -// definitions -// -// ================================================================== - - -data class SoundDefinition(override val defName: String, - override val assetDescriptor: AssetDescriptor) - : LibGdxDefinition { - override fun getNew(): Sound { - return Gdx.audio.newSound(assetDescriptor.file) - } -} - -data class SoundRawDefinition(val file: FileHandle) - - -// ================================================================== -// -// registry -// -// ================================================================== - -@Suppress("UNCHECKED_CAST") -val DefinitionsManager.soundDefinitions: SimpleDefinitionRegistry - get() = registry(SoundLifecycle.name) as SimpleDefinitionRegistry - - -// ================================================================== -// -// lifecycle -// -// ================================================================== - - -class SoundLifecycle : LibGdxSimpleLifecycle() { - companion object { - const val name = "sound" - } - - override val name = SoundLifecycle.name - override val directory = "sounds" - override val rawDefinitionType = SoundRawDefinition::class - override val definitionType = SoundDefinition::class - override val parameterType: KClass? = null - override val extensions: String = "{ogg,wav,mp3}" - - override fun gatherHit(reader: RawDefinitionReader, entry: String, name: String, parameters: Nothing?) = - SoundRawDefinition(reader.fileHandle(entry)) - - override fun gatherResult(name: String, final: SoundRawDefinition) = - SoundDefinition(name, descriptor(final.file)) -} diff --git a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/TextureAtlasLifecycle.kt b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/TextureAtlasLifecycle.kt index 8d777c7..42ed3ae 100644 --- a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/TextureAtlasLifecycle.kt +++ b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/TextureAtlasLifecycle.kt @@ -1,118 +1,118 @@ -package fledware.definitions.libgdx.lifecycles - -import com.badlogic.gdx.assets.AssetDescriptor -import com.badlogic.gdx.assets.AssetManager -import com.badlogic.gdx.assets.loaders.TextureAtlasLoader -import com.badlogic.gdx.files.FileHandle -import com.badlogic.gdx.graphics.g2d.TextureAtlas -import fledware.definitions.DefinitionLifecycle -import fledware.definitions.DefinitionsManager -import fledware.definitions.RawDefinitionFrom -import fledware.definitions.libgdx.LibGdxDefinition -import fledware.definitions.libgdx.LibGdxSimpleLifecycle -import fledware.definitions.libgdx.descriptor -import fledware.definitions.libgdx.fileHandle -import fledware.definitions.reader.RawDefinitionReader -import fledware.definitions.registry.SimpleDefinitionRegistry -import fledware.utilities.getOrNull -import kotlin.collections.set - - -// ================================================================== -// -// definitions -// -// ================================================================== - -data class TextureAtlasDefinition(override val defName: String, - override val assetDescriptor: AssetDescriptor) - : LibGdxDefinition { - override fun getNew(): TextureAtlas { - return TextureAtlas(assetDescriptor.file) - } -} - -data class TextureAtlasRawDefinitionParameters(val flip: Boolean?) { - fun toParameters(): TextureAtlasLoader.TextureAtlasParameter { - val result = TextureAtlasLoader.TextureAtlasParameter() - flip?.also { result.flip = flip } - return result - } -} - -class TextureAtlasRawDefinition(val file: FileHandle, - val parameters: TextureAtlasRawDefinitionParameters?) - - -// ================================================================== -// -// registry -// -// ================================================================== - -class TextureAtlasDefinitionRegistry( - definitions: Map, - orderedDefinitions: List, - fromDefinitions: Map> -) : SimpleDefinitionRegistry(definitions, orderedDefinitions, fromDefinitions) { - private fun indexTextureRegions(): Map { - val assets = manager.contexts.getOrNull() - ?: throw IllegalStateException("AssetManager required to index atlases") - val result = mutableMapOf() - orderedDefinitions.forEach { atlasDefinition -> - val atlas = assets.get(atlasDefinition.assetDescriptor) - ?: throw IllegalStateException("All atlases must be loaded to index: $atlasDefinition") - atlas.regions.forEach { region -> - result[region.name] = region - } - } - return result - } - - private var _textureRegions: Map? = null - val textureRegions: Map - get() { - if (_textureRegions == null) - _textureRegions = indexTextureRegions() - return _textureRegions!! - } -} - -@Suppress("UNCHECKED_CAST") -val DefinitionsManager.textureAtlasDefinitions: TextureAtlasDefinitionRegistry - get() = registry(TextureAtlasLifecycle.name) as TextureAtlasDefinitionRegistry - - -// ================================================================== -// -// lifecycle -// -// ================================================================== - -class TextureAtlasLifecycle : LibGdxSimpleLifecycle< - TextureAtlasRawDefinition, - TextureAtlasRawDefinitionParameters, - TextureAtlasDefinition>() { - companion object { - const val name = "texture-atlas" - } - - override val name = TextureAtlasLifecycle.name - override val directory = "atlases" - override val rawDefinitionType = TextureAtlasRawDefinition::class - override val definitionType = TextureAtlasDefinition::class - override val parameterType = TextureAtlasRawDefinitionParameters::class - override val extensions: String = "atlas" - override val definition = DefinitionLifecycle { definitions, ordered, from -> - TextureAtlasDefinitionRegistry(definitions, ordered, from) - } - - override fun gatherHit(reader: RawDefinitionReader, - entry: String, - name: String, - parameters: TextureAtlasRawDefinitionParameters?) = - TextureAtlasRawDefinition(reader.fileHandle(entry), parameters) - - override fun gatherResult(name: String, final: TextureAtlasRawDefinition) = - TextureAtlasDefinition(name, descriptor(final.file, final.parameters?.toParameters())) -} +//package fledware.definitions.libgdx.lifecycles +// +//import com.badlogic.gdx.assets.AssetDescriptor +//import com.badlogic.gdx.assets.AssetManager +//import com.badlogic.gdx.assets.loaders.TextureAtlasLoader +//import com.badlogic.gdx.files.FileHandle +//import com.badlogic.gdx.graphics.g2d.TextureAtlas +//import fledware.definitions.DefinitionLifecycle +//import fledware.definitions.DefinitionsManager +//import fledware.definitions.RawDefinitionFrom +//import fledware.definitions.libgdx.LibGdxDefinition +//import fledware.definitions.libgdx.LibGdxSimpleLifecycle +//import fledware.definitions.libgdx.descriptor +//import fledware.definitions.libgdx.fileHandle +//import fledware.definitions.reader.RawDefinitionReader +//import fledware.definitions.registry.SimpleDefinitionRegistry +//import fledware.utilities.getOrNull +//import kotlin.collections.set +// +// +//// ================================================================== +//// +//// definitions +//// +//// ================================================================== +// +//data class TextureAtlasDefinition(override val defName: String, +// override val assetDescriptor: AssetDescriptor) +// : LibGdxDefinition { +// override fun getNew(): TextureAtlas { +// return TextureAtlas(assetDescriptor.file) +// } +//} +// +//data class TextureAtlasRawDefinitionParameters(val flip: Boolean?) { +// fun toParameters(): TextureAtlasLoader.TextureAtlasParameter { +// val result = TextureAtlasLoader.TextureAtlasParameter() +// flip?.also { result.flip = flip } +// return result +// } +//} +// +//class TextureAtlasRawDefinition(val file: FileHandle, +// val parameters: TextureAtlasRawDefinitionParameters?) +// +// +//// ================================================================== +//// +//// registry +//// +//// ================================================================== +// +//class TextureAtlasDefinitionRegistry( +// definitions: Map, +// orderedDefinitions: List, +// fromDefinitions: Map> +//) : SimpleDefinitionRegistry(definitions, orderedDefinitions, fromDefinitions) { +// private fun indexTextureRegions(): Map { +// val assets = manager.contexts.getOrNull() +// ?: throw IllegalStateException("AssetManager required to index atlases") +// val result = mutableMapOf() +// orderedDefinitions.forEach { atlasDefinition -> +// val atlas = assets.get(atlasDefinition.assetDescriptor) +// ?: throw IllegalStateException("All atlases must be loaded to index: $atlasDefinition") +// atlas.regions.forEach { region -> +// result[region.name] = region +// } +// } +// return result +// } +// +// private var _textureRegions: Map? = null +// val textureRegions: Map +// get() { +// if (_textureRegions == null) +// _textureRegions = indexTextureRegions() +// return _textureRegions!! +// } +//} +// +//@Suppress("UNCHECKED_CAST") +//val DefinitionsManager.textureAtlasDefinitions: TextureAtlasDefinitionRegistry +// get() = registry(TextureAtlasLifecycle.name) as TextureAtlasDefinitionRegistry +// +// +//// ================================================================== +//// +//// lifecycle +//// +//// ================================================================== +// +//class TextureAtlasLifecycle : LibGdxSimpleLifecycle< +// TextureAtlasRawDefinition, +// TextureAtlasRawDefinitionParameters, +// TextureAtlasDefinition>() { +// companion object { +// const val name = "texture-atlas" +// } +// +// override val name = TextureAtlasLifecycle.name +// override val directory = "atlases" +// override val rawDefinitionType = TextureAtlasRawDefinition::class +// override val definitionType = TextureAtlasDefinition::class +// override val parameterType = TextureAtlasRawDefinitionParameters::class +// override val extensions: String = "atlas" +// override val definition = DefinitionLifecycle { definitions, ordered, from -> +// TextureAtlasDefinitionRegistry(definitions, ordered, from) +// } +// +// override fun gatherHit(reader: RawDefinitionReader, +// entry: String, +// name: String, +// parameters: TextureAtlasRawDefinitionParameters?) = +// TextureAtlasRawDefinition(reader.fileHandle(entry), parameters) +// +// override fun gatherResult(name: String, final: TextureAtlasRawDefinition) = +// TextureAtlasDefinition(name, descriptor(final.file, final.parameters?.toParameters())) +//} diff --git a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/TextureLifecycle.kt b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/TextureLifecycle.kt deleted file mode 100644 index 22864e4..0000000 --- a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/TextureLifecycle.kt +++ /dev/null @@ -1,97 +0,0 @@ -package fledware.definitions.libgdx.lifecycles - -import com.badlogic.gdx.assets.AssetDescriptor -import com.badlogic.gdx.assets.loaders.TextureLoader -import com.badlogic.gdx.files.FileHandle -import com.badlogic.gdx.graphics.Pixmap -import com.badlogic.gdx.graphics.Texture -import fledware.definitions.DefinitionsManager -import fledware.definitions.libgdx.LibGdxDefinition -import fledware.definitions.libgdx.LibGdxSimpleLifecycle -import fledware.definitions.libgdx.descriptor -import fledware.definitions.libgdx.fileHandle -import fledware.definitions.reader.RawDefinitionReader -import fledware.definitions.registry.SimpleDefinitionRegistry - - -// ================================================================== -// -// definitions -// -// ================================================================== - - -data class TextureDefinition(override val defName: String, - override val assetDescriptor: AssetDescriptor) - : LibGdxDefinition { - override fun getNew(): Texture { - return Texture(assetDescriptor.file) - } -} - -data class TextureRawDefinitionParameters( - val format: Pixmap.Format?, - val genMipMaps: Boolean?, - val minFilter: Texture.TextureFilter?, - val magFilter: Texture.TextureFilter?, - val wrapU: Texture.TextureWrap?, - val wrapV: Texture.TextureWrap?, -) { - fun toParameters(): TextureLoader.TextureParameter { - val result = TextureLoader.TextureParameter() - format?.also { result.format = it } - genMipMaps?.also { result.genMipMaps = it } - minFilter?.also { result.minFilter = it } - magFilter?.also { result.magFilter = it } - wrapU?.also { result.wrapU = it } - wrapV?.also { result.wrapV = it } - return result - } -} - -data class TextureRawDefinition(val file: FileHandle, - val parameters: TextureRawDefinitionParameters?) - - -// ================================================================== -// -// registry -// -// ================================================================== - -@Suppress("UNCHECKED_CAST") -val DefinitionsManager.textureDefinitions: SimpleDefinitionRegistry - get() = registry(TextureLifecycle.name) as SimpleDefinitionRegistry - - -// ================================================================== -// -// lifecycle -// -// ================================================================== - - -class TextureLifecycle : LibGdxSimpleLifecycle< - TextureRawDefinition, - TextureRawDefinitionParameters, - TextureDefinition>() { - companion object { - const val name = "texture" - } - - override val name = TextureLifecycle.name - override val directory = "textures" - override val rawDefinitionType = TextureRawDefinition::class - override val definitionType = TextureDefinition::class - override val parameterType = TextureRawDefinitionParameters::class - override val extensions = "{png,jpeg,jpg}" - - override fun gatherHit(reader: RawDefinitionReader, - entry: String, - name: String, - parameters: TextureRawDefinitionParameters?) = - TextureRawDefinition(reader.fileHandle(entry), parameters) - - override fun gatherResult(name: String, final: TextureRawDefinition) = - TextureDefinition(name, descriptor(final.file, final.parameters?.toParameters())) -} diff --git a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/TiledMapLifecycle.kt b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/TiledMapLifecycle.kt index da53e18..3889344 100644 --- a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/TiledMapLifecycle.kt +++ b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/lifecycles/TiledMapLifecycle.kt @@ -1,119 +1,119 @@ -package fledware.definitions.libgdx.lifecycles - -import com.badlogic.gdx.assets.AssetDescriptor -import com.badlogic.gdx.assets.AssetLoaderParameters -import com.badlogic.gdx.assets.loaders.resolvers.ClasspathFileHandleResolver -import com.badlogic.gdx.files.FileHandle -import com.badlogic.gdx.graphics.Texture -import com.badlogic.gdx.maps.tiled.TideMapLoader -import com.badlogic.gdx.maps.tiled.TiledMap -import com.badlogic.gdx.maps.tiled.TmxMapLoader -import fledware.definitions.DefinitionsManager -import fledware.definitions.libgdx.LibGdxDefinition -import fledware.definitions.libgdx.LibGdxSimpleLifecycle -import fledware.definitions.libgdx.descriptor -import fledware.definitions.libgdx.fileHandle -import fledware.definitions.reader.RawDefinitionReader -import fledware.definitions.registry.SimpleDefinitionRegistry - - -// ================================================================== -// -// definitions -// -// ================================================================== - - -data class TiledMapDefinition(override val defName: String, - override val assetDescriptor: AssetDescriptor) - : LibGdxDefinition { - override fun getNew(): TiledMap { - return when (assetDescriptor.file.extension()) { - "tmx" -> { - val params = assetDescriptor.params as? TmxMapLoader.Parameters ?: TmxMapLoader.Parameters() - TmxMapLoader(ClasspathFileHandleResolver()).load(assetDescriptor.fileName, params) - } - "tide" -> TideMapLoader(ClasspathFileHandleResolver()).load(assetDescriptor.fileName) - else -> throw UnsupportedOperationException("unable to load TiledMap: $this") - } - } -} - -data class TiledMapRawDefinitionParameters( - val generateMipMaps: Boolean?, - val textureMinFilter: Texture.TextureFilter?, - val textureMagFilter: Texture.TextureFilter?, - val convertObjectToTileSpace: Boolean?, - val flipY: Boolean?, -) { - fun toTmxParams(): TmxMapLoader.Parameters { - val result = TmxMapLoader.Parameters() - generateMipMaps?.also { result.generateMipMaps = generateMipMaps } - textureMinFilter?.also { result.textureMinFilter = textureMinFilter } - textureMagFilter?.also { result.textureMagFilter = textureMagFilter } - convertObjectToTileSpace?.also { result.convertObjectToTileSpace = convertObjectToTileSpace } - flipY?.also { result.flipY = flipY } - return result - } - - fun toTideParams(): TideMapLoader.Parameters { - return TideMapLoader.Parameters() - } -} - -data class TiledMapRawDefinition( - val file: FileHandle, - val parameters: TiledMapRawDefinitionParameters?) { - fun createParams(): AssetLoaderParameters? { - return when (file.extension()) { - "tmx" -> parameters?.toTmxParams() - "tide" -> parameters?.toTideParams() - else -> null - } - } -} - - -// ================================================================== -// -// registry -// -// ================================================================== - -@Suppress("UNCHECKED_CAST") -val DefinitionsManager.tiledMapDefinitions: SimpleDefinitionRegistry - get() = registry(TiledMapLifecycle.name) as SimpleDefinitionRegistry - - -// ================================================================== -// -// lifecycle -// -// ================================================================== - - -class TiledMapLifecycle : LibGdxSimpleLifecycle< - TiledMapRawDefinition, - TiledMapRawDefinitionParameters, - TiledMapDefinition>() { - companion object { - const val name = "tiledmap" - } - - override val name = TiledMapLifecycle.name - override val directory = "tiledmaps" - override val rawDefinitionType = TiledMapRawDefinition::class - override val definitionType = TiledMapDefinition::class - override val parameterType = TiledMapRawDefinitionParameters::class - override val extensions: String = "{tmx,tide}" - - override fun gatherHit(reader: RawDefinitionReader, - entry: String, - name: String, - parameters: TiledMapRawDefinitionParameters?) = - TiledMapRawDefinition(reader.fileHandle(entry), parameters) - - override fun gatherResult(name: String, final: TiledMapRawDefinition) = - TiledMapDefinition(name, descriptor(final.file, final.createParams())) -} - +//package fledware.definitions.libgdx.lifecycles +// +//import com.badlogic.gdx.assets.AssetDescriptor +//import com.badlogic.gdx.assets.AssetLoaderParameters +//import com.badlogic.gdx.assets.loaders.resolvers.ClasspathFileHandleResolver +//import com.badlogic.gdx.files.FileHandle +//import com.badlogic.gdx.graphics.Texture +//import com.badlogic.gdx.maps.tiled.TideMapLoader +//import com.badlogic.gdx.maps.tiled.TiledMap +//import com.badlogic.gdx.maps.tiled.TmxMapLoader +//import fledware.definitions.DefinitionsManager +//import fledware.definitions.libgdx.LibGdxDefinition +//import fledware.definitions.libgdx.LibGdxSimpleLifecycle +//import fledware.definitions.libgdx.descriptor +//import fledware.definitions.libgdx.fileHandle +//import fledware.definitions.reader.RawDefinitionReader +//import fledware.definitions.registry.SimpleDefinitionRegistry +// +// +//// ================================================================== +//// +//// definitions +//// +//// ================================================================== +// +// +//data class TiledMapDefinition(override val defName: String, +// override val assetDescriptor: AssetDescriptor) +// : LibGdxDefinition { +// override fun getNew(): TiledMap { +// return when (assetDescriptor.file.extension()) { +// "tmx" -> { +// val params = assetDescriptor.params as? TmxMapLoader.Parameters ?: TmxMapLoader.Parameters() +// TmxMapLoader(ClasspathFileHandleResolver()).load(assetDescriptor.fileName, params) +// } +// "tide" -> TideMapLoader(ClasspathFileHandleResolver()).load(assetDescriptor.fileName) +// else -> throw UnsupportedOperationException("unable to load TiledMap: $this") +// } +// } +//} +// +//data class TiledMapRawDefinitionParameters( +// val generateMipMaps: Boolean?, +// val textureMinFilter: Texture.TextureFilter?, +// val textureMagFilter: Texture.TextureFilter?, +// val convertObjectToTileSpace: Boolean?, +// val flipY: Boolean?, +//) { +// fun toTmxParams(): TmxMapLoader.Parameters { +// val result = TmxMapLoader.Parameters() +// generateMipMaps?.also { result.generateMipMaps = generateMipMaps } +// textureMinFilter?.also { result.textureMinFilter = textureMinFilter } +// textureMagFilter?.also { result.textureMagFilter = textureMagFilter } +// convertObjectToTileSpace?.also { result.convertObjectToTileSpace = convertObjectToTileSpace } +// flipY?.also { result.flipY = flipY } +// return result +// } +// +// fun toTideParams(): TideMapLoader.Parameters { +// return TideMapLoader.Parameters() +// } +//} +// +//data class TiledMapRawDefinition( +// val file: FileHandle, +// val parameters: TiledMapRawDefinitionParameters?) { +// fun createParams(): AssetLoaderParameters? { +// return when (file.extension()) { +// "tmx" -> parameters?.toTmxParams() +// "tide" -> parameters?.toTideParams() +// else -> null +// } +// } +//} +// +// +//// ================================================================== +//// +//// registry +//// +//// ================================================================== +// +//@Suppress("UNCHECKED_CAST") +//val DefinitionsManager.tiledMapDefinitions: SimpleDefinitionRegistry +// get() = registry(TiledMapLifecycle.name) as SimpleDefinitionRegistry +// +// +//// ================================================================== +//// +//// lifecycle +//// +//// ================================================================== +// +// +//class TiledMapLifecycle : LibGdxSimpleLifecycle< +// TiledMapRawDefinition, +// TiledMapRawDefinitionParameters, +// TiledMapDefinition>() { +// companion object { +// const val name = "tiledmap" +// } +// +// override val name = TiledMapLifecycle.name +// override val directory = "tiledmaps" +// override val rawDefinitionType = TiledMapRawDefinition::class +// override val definitionType = TiledMapDefinition::class +// override val parameterType = TiledMapRawDefinitionParameters::class +// override val extensions: String = "{tmx,tide}" +// +// override fun gatherHit(reader: RawDefinitionReader, +// entry: String, +// name: String, +// parameters: TiledMapRawDefinitionParameters?) = +// TiledMapRawDefinition(reader.fileHandle(entry), parameters) +// +// override fun gatherResult(name: String, final: TiledMapRawDefinition) = +// TiledMapDefinition(name, descriptor(final.file, final.createParams())) +//} +// diff --git a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/types/Sound.kt b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/types/Sound.kt new file mode 100644 index 0000000..c952af1 --- /dev/null +++ b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/types/Sound.kt @@ -0,0 +1,107 @@ +package fledware.definitions.libgdx.lifecycles + +import com.badlogic.gdx.Gdx +import com.badlogic.gdx.assets.AssetDescriptor +import com.badlogic.gdx.audio.Sound +import com.badlogic.gdx.files.FileHandle +import fledware.definitions.DefinitionRegistry +import fledware.definitions.DefinitionsManager +import fledware.definitions.builder.BuilderState +import fledware.definitions.builder.DefinitionRegistryBuilder +import fledware.definitions.builder.DefinitionsBuilderFactory +import fledware.definitions.builder.findRegistryOf +import fledware.definitions.builder.mod.ModPackageContext +import fledware.definitions.builder.mod.entries.ResourceEntry +import fledware.definitions.builder.registries.FullRegistryBuilder +import fledware.definitions.findRegistryOf +import fledware.definitions.libgdx.LibGdxDefinition +import fledware.definitions.libgdx.LibGdxModEntryHandler +import fledware.definitions.libgdx.descriptor +import fledware.definitions.libgdx.types.LibGdxTextureModEntryHandler +import fledware.definitions.libgdx.types.TextureDefinition +import fledware.definitions.libgdx.types.libGdxTextureRegistryName +import fledware.utilities.globToRegex + + +// ================================================================== +// +// definitions +// +// ================================================================== + + +data class SoundDefinition( + override val assetDescriptor: AssetDescriptor +) : LibGdxDefinition { + override fun getNew(): Sound { + return Gdx.audio.newSound(assetDescriptor.file) + } +} + + +// ================================================================== +// +// registry +// +// ================================================================== + +const val libGdxSoundRegistryName = "LibGdxSound" + +val DefinitionsManager.soundDefinitions: DefinitionRegistry + get() = findRegistryOf(libGdxSoundRegistryName) + +val BuilderState.soundDefinitions: DefinitionRegistryBuilder + get() = findRegistryOf(libGdxSoundRegistryName) + +fun DefinitionsBuilderFactory.withLibGdxSounds() = this + .withBuilderHandler(FullRegistryBuilder(libGdxSoundRegistryName)) + .withBuilderHandler(LibGdxSoundModEntryHandler()) + + +// ================================================================== +// +// lifecycle +// +// ================================================================== + +class LibGdxSoundModEntryHandler( + directoryPrefix: String = "sounds", + gatherRegex: Regex = "$directoryPrefix/**.{ogg,wav,mp3}".globToRegex(), + targetRegistry: String = libGdxSoundRegistryName, +) : LibGdxModEntryHandler( + directoryPrefix, + gatherRegex, + targetRegistry, + null +) { + override val name: String + get() = libGdxSoundRegistryName + + override fun factoryDefinition(context: ModPackageContext, + entry: ResourceEntry, + entryName: String, + entryFile: FileHandle, + parameters: Nothing?): SoundDefinition { + return SoundDefinition(descriptor(entryFile)) + } +} + + +//class SoundLifecycle : LibGdxSimpleLifecycle() { +// companion object { +// const val name = "sound" +// } +// +// override val name = SoundLifecycle.name +// override val directory = "sounds" +// override val rawDefinitionType = SoundRawDefinition::class +// override val definitionType = SoundDefinition::class +// override val parameterType: KClass? = null +// override val extensions: String = "{ogg,wav,mp3}" +// +// override fun gatherHit(reader: RawDefinitionReader, entry: String, name: String, parameters: Nothing?) = +// SoundRawDefinition(reader.fileHandle(entry)) +// +// override fun gatherResult(name: String, final: SoundRawDefinition) = +// SoundDefinition(name, descriptor(final.file)) +//} diff --git a/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/types/Texture.kt b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/types/Texture.kt new file mode 100644 index 0000000..25f0458 --- /dev/null +++ b/definitions-libgdx/src/main/kotlin/fledware/definitions/libgdx/types/Texture.kt @@ -0,0 +1,113 @@ +package fledware.definitions.libgdx.types + +import com.badlogic.gdx.assets.AssetDescriptor +import com.badlogic.gdx.assets.loaders.TextureLoader +import com.badlogic.gdx.files.FileHandle +import com.badlogic.gdx.graphics.Pixmap +import com.badlogic.gdx.graphics.Texture +import com.badlogic.gdx.graphics.TextureData +import fledware.definitions.DefinitionRegistry +import fledware.definitions.DefinitionsManager +import fledware.definitions.builder.BuilderState +import fledware.definitions.builder.DefinitionRegistryBuilder +import fledware.definitions.builder.DefinitionsBuilderFactory +import fledware.definitions.builder.findRegistryOf +import fledware.definitions.builder.mod.ModPackageContext +import fledware.definitions.builder.mod.entries.ResourceEntry +import fledware.definitions.builder.registries.FullRegistryBuilder +import fledware.definitions.findRegistryOf +import fledware.definitions.libgdx.LibGdxDefinition +import fledware.definitions.libgdx.LibGdxModEntryHandler +import fledware.definitions.libgdx.descriptor +import fledware.utilities.globToRegex + + +// ================================================================== +// +// definitions +// +// ================================================================== + +data class TextureDefinition( + override val assetDescriptor: AssetDescriptor +) : LibGdxDefinition { + override fun getNew(): Texture { + val parameters = assetDescriptor.params as? TextureLoader.TextureParameter + ?: return Texture(assetDescriptor.file) + val textureData = TextureData.Factory.loadFromFile( + assetDescriptor.file, parameters.format, parameters.genMipMaps); + val result = Texture(textureData) + result.setFilter(parameters.minFilter, parameters.magFilter) + result.setWrap(parameters.wrapU, parameters.wrapV) + return result + } +} + +data class TextureRawDefinitionParameters( + val format: Pixmap.Format?, + val genMipMaps: Boolean?, + val minFilter: Texture.TextureFilter?, + val magFilter: Texture.TextureFilter?, + val wrapU: Texture.TextureWrap?, + val wrapV: Texture.TextureWrap?, +) { + fun toParameters(): TextureLoader.TextureParameter { + val result = TextureLoader.TextureParameter() + format?.also { result.format = it } + genMipMaps?.also { result.genMipMaps = it } + minFilter?.also { result.minFilter = it } + magFilter?.also { result.magFilter = it } + wrapU?.also { result.wrapU = it } + wrapV?.also { result.wrapV = it } + return result + } +} + + +// ================================================================== +// +// registry +// +// ================================================================== + +const val libGdxTextureRegistryName = "LibGdxTexture" + +val DefinitionsManager.textureDefinitions: DefinitionRegistry + get() = this.findRegistryOf(libGdxTextureRegistryName) + +val BuilderState.textureDefinitions: DefinitionRegistryBuilder + get() = this.findRegistryOf(libGdxTextureRegistryName) + +fun DefinitionsBuilderFactory.withLibGdxTextures() = this + .withBuilderHandler(FullRegistryBuilder(libGdxTextureRegistryName)) + .withBuilderHandler(LibGdxTextureModEntryHandler()) + + +// ================================================================== +// +// entry handler +// +// ================================================================== + +class LibGdxTextureModEntryHandler( + directoryPrefix: String = "textures", + gatherRegex: Regex = "$directoryPrefix/**.{png,jpeg,jpg}".globToRegex(), + targetRegistry: String = libGdxTextureRegistryName, +) : LibGdxModEntryHandler( + directoryPrefix, + gatherRegex, + targetRegistry, + TextureRawDefinitionParameters::class +) { + override val name: String + get() = libGdxTextureRegistryName + + override fun factoryDefinition(context: ModPackageContext, + entry: ResourceEntry, + entryName: String, + entryFile: FileHandle, + parameters: TextureRawDefinitionParameters?): TextureDefinition { + val descriptor = descriptor(entryFile, parameters?.toParameters()) + return TextureDefinition(descriptor) + } +} diff --git a/definitions-libgdx/src/test/kotlin/fledware/definitions/libgdx/lifecycles/BasicAssetLifecycleTest.kt b/definitions-libgdx/src/test/kotlin/fledware/definitions/libgdx/lifecycles/BasicAssetLifecycleTest.kt index ba64228..41360e9 100644 --- a/definitions-libgdx/src/test/kotlin/fledware/definitions/libgdx/lifecycles/BasicAssetLifecycleTest.kt +++ b/definitions-libgdx/src/test/kotlin/fledware/definitions/libgdx/lifecycles/BasicAssetLifecycleTest.kt @@ -1,21 +1,22 @@ package fledware.definitions.libgdx.lifecycles import com.badlogic.gdx.utils.Disposable -import fledware.definitions.DefinitionsBuilder -import fledware.definitions.Lifecycle -import fledware.definitions.reader.gatherDir -import fledware.definitions.reader.gatherJar +import fledware.definitions.builder.DefinitionsBuilder +import fledware.definitions.builder.findRegistry +import fledware.definitions.builder.std.defaultBuilder +import fledware.definitions.findRegistry import fledware.definitions.libgdx.LibGdxDefinition import fledware.definitions.libgdx.createAssetManager -import fledware.definitions.libgdx.loadAll +import fledware.definitions.libgdx.loadAllAssets +import fledware.definitions.libgdx.types.libGdxTextureRegistryName +import fledware.definitions.libgdx.types.withLibGdxTextures import fledware.definitions.tests.LibGdxTest -import fledware.definitions.tests.libgdxBuilder -import fledware.definitions.tests.testFilePath import fledware.definitions.tests.testJarPath +import fledware.definitions.tests.testResourcePath +import fledware.definitions.tests.withLibGdxHeadless import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.Arguments import org.junit.jupiter.params.provider.MethodSource -import java.io.File import kotlin.test.assertIs import kotlin.test.assertNotNull import kotlin.test.assertTrue @@ -24,70 +25,101 @@ class BasicAssetLifecycleTest : LibGdxTest() { companion object { @JvmStatic fun getData() = listOf( - Arguments.of(BitmapFontLifecycle()), - Arguments.of(FreeTypeFontLifecycle()), - Arguments.of(MusicLifecycle()), - Arguments.of(SkinLifecycle()), - Arguments.of(SoundLifecycle()), - Arguments.of(TextureAtlasLifecycle()), - Arguments.of(TextureLifecycle()), - Arguments.of(TiledMapLifecycle()), +// Arguments.of(BitmapFontLifecycle()), +// Arguments.of(FreeTypeFontLifecycle()), +// Arguments.of(MusicLifecycle()), +// Arguments.of(SkinLifecycle()), + Arguments.of( + { defaultBuilder().withLibGdxSounds().create() }, + "definitions-libgdx-tests/all-resource-types".testResourcePath, + libGdxSoundRegistryName + ), + Arguments.of( + { defaultBuilder().withLibGdxSounds().create() }, + "definitions-libgdx-tests/all-resource-types".testJarPath, + libGdxSoundRegistryName + ), +// Arguments.of(TextureAtlasLifecycle()), + Arguments.of( + { defaultBuilder().withLibGdxTextures().create() }, + "definitions-libgdx-tests/all-resource-types".testResourcePath, + libGdxTextureRegistryName + ), + Arguments.of( + { defaultBuilder().withLibGdxTextures().create() }, + "definitions-libgdx-tests/all-resource-types".testJarPath, + libGdxTextureRegistryName + ), +// Arguments.of(TiledMapLifecycle()), ) } @ParameterizedTest @MethodSource("getData") - fun canLoadFromDir(lifecycle: Lifecycle) = libgdxBuilder(listOf(lifecycle)) { builder -> - builder.gatherDir(File("simplegame".testFilePath, "src/main/resources").canonicalPath) - actualTest(builder, lifecycle) - } - - @ParameterizedTest - @MethodSource("getData") - fun canLoadFromArchive(lifecycle: Lifecycle) = libgdxBuilder(listOf(lifecycle)) { builder -> - builder.gatherJar("simplegame".testJarPath.canonicalPath) - actualTest(builder, lifecycle) - } - - private fun actualTest(builder: DefinitionsBuilder, lifecycle: Lifecycle) { - val manager = builder.build() - val registry = manager.registry(lifecycle.name) - assertTrue(registry.definitions.isNotEmpty()) - registry.definitions.values.forEach { check -> - val definition = assertIs>(check) - val asset = definition.getNew() - assertNotNull(asset) - (asset as? Disposable)?.dispose() + fun canLoadDirectly(builderFactory: () -> DefinitionsBuilder, + modSpecLoading: String, + targetRegistryName: String) { + val builder = builderFactory().withModPackage(modSpecLoading) + builder.withLibGdxHeadless { + val registry = builder.state.findRegistry(targetRegistryName) + assertTrue(registry.definitions.isNotEmpty()) + registry.definitions.values.forEach { check -> + val definition = assertIs>(check) + val asset = definition.getNew() + assertNotNull(asset) + (asset as? Disposable)?.dispose() + } } } - @ParameterizedTest @MethodSource("getData") - fun assetManagerCanLoadFromDir(lifecycle: Lifecycle) = libgdxBuilder(listOf(lifecycle)) { builder -> - builder.gatherDir(File("simplegame".testFilePath, "src/main/resources").canonicalPath) - assetManagerActualTest(builder, lifecycle) + fun canLoadFromAssetManager(builderFactory: () -> DefinitionsBuilder, + modSpecLoading: String, + targetRegistryName: String) { + val manager = builderFactory().withModPackage(modSpecLoading).build() + manager.withLibGdxHeadless { + val assetManager = createAssetManager() + manager.loadAllAssets(assetManager) + assetManager.finishLoading() + val registry = manager.findRegistry(targetRegistryName) + assertTrue(registry.definitions.isNotEmpty()) + registry.definitions.values.forEach { check -> + val definition = assertIs>(check) + val asset = assetManager.get(definition.assetDescriptor) + assertNotNull(asset) + } + assetManager.dispose() + } } - @ParameterizedTest - @MethodSource("getData") - fun assetManagerCanLoadFromArchive(lifecycle: Lifecycle) = libgdxBuilder(listOf(lifecycle)) { builder -> - builder.gatherJar("simplegame".testJarPath.canonicalPath) - assetManagerActualTest(builder, lifecycle) - } - private fun assetManagerActualTest(builder: DefinitionsBuilder, lifecycle: Lifecycle) { - val manager = builder.build() - val assetManager = createAssetManager() - manager.loadAll(assetManager) - assetManager.finishLoading() - val registry = manager.registry(lifecycle.name) - assertTrue(registry.definitions.isNotEmpty()) - registry.definitions.values.forEach { check -> - val definition = assertIs>(check) - val asset = assetManager.get(definition.assetDescriptor) - assertNotNull(asset) - } - assetManager.dispose() - } +// @ParameterizedTest +// @MethodSource("getData") +// fun assetManagerCanLoadFromDir(lifecycle: Lifecycle) = libgdxBuilder(listOf(lifecycle)) { builder -> +// builder.gatherDir(File("simplegame".testFilePath, "src/main/resources").canonicalPath) +// assetManagerActualTest(builder, lifecycle) +// } +// +// @ParameterizedTest +// @MethodSource("getData") +// fun assetManagerCanLoadFromArchive(lifecycle: Lifecycle) = libgdxBuilder(listOf(lifecycle)) { builder -> +// builder.gatherJar("simplegame".testJarPath.canonicalPath) +// assetManagerActualTest(builder, lifecycle) +// } +// +// private fun assetManagerActualTest(builder: DefinitionsBuilder, lifecycle: Lifecycle) { +// val manager = builder.build() +// val assetManager = createAssetManager() +// manager.loadAll(assetManager) +// assetManager.finishLoading() +// val registry = manager.registry(lifecycle.name) +// assertTrue(registry.definitions.isNotEmpty()) +// registry.definitions.values.forEach { check -> +// val definition = assertIs>(check) +// val asset = assetManager.get(definition.assetDescriptor) +// assertNotNull(asset) +// } +// assetManager.dispose() +// } } \ No newline at end of file diff --git a/definitions-libgdx/src/testFixtures/kotlin/fledware/definitions/tests/builder.kt b/definitions-libgdx/src/testFixtures/kotlin/fledware/definitions/tests/builder.kt index fb95d33..846eb28 100644 --- a/definitions-libgdx/src/testFixtures/kotlin/fledware/definitions/tests/builder.kt +++ b/definitions-libgdx/src/testFixtures/kotlin/fledware/definitions/tests/builder.kt @@ -1,13 +1,22 @@ package fledware.definitions.tests -import fledware.definitions.Lifecycle -import fledware.definitions.registry.DefaultDefinitionsBuilder +import fledware.definitions.DefinitionsManager +import fledware.definitions.builder.DefinitionsBuilder -fun libgdxBuilder(lifecycles: List = emptyList(), - block: (builder: DefaultDefinitionsBuilder) -> Unit) = builder(lifecycles) { builder -> - LibGdxHeadlessContainer.loader = builder.classLoaderWrapper::currentLoader +fun DefinitionsBuilder.withLibGdxHeadless(block: () -> Unit) { + LibGdxHeadlessContainer.loader = this.state.classLoaderWrapper::currentLoader try { - block(builder) + block() + } + finally { + LibGdxHeadlessContainer.loader = null + } +} + +fun DefinitionsManager.withLibGdxHeadless(block: () -> Unit) { + LibGdxHeadlessContainer.loader = this::classLoader + try { + block() } finally { LibGdxHeadlessContainer.loader = null diff --git a/examples/bots-core/src/main/kotlin/bots/map/generate.kt b/examples/bots-core/src/main/kotlin/bots/map/generate.kt index b26d557..e40b84a 100644 --- a/examples/bots-core/src/main/kotlin/bots/map/generate.kt +++ b/examples/bots-core/src/main/kotlin/bots/map/generate.kt @@ -7,7 +7,7 @@ import fledware.ecs.Engine import fledware.ecs.WorldBuilder import fledware.ecs.definitions.fled.createDefinedEntity import fledware.ecs.definitions.fled.createDefinedWorldAndFlush -import fledware.ecs.definitions.instantiator.ComponentArgument +import fledware.ecs.definitions.ComponentArgument import fledware.utilities.get @Suppress("unused") diff --git a/examples/just-draw-something/src/main/kotlin/just/draw/something/JustDrawSomethingTest.kt b/examples/just-draw-something/src/main/kotlin/just/draw/something/JustDrawSomethingTest.kt index d56eebf..20a7247 100644 --- a/examples/just-draw-something/src/main/kotlin/just/draw/something/JustDrawSomethingTest.kt +++ b/examples/just-draw-something/src/main/kotlin/just/draw/something/JustDrawSomethingTest.kt @@ -33,10 +33,10 @@ import fledware.definitions.libgdx.lifecycles.bitmapFontDefinitions import fledware.definitions.libgdx.lifecycles.musicDefinitions import fledware.definitions.libgdx.lifecycles.skinDefinitions import fledware.definitions.libgdx.lifecycles.soundDefinitions -import fledware.definitions.libgdx.lifecycles.textureDefinitions +import fledware.definitions.libgdx.types.textureDefinitions import fledware.definitions.libgdx.lifecycles.tiledMapDefinitions import fledware.definitions.libgdx.lifecycles.trueTypeFontDefinitions -import fledware.definitions.libgdx.loadAll +import fledware.definitions.libgdx.loadAllAssets import fledware.definitions.libgdx.setupLibGdxFilesWrapper import fledware.definitions.registry.DefaultDefinitionsBuilder import fledware.definitions.tests.testJarPath @@ -84,7 +84,7 @@ private class JustDrawSomething(val lifecycles: List) : ApplicationLi }.also { println("gathered and built definitions in $it ms") } measureTimeMillis { assetManager = createAssetManager() - definitions.loadAll(assetManager) + definitions.loadAllAssets(assetManager) assetManager.finishLoading() }.also { println("loaded all assets in $it ms") } diff --git a/examples/pathing/src/main/kotlin/pathing/decorator.kt b/examples/pathing/src/main/kotlin/pathing/decorator.kt index 04aa41d..c9079a5 100644 --- a/examples/pathing/src/main/kotlin/pathing/decorator.kt +++ b/examples/pathing/src/main/kotlin/pathing/decorator.kt @@ -3,7 +3,7 @@ package pathing import fledware.definitions.builtin.Function import fledware.ecs.WorldBuilder import fledware.ecs.definitions.fled.createDefinedEntity -import fledware.ecs.definitions.instantiator.ComponentArgument +import fledware.ecs.definitions.ComponentArgument import fledware.utilities.get diff --git a/examples/pathing/src/main/kotlin/pathing/initialize.kt b/examples/pathing/src/main/kotlin/pathing/initialize.kt index 7f752b9..cb3207b 100644 --- a/examples/pathing/src/main/kotlin/pathing/initialize.kt +++ b/examples/pathing/src/main/kotlin/pathing/initialize.kt @@ -5,7 +5,7 @@ import fledware.definitions.DefinitionsManager import fledware.definitions.builtin.Function import fledware.ecs.Engine import fledware.ecs.definitions.fled.createDefinedWorldAndFlush -import fledware.ecs.definitions.instantiator.ComponentArgument +import fledware.ecs.definitions.ComponentArgument import fledware.utilities.get /** diff --git a/examples/spacer-core/src/main/kotlin/spacer/generate/GenerateSolarSystem.kt b/examples/spacer-core/src/main/kotlin/spacer/generate/GenerateSolarSystem.kt index cbd6d8a..0c1f5af 100644 --- a/examples/spacer-core/src/main/kotlin/spacer/generate/GenerateSolarSystem.kt +++ b/examples/spacer-core/src/main/kotlin/spacer/generate/GenerateSolarSystem.kt @@ -11,7 +11,7 @@ import fledware.definitions.builtin.functionDefinitions import fledware.ecs.Entity import fledware.ecs.debugToString import fledware.ecs.definitions.fled.entityInstantiator -import fledware.ecs.definitions.instantiator.ComponentArgument +import fledware.ecs.definitions.ComponentArgument import fledware.ecs.get import org.slf4j.LoggerFactory import kotlin.random.Random @@ -79,9 +79,9 @@ fun figureOrbit(parent: Entity?, arguments: MutableList) { } else { arguments += ComponentArgument("orbit", PointOrbit::orbitingId.name, parent.id) - arguments += ComponentArgument("orbit", PointOrbit::alpha.name, Random.Default.nextFloat() * MathUtils.PI2) + arguments += ComponentArgument("orbit", PointOrbit::alpha.name, Random.nextFloat() * MathUtils.PI2) arguments += ComponentArgument("orbit", PointOrbit::distance.name, 10) - arguments += ComponentArgument("orbit", PointOrbit::deltaPerSecond.name, Random.Default.nextFloat()) + arguments += ComponentArgument("orbit", PointOrbit::deltaPerSecond.name, Random.nextFloat()) } } diff --git a/examples/spacer-core/src/main/kotlin/spacer/hyperspace/SolarSystemLocationSystem.kt b/examples/spacer-core/src/main/kotlin/spacer/hyperspace/SolarSystemLocationSystem.kt index fcfa67b..32a3bcb 100644 --- a/examples/spacer-core/src/main/kotlin/spacer/hyperspace/SolarSystemLocationSystem.kt +++ b/examples/spacer-core/src/main/kotlin/spacer/hyperspace/SolarSystemLocationSystem.kt @@ -6,7 +6,7 @@ import fledware.ecs.WorldData import fledware.ecs.componentIndexOf import fledware.ecs.definitions.EcsSystem import fledware.ecs.definitions.fled.createDefinedEntity -import fledware.ecs.definitions.instantiator.ComponentArgument +import fledware.ecs.definitions.ComponentArgument import fledware.utilities.getOrNull import spacer.solarsystem.SolarSystemLocation diff --git a/examples/spacer-mod-hyperspace-renderer/src/main/kotlin/spacer/mod/hyperspace_renderer/HyperspaceGraphicsSystem.kt b/examples/spacer-mod-hyperspace-renderer/src/main/kotlin/spacer/mod/hyperspace_renderer/HyperspaceGraphicsSystem.kt index 343fae1..01eaa22 100644 --- a/examples/spacer-mod-hyperspace-renderer/src/main/kotlin/spacer/mod/hyperspace_renderer/HyperspaceGraphicsSystem.kt +++ b/examples/spacer-mod-hyperspace-renderer/src/main/kotlin/spacer/mod/hyperspace_renderer/HyperspaceGraphicsSystem.kt @@ -11,7 +11,7 @@ import driver.helpers.InputSystem import driver.helpers.TwoDGraphics import driver.helpers.drawGrid import fledware.definitions.libgdx.lifecycles.textureAtlasDefinitions -import fledware.definitions.libgdx.lifecycles.textureDefinitions +import fledware.definitions.libgdx.types.textureDefinitions import fledware.ecs.World import fledware.ecs.WorldData import fledware.ecs.componentIndexOf diff --git a/settings.gradle b/settings.gradle index f8769ab..1260510 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,7 +2,7 @@ rootProject.name = 'FledDefs' // released code include 'definitions' -include 'definitions-api' +include 'definitions-builder' include 'definitions-bytebuddy' include 'definitions-ecs' include 'definitions-ecs-ashley' @@ -25,11 +25,12 @@ include 'examples:spacer-mod-hyperspace-renderer' include 'examples:spacer-mod-info' // test projects -include 'test-projects:definitions-api-tests:add-definition-handler' -include 'test-projects:definitions-api-tests:add-object-updater-directive' -include 'test-projects:definitions-api-tests:simple-annotations' -include 'test-projects:definitions-api-tests:simple-functions-1' -include 'test-projects:definitions-api-tests:simple-functions-2' +include 'test-projects:definitions-builder-tests:add-definition-handler' +include 'test-projects:definitions-builder-tests:add-object-updater-directive' +include 'test-projects:definitions-builder-tests:simple-annotations' +include 'test-projects:definitions-builder-tests:simple-functions-1' +include 'test-projects:definitions-builder-tests:simple-functions-2' +include 'test-projects:definitions-libgdx-tests:all-resource-types' include 'test-projects:ecs-loading' include 'test-projects:ecs-loading-ashley' include 'test-projects:ecs-loading-fled' diff --git a/test-projects/definitions-builder-tests/simple-functions-1/src/main/kotlin/definitions_api/tests/stuffs.kt b/test-projects/definitions-builder-tests/simple-functions-1/src/main/kotlin/definitions_api/tests/stuffs.kt index b6b3de0..75d0057 100644 --- a/test-projects/definitions-builder-tests/simple-functions-1/src/main/kotlin/definitions_api/tests/stuffs.kt +++ b/test-projects/definitions-builder-tests/simple-functions-1/src/main/kotlin/definitions_api/tests/stuffs.kt @@ -1,5 +1,15 @@ package definitions_api.tests +interface SomeInterface + +data class SomeDataClass( + val blah: Boolean +) + +abstract class SomeAbstractClass + +object SomeObject + @SomeFunctionAnnotation("yay") fun yay(): String { return "hello!!!!!" diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/build.gradle b/test-projects/definitions-libgdx-tests/all-resource-types/build.gradle new file mode 100644 index 0000000..571b417 --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/build.gradle @@ -0,0 +1,2 @@ +dependencies { +} \ No newline at end of file diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/atlases/vis-ui.atlas b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/atlases/vis-ui.atlas new file mode 100644 index 0000000..a513cdb --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/atlases/vis-ui.atlas @@ -0,0 +1,772 @@ +vis-ui.png +size: 1024,512 +format: RGBA8888 +filter: Nearest,Nearest +repeat: none +border + rotate: false + xy: 727, 466 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +border-circle + rotate: false + xy: 195, 74 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +border-circle-error + rotate: false + xy: 224, 74 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +border-dark-blue + rotate: false + xy: 580, 417 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +border-error + rotate: false + xy: 712, 451 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +button + rotate: false + xy: 755, 470 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-blue + rotate: false + xy: 655, 470 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-down + rotate: false + xy: 655, 470 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-blue-down + rotate: false + xy: 590, 425 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-blue-over + rotate: false + xy: 630, 470 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-over + rotate: false + xy: 680, 470 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-red + rotate: false + xy: 705, 470 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-window-bg + rotate: false + xy: 730, 470 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +check-off + rotate: false + xy: 253, 74 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +textfield + rotate: false + xy: 253, 74 + size: 28, 28 + split: 2, 2, 2, 2 + orig: 28, 28 + offset: 0, 0 + index: -1 +vis-check + rotate: false + xy: 253, 74 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +check-on + rotate: false + xy: 282, 74 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +color-picker-bar-selector + rotate: false + xy: 615, 437 + size: 14, 28 + orig: 14, 28 + offset: 0, 0 + index: -1 +color-picker-cross + rotate: false + xy: 568, 393 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +color-picker-selector-horizontal + rotate: false + xy: 91, 70 + size: 6, 1 + orig: 6, 1 + offset: 0, 0 + index: -1 +color-picker-selector-vertical + rotate: false + xy: 815, 475 + size: 1, 6 + orig: 1, 6 + offset: 0, 0 + index: -1 +cursor + rotate: false + xy: 539, 365 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +default + rotate: false + xy: 1, 270 + size: 509, 240 + orig: 512, 256 + offset: 0, 16 + index: -1 +default-pane + rotate: false + xy: 780, 471 + size: 5, 3 + split: 1, 1, 1, 1 + orig: 5, 3 + offset: 0, 0 + index: -1 +default-pane-no-border + rotate: false + xy: 36, 6 + size: 1, 1 + split: 0, 0, 0, 0 + orig: 1, 1 + offset: 0, 0 + index: -1 +default-select + rotate: false + xy: 1, 54 + size: 54, 48 + split: 8, 32, 0, 48 + orig: 54, 48 + offset: 0, 0 + index: -1 +default-select-selection + rotate: false + xy: 511, 273 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +font-small + rotate: false + xy: 1, 103 + size: 506, 166 + orig: 512, 256 + offset: 0, 89 + index: -1 +grey + rotate: false + xy: 541, 330 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +menu-bg + rotate: false + xy: 541, 330 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +icon-arrow-left + rotate: false + xy: 91, 74 + size: 36, 28 + orig: 44, 44 + offset: 4, 8 + index: -1 +icon-arrow-right + rotate: false + xy: 780, 482 + size: 36, 28 + orig: 44, 44 + offset: 4, 8 + index: -1 +icon-close + rotate: false + xy: 630, 449 + size: 20, 20 + orig: 44, 44 + offset: 12, 12 + index: -1 +icon-close-titlebar + rotate: false + xy: 651, 449 + size: 20, 20 + orig: 44, 44 + offset: 12, 12 + index: -1 +icon-drive + rotate: false + xy: 1, 8 + size: 36, 10 + orig: 44, 44 + offset: 4, 18 + index: -1 +icon-file-audio + rotate: false + xy: 539, 367 + size: 28, 36 + orig: 44, 44 + offset: 8, 4 + index: -1 +icon-file-image + rotate: false + xy: 402, 72 + size: 26, 30 + orig: 44, 44 + offset: 9, 7 + index: -1 +icon-file-pdf + rotate: false + xy: 511, 284 + size: 28, 34 + orig: 44, 44 + offset: 8, 5 + index: -1 +icon-file-text + rotate: false + xy: 429, 72 + size: 26, 30 + orig: 44, 44 + offset: 9, 7 + index: -1 +icon-folder + rotate: false + xy: 852, 486 + size: 32, 24 + orig: 44, 44 + offset: 6, 12 + index: -1 +icon-folder-new + rotate: false + xy: 128, 73 + size: 35, 29 + orig: 44, 44 + offset: 5, 7 + index: -1 +icon-folder-parent + rotate: false + xy: 311, 78 + size: 32, 24 + orig: 44, 44 + offset: 6, 12 + index: -1 +icon-folder-star + rotate: false + xy: 817, 484 + size: 34, 26 + orig: 44, 44 + offset: 5, 9 + index: -1 +icon-list-settings + rotate: false + xy: 1, 19 + size: 38, 34 + orig: 44, 44 + offset: 5, 3 + index: -1 +icon-maximize + rotate: false + xy: 1001, 488 + size: 22, 22 + orig: 44, 44 + offset: 11, 11 + index: -1 +icon-minimize + rotate: false + xy: 511, 277 + size: 20, 6 + orig: 44, 44 + offset: 12, 11 + index: -1 +icon-refresh + rotate: false + xy: 456, 72 + size: 26, 30 + orig: 44, 44 + offset: 9, 7 + index: -1 +icon-restore + rotate: false + xy: 40, 25 + size: 26, 28 + orig: 44, 44 + offset: 10, 7 + index: -1 +icon-star + rotate: false + xy: 164, 74 + size: 30, 28 + orig: 44, 44 + offset: 7, 8 + index: -1 +icon-star-outline + rotate: false + xy: 56, 70 + size: 34, 32 + orig: 44, 44 + offset: 5, 6 + index: -1 +icon-trash + rotate: false + xy: 483, 72 + size: 24, 30 + orig: 44, 44 + offset: 10, 7 + index: -1 +list-selection + rotate: false + xy: 311, 74 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +vis-blue + rotate: false + xy: 311, 74 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +padded-list-selection + rotate: false + xy: 590, 423 + size: 10, 1 + split: 4, 4, 0, 1 + orig: 10, 1 + offset: 0, 0 + index: -1 +progressbar + rotate: false + xy: 508, 237 + size: 1, 32 + orig: 1, 32 + offset: 0, 0 + index: -1 +progressbar-filled + rotate: false + xy: 548, 334 + size: 1, 32 + orig: 1, 32 + offset: 0, 0 + index: -1 +progressbar-filled-vertical + rotate: false + xy: 852, 484 + size: 32, 1 + orig: 32, 1 + offset: 0, 0 + index: -1 +progressbar-vertical + rotate: false + xy: 311, 76 + size: 32, 1 + orig: 32, 1 + offset: 0, 0 + index: -1 +radio-off + rotate: false + xy: 885, 482 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +vis-radio + rotate: false + xy: 885, 482 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +radio-on + rotate: false + xy: 914, 482 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +scroll + rotate: false + xy: 1, 1 + size: 34, 6 + split: 4, 4, 2, 2 + orig: 34, 6 + offset: 0, 0 + index: -1 +scroll-horizontal + rotate: false + xy: 534, 329 + size: 6, 34 + split: 2, 2, 0, 34 + pad: -1, -1, 5, 4 + orig: 6, 34 + offset: 0, 0 + index: -1 +scroll-knob-horizontal + rotate: false + xy: 541, 332 + size: 6, 34 + split: 2, 2, 0, 34 + pad: -1, -1, 13, 12 + orig: 6, 34 + offset: 0, 0 + index: -1 +scroll-knob-vertical + rotate: false + xy: 780, 475 + size: 34, 6 + split: 12, 12, 2, 2 + orig: 34, 6 + offset: 0, 0 + index: -1 +select-box-list-bg + rotate: false + xy: 508, 235 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +window-bg + rotate: false + xy: 508, 235 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +select-down + rotate: false + xy: 615, 428 + size: 14, 8 + orig: 14, 8 + offset: 0, 0 + index: -1 +select-up + rotate: false + xy: 630, 440 + size: 14, 8 + orig: 14, 8 + offset: 0, 0 + index: -1 +selection + rotate: false + xy: 548, 332 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +separator + rotate: false + xy: 615, 426 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +tree-over + rotate: false + xy: 615, 426 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +separator-menu + rotate: false + xy: 559, 365 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +slider + rotate: false + xy: 38, 10 + size: 1, 8 + orig: 1, 8 + offset: 0, 0 + index: -1 +slider-knob + rotate: false + xy: 584, 466 + size: 22, 44 + orig: 22, 44 + offset: 0, 0 + index: -1 +slider-knob-disabled + rotate: false + xy: 511, 319 + size: 22, 44 + orig: 22, 44 + offset: 0, 0 + index: -1 +slider-knob-down + rotate: false + xy: 567, 421 + size: 22, 44 + orig: 22, 44 + offset: 0, 0 + index: -1 +slider-knob-over + rotate: false + xy: 607, 466 + size: 22, 44 + orig: 22, 44 + offset: 0, 0 + index: -1 +slider-vertical + rotate: false + xy: 91, 72 + size: 8, 1 + orig: 8, 1 + offset: 0, 0 + index: -1 +splitpane + rotate: false + xy: 817, 482 + size: 8, 1 + orig: 8, 1 + offset: 0, 0 + index: -1 +splitpane-over + rotate: false + xy: 1001, 486 + size: 8, 1 + orig: 8, 1 + offset: 0, 0 + index: -1 +splitpane-vertical + rotate: false + xy: 40, 16 + size: 1, 8 + orig: 1, 8 + offset: 0, 0 + index: -1 +splitpane-vertical-over + rotate: false + xy: 534, 320 + size: 1, 8 + orig: 1, 8 + offset: 0, 0 + index: -1 +sub-menu + rotate: false + xy: 550, 352 + size: 8, 14 + orig: 8, 14 + offset: 0, 0 + index: -1 +textfield-over + rotate: false + xy: 943, 482 + size: 28, 28 + split: 2, 2, 2, 2 + orig: 28, 28 + offset: 0, 0 + index: -1 +vis-check-over + rotate: false + xy: 943, 482 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +tooltip-bg + rotate: false + xy: 532, 280 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +touchpad-knob + rotate: false + xy: 539, 466 + size: 44, 44 + orig: 44, 44 + offset: 0, 0 + index: -1 +tree-minus + rotate: false + xy: 71, 59 + size: 10, 10 + orig: 16, 16 + offset: 2, 4 + index: -1 +tree-plus + rotate: false + xy: 567, 404 + size: 12, 16 + orig: 16, 16 + offset: 2, 0 + index: -1 +tree-selection + rotate: false + xy: 630, 436 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +vis-check-down + rotate: false + xy: 972, 482 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +vis-check-tick + rotate: false + xy: 672, 450 + size: 19, 19 + orig: 28, 28 + offset: 5, 4 + index: -1 +vis-check-tick-disabled + rotate: false + xy: 692, 450 + size: 19, 19 + orig: 28, 28 + offset: 5, 4 + index: -1 +vis-radio-down + rotate: false + xy: 344, 74 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +vis-radio-over + rotate: false + xy: 373, 74 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +vis-radio-tick + rotate: false + xy: 56, 55 + size: 14, 14 + orig: 28, 28 + offset: 7, 7 + index: -1 +vis-radio-tick-disabled + rotate: false + xy: 712, 455 + size: 14, 14 + orig: 28, 28 + offset: 7, 7 + index: -1 +vis-red + rotate: false + xy: 568, 391 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +white + rotate: false + xy: 645, 445 + size: 3, 3 + orig: 3, 3 + offset: 0, 0 + index: -1 +window + rotate: false + xy: 539, 404 + size: 27, 61 + split: 5, 4, 53, 3 + orig: 27, 61 + offset: 0, 0 + index: -1 +window-border-bg + rotate: false + xy: 550, 348 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +window-noborder + rotate: false + xy: 511, 364 + size: 27, 61 + split: 5, 4, 53, 3 + orig: 27, 61 + offset: 0, 0 + index: -1 +window-resizable + rotate: false + xy: 511, 426 + size: 27, 84 + split: 3, 19, 2, 20 + pad: 5, 5, 50, 7 + orig: 27, 84 + offset: 0, 0 + index: -1 \ No newline at end of file diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/atlases/vis-ui.png b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/atlases/vis-ui.png new file mode 100644 index 0000000..dd4ea0c Binary files /dev/null and b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/atlases/vis-ui.png differ diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/fonts/EvilEmpire.ttf b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/fonts/EvilEmpire.ttf new file mode 100644 index 0000000..762a579 Binary files /dev/null and b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/fonts/EvilEmpire.ttf differ diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/fonts/EvilEmpire.ttf.params.yaml b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/fonts/EvilEmpire.ttf.params.yaml new file mode 100644 index 0000000..a85f601 --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/fonts/EvilEmpire.ttf.params.yaml @@ -0,0 +1,8 @@ +defaults: {} +bigs: + size: 50 + color: + r: 0 + g: 0 + b: 1 + a: 1 \ No newline at end of file diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/fonts/exo.fnt b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/fonts/exo.fnt new file mode 100644 index 0000000..f3a4575 --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/fonts/exo.fnt @@ -0,0 +1,229 @@ +info face="exo" size=48 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=2 padding=0,0,0,0 spacing=0,0 +common lineHeight=54 base=40 scaleW=1 scaleH=1 pages=1 packed=0 alphaChnl=0 redChnl=0 greenChnl=0 blueChnl=0 +page id=0 file="exo.png" +chars count=224 +char id=32 x=0 y=0 width=0 height=0 xoffset=0 yoffset=0 xadvance=29 page=0 chnl=0 +char id=33 x=26 y=330 width=5 height=32 xoffset=12 yoffset=8 xadvance=29 page=0 chnl=0 +char id=34 x=64 y=192 width=17 height=16 xoffset=6 yoffset=5 xadvance=29 page=0 chnl=0 +char id=35 x=323 y=80 width=27 height=32 xoffset=1 yoffset=8 xadvance=29 page=0 chnl=0 +char id=36 x=140 y=204 width=26 height=39 xoffset=1 yoffset=5 xadvance=29 page=0 chnl=0 +char id=37 x=232 y=80 width=29 height=33 xoffset=0 yoffset=8 xadvance=29 page=0 chnl=0 +char id=38 x=388 y=80 width=27 height=33 xoffset=1 yoffset=8 xadvance=29 page=0 chnl=0 +char id=39 x=64 y=223 width=7 height=16 xoffset=11 yoffset=5 xadvance=29 page=0 chnl=0 +char id=40 x=64 y=303 width=13 height=45 xoffset=8 yoffset=5 xadvance=29 page=0 chnl=0 +char id=41 x=64 y=352 width=14 height=45 xoffset=7 yoffset=5 xadvance=29 page=0 chnl=0 +char id=42 x=354 y=88 width=18 height=18 xoffset=5 yoffset=5 xadvance=29 page=0 chnl=0 +char id=43 x=265 y=80 width=25 height=24 xoffset=2 yoffset=12 xadvance=29 page=0 chnl=0 +char id=44 x=64 y=243 width=11 height=17 xoffset=6 yoffset=32 xadvance=29 page=0 chnl=0 +char id=45 x=116 y=71 width=14 height=5 xoffset=7 yoffset=25 xadvance=29 page=0 chnl=0 +char id=46 x=75 y=223 width=7 height=8 xoffset=11 yoffset=32 xadvance=29 page=0 chnl=0 +char id=47 x=140 y=118 width=25 height=36 xoffset=2 yoffset=5 xadvance=29 page=0 chnl=0 +char id=48 x=91 y=80 width=24 height=34 xoffset=2 yoffset=7 xadvance=29 page=0 chnl=0 +char id=49 x=342 y=40 width=24 height=32 xoffset=3 yoffset=8 xadvance=29 page=0 chnl=0 +char id=50 x=370 y=40 width=23 height=33 xoffset=3 yoffset=7 xadvance=29 page=0 chnl=0 +char id=51 x=397 y=40 width=23 height=34 xoffset=3 yoffset=7 xadvance=29 page=0 chnl=0 +char id=52 x=424 y=40 width=25 height=32 xoffset=2 yoffset=8 xadvance=29 page=0 chnl=0 +char id=53 x=453 y=40 width=23 height=33 xoffset=3 yoffset=8 xadvance=29 page=0 chnl=0 +char id=54 x=480 y=40 width=23 height=34 xoffset=3 yoffset=7 xadvance=29 page=0 chnl=0 +char id=55 x=64 y=80 width=23 height=32 xoffset=3 yoffset=8 xadvance=29 page=0 chnl=0 +char id=56 x=64 y=116 width=23 height=34 xoffset=3 yoffset=7 xadvance=29 page=0 chnl=0 +char id=57 x=64 y=154 width=23 height=34 xoffset=3 yoffset=7 xadvance=29 page=0 chnl=0 +char id=58 x=79 y=264 width=7 height=26 xoffset=11 yoffset=14 xadvance=29 page=0 chnl=0 +char id=59 x=64 y=264 width=11 height=35 xoffset=8 yoffset=14 xadvance=29 page=0 chnl=0 +char id=60 x=147 y=80 width=25 height=25 xoffset=2 yoffset=12 xadvance=29 page=0 chnl=0 +char id=61 x=294 y=80 width=25 height=16 xoffset=2 yoffset=16 xadvance=29 page=0 chnl=0 +char id=62 x=176 y=80 width=25 height=25 xoffset=2 yoffset=12 xadvance=29 page=0 chnl=0 +char id=63 x=119 y=80 width=24 height=33 xoffset=2 yoffset=7 xadvance=29 page=0 chnl=0 +char id=64 x=140 y=158 width=27 height=42 xoffset=1 yoffset=5 xadvance=29 page=0 chnl=0 +char id=65 x=2 y=2 width=29 height=32 xoffset=0 yoffset=8 xadvance=29 page=0 chnl=0 +char id=66 x=2 y=38 width=24 height=32 xoffset=3 yoffset=8 xadvance=29 page=0 chnl=0 +char id=67 x=2 y=74 width=25 height=34 xoffset=2 yoffset=7 xadvance=29 page=0 chnl=0 +char id=68 x=2 y=112 width=24 height=32 xoffset=3 yoffset=8 xadvance=29 page=0 chnl=0 +char id=69 x=2 y=148 width=24 height=32 xoffset=3 yoffset=8 xadvance=29 page=0 chnl=0 +char id=70 x=2 y=184 width=22 height=32 xoffset=4 yoffset=8 xadvance=29 page=0 chnl=0 +char id=71 x=2 y=220 width=24 height=34 xoffset=2 yoffset=7 xadvance=29 page=0 chnl=0 +char id=72 x=2 y=258 width=22 height=32 xoffset=3 yoffset=8 xadvance=29 page=0 chnl=0 +char id=73 x=2 y=294 width=21 height=32 xoffset=4 yoffset=8 xadvance=29 page=0 chnl=0 +char id=74 x=2 y=330 width=20 height=33 xoffset=4 yoffset=8 xadvance=29 page=0 chnl=0 +char id=75 x=2 y=367 width=26 height=32 xoffset=3 yoffset=8 xadvance=29 page=0 chnl=0 +char id=76 x=2 y=403 width=21 height=32 xoffset=5 yoffset=8 xadvance=29 page=0 chnl=0 +char id=77 x=2 y=439 width=23 height=32 xoffset=3 yoffset=8 xadvance=29 page=0 chnl=0 +char id=78 x=2 y=475 width=22 height=32 xoffset=3 yoffset=8 xadvance=29 page=0 chnl=0 +char id=79 x=35 y=2 width=25 height=34 xoffset=2 yoffset=7 xadvance=29 page=0 chnl=0 +char id=80 x=64 y=2 width=24 height=32 xoffset=3 yoffset=8 xadvance=29 page=0 chnl=0 +char id=81 x=35 y=40 width=25 height=43 xoffset=2 yoffset=7 xadvance=29 page=0 chnl=0 +char id=82 x=92 y=2 width=25 height=32 xoffset=3 yoffset=8 xadvance=29 page=0 chnl=0 +char id=83 x=121 y=2 width=26 height=34 xoffset=1 yoffset=7 xadvance=29 page=0 chnl=0 +char id=84 x=151 y=2 width=26 height=32 xoffset=1 yoffset=8 xadvance=29 page=0 chnl=0 +char id=85 x=181 y=2 width=23 height=33 xoffset=3 yoffset=8 xadvance=29 page=0 chnl=0 +char id=86 x=208 y=2 width=29 height=32 xoffset=0 yoffset=8 xadvance=29 page=0 chnl=0 +char id=87 x=241 y=2 width=29 height=32 xoffset=0 yoffset=8 xadvance=29 page=0 chnl=0 +char id=88 x=274 y=2 width=28 height=32 xoffset=0 yoffset=8 xadvance=29 page=0 chnl=0 +char id=89 x=306 y=2 width=28 height=32 xoffset=0 yoffset=8 xadvance=29 page=0 chnl=0 +char id=90 x=338 y=2 width=27 height=32 xoffset=1 yoffset=8 xadvance=29 page=0 chnl=0 +char id=91 x=64 y=401 width=14 height=45 xoffset=9 yoffset=5 xadvance=29 page=0 chnl=0 +char id=92 x=169 y=118 width=25 height=36 xoffset=2 yoffset=5 xadvance=29 page=0 chnl=0 +char id=93 x=64 y=450 width=14 height=45 xoffset=6 yoffset=5 xadvance=29 page=0 chnl=0 +char id=94 x=205 y=80 width=23 height=22 xoffset=3 yoffset=8 xadvance=29 page=0 chnl=0 +char id=95 x=354 y=80 width=30 height=4 xoffset=-1 yoffset=42 xadvance=29 page=0 chnl=0 +char id=96 x=64 y=212 width=11 height=7 xoffset=9 yoffset=5 xadvance=29 page=0 chnl=0 +char id=97 x=369 y=2 width=25 height=27 xoffset=3 yoffset=14 xadvance=29 page=0 chnl=0 +char id=98 x=35 y=87 width=22 height=36 xoffset=4 yoffset=5 xadvance=29 page=0 chnl=0 +char id=99 x=398 y=2 width=23 height=27 xoffset=3 yoffset=14 xadvance=29 page=0 chnl=0 +char id=100 x=35 y=127 width=22 height=36 xoffset=3 yoffset=5 xadvance=29 page=0 chnl=0 +char id=101 x=425 y=2 width=23 height=27 xoffset=3 yoffset=14 xadvance=29 page=0 chnl=0 +char id=102 x=35 y=167 width=23 height=35 xoffset=3 yoffset=5 xadvance=29 page=0 chnl=0 +char id=103 x=35 y=206 width=22 height=36 xoffset=3 yoffset=14 xadvance=29 page=0 chnl=0 +char id=104 x=35 y=246 width=21 height=35 xoffset=4 yoffset=5 xadvance=29 page=0 chnl=0 +char id=105 x=35 y=285 width=24 height=35 xoffset=3 yoffset=5 xadvance=29 page=0 chnl=0 +char id=106 x=35 y=324 width=18 height=45 xoffset=2 yoffset=5 xadvance=29 page=0 chnl=0 +char id=107 x=35 y=373 width=22 height=35 xoffset=5 yoffset=5 xadvance=29 page=0 chnl=0 +char id=108 x=35 y=412 width=24 height=35 xoffset=3 yoffset=5 xadvance=29 page=0 chnl=0 +char id=109 x=452 y=2 width=25 height=26 xoffset=2 yoffset=14 xadvance=29 page=0 chnl=0 +char id=110 x=481 y=2 width=21 height=26 xoffset=4 yoffset=14 xadvance=29 page=0 chnl=0 +char id=111 x=35 y=451 width=23 height=27 xoffset=3 yoffset=14 xadvance=29 page=0 chnl=0 +char id=112 x=64 y=40 width=22 height=36 xoffset=4 yoffset=14 xadvance=29 page=0 chnl=0 +char id=113 x=90 y=40 width=22 height=36 xoffset=3 yoffset=14 xadvance=29 page=0 chnl=0 +char id=114 x=35 y=482 width=20 height=26 xoffset=5 yoffset=14 xadvance=29 page=0 chnl=0 +char id=115 x=116 y=40 width=22 height=27 xoffset=3 yoffset=14 xadvance=29 page=0 chnl=0 +char id=116 x=142 y=40 width=20 height=33 xoffset=4 yoffset=8 xadvance=29 page=0 chnl=0 +char id=117 x=166 y=40 width=21 height=27 xoffset=4 yoffset=14 xadvance=29 page=0 chnl=0 +char id=118 x=191 y=40 width=27 height=26 xoffset=1 yoffset=14 xadvance=29 page=0 chnl=0 +char id=119 x=222 y=40 width=29 height=26 xoffset=0 yoffset=14 xadvance=29 page=0 chnl=0 +char id=120 x=255 y=40 width=25 height=26 xoffset=2 yoffset=14 xadvance=29 page=0 chnl=0 +char id=121 x=284 y=40 width=27 height=36 xoffset=1 yoffset=14 xadvance=29 page=0 chnl=0 +char id=122 x=315 y=40 width=23 height=26 xoffset=3 yoffset=14 xadvance=29 page=0 chnl=0 +char id=123 x=91 y=118 width=20 height=45 xoffset=5 yoffset=5 xadvance=29 page=0 chnl=0 +char id=124 x=81 y=303 width=5 height=45 xoffset=12 yoffset=5 xadvance=29 page=0 chnl=0 +char id=125 x=115 y=118 width=21 height=45 xoffset=3 yoffset=5 xadvance=29 page=0 chnl=0 +char id=126 x=294 y=100 width=25 height=7 xoffset=2 yoffset=21 xadvance=29 page=0 chnl=0 +char id=127 x=419 y=80 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=128 x=443 y=80 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=129 x=467 y=80 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=130 x=91 y=167 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=131 x=91 y=189 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=132 x=91 y=211 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=133 x=91 y=233 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=134 x=91 y=255 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=135 x=91 y=277 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=136 x=91 y=299 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=137 x=91 y=321 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=138 x=91 y=343 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=139 x=91 y=365 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=140 x=91 y=387 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=141 x=91 y=409 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=142 x=91 y=431 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=143 x=91 y=453 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=144 x=91 y=475 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=145 x=115 y=167 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=146 x=115 y=189 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=147 x=115 y=211 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=148 x=115 y=233 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=149 x=115 y=255 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=150 x=115 y=277 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=151 x=115 y=299 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=152 x=115 y=321 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=153 x=115 y=343 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=154 x=115 y=365 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=155 x=115 y=387 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=156 x=115 y=409 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=157 x=115 y=431 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=158 x=115 y=453 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=159 x=115 y=475 width=20 height=18 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=160 x=30 y=38 width=0 height=0 xoffset=0 yoffset=40 xadvance=29 page=0 chnl=0 +char id=161 x=82 y=352 width=5 height=33 xoffset=12 yoffset=14 xadvance=29 page=0 chnl=0 +char id=162 x=198 y=118 width=23 height=35 xoffset=3 yoffset=7 xadvance=29 page=0 chnl=0 +char id=163 x=225 y=118 width=27 height=33 xoffset=1 yoffset=7 xadvance=29 page=0 chnl=0 +char id=164 x=256 y=118 width=23 height=22 xoffset=3 yoffset=13 xadvance=29 page=0 chnl=0 +char id=165 x=283 y=118 width=27 height=32 xoffset=1 yoffset=8 xadvance=29 page=0 chnl=0 +char id=166 x=140 y=247 width=5 height=46 xoffset=12 yoffset=5 xadvance=29 page=0 chnl=0 +char id=167 x=140 y=297 width=23 height=40 xoffset=3 yoffset=5 xadvance=29 page=0 chnl=0 +char id=168 x=166 y=71 width=14 height=5 xoffset=7 yoffset=7 xadvance=29 page=0 chnl=0 +char id=169 x=314 y=118 width=29 height=35 xoffset=0 yoffset=5 xadvance=29 page=0 chnl=0 +char id=170 x=347 y=118 width=20 height=19 xoffset=4 yoffset=6 xadvance=29 page=0 chnl=0 +char id=171 x=371 y=118 width=25 height=20 xoffset=2 yoffset=17 xadvance=29 page=0 chnl=0 +char id=172 x=400 y=118 width=25 height=14 xoffset=2 yoffset=22 xadvance=29 page=0 chnl=0 +char id=173 x=191 y=70 width=14 height=5 xoffset=7 yoffset=25 xadvance=29 page=0 chnl=0 +char id=174 x=429 y=118 width=29 height=35 xoffset=0 yoffset=5 xadvance=29 page=0 chnl=0 +char id=175 x=462 y=118 width=30 height=4 xoffset=-1 yoffset=1 xadvance=29 page=0 chnl=0 +char id=176 x=491 y=80 width=15 height=15 xoffset=7 yoffset=7 xadvance=29 page=0 chnl=0 +char id=177 x=140 y=341 width=25 height=29 xoffset=2 yoffset=11 xadvance=29 page=0 chnl=0 +char id=178 x=462 y=126 width=15 height=21 xoffset=7 yoffset=6 xadvance=29 page=0 chnl=0 +char id=179 x=481 y=126 width=15 height=22 xoffset=7 yoffset=6 xadvance=29 page=0 chnl=0 +char id=180 x=64 y=499 width=11 height=7 xoffset=9 yoffset=5 xadvance=29 page=0 chnl=0 +char id=181 x=140 y=374 width=23 height=36 xoffset=3 yoffset=14 xadvance=29 page=0 chnl=0 +char id=182 x=140 y=414 width=24 height=40 xoffset=2 yoffset=8 xadvance=29 page=0 chnl=0 +char id=183 x=79 y=243 width=7 height=8 xoffset=11 yoffset=23 xadvance=29 page=0 chnl=0 +char id=184 x=419 y=102 width=10 height=11 xoffset=2 yoffset=40 xadvance=29 page=0 chnl=0 +char id=185 x=149 y=247 width=16 height=21 xoffset=6 yoffset=6 xadvance=29 page=0 chnl=0 +char id=186 x=140 y=458 width=19 height=19 xoffset=5 yoffset=6 xadvance=29 page=0 chnl=0 +char id=187 x=140 y=481 width=24 height=20 xoffset=2 yoffset=17 xadvance=29 page=0 chnl=0 +char id=188 x=171 y=158 width=30 height=33 xoffset=0 yoffset=8 xadvance=29 page=0 chnl=0 +char id=189 x=205 y=158 width=29 height=33 xoffset=0 yoffset=8 xadvance=29 page=0 chnl=0 +char id=190 x=238 y=158 width=30 height=33 xoffset=0 yoffset=8 xadvance=29 page=0 chnl=0 +char id=191 x=272 y=158 width=24 height=33 xoffset=3 yoffset=14 xadvance=29 page=0 chnl=0 +char id=192 x=171 y=195 width=29 height=41 xoffset=0 yoffset=-1 xadvance=29 page=0 chnl=0 +char id=193 x=171 y=240 width=29 height=41 xoffset=0 yoffset=-1 xadvance=29 page=0 chnl=0 +char id=194 x=171 y=285 width=29 height=41 xoffset=0 yoffset=-1 xadvance=29 page=0 chnl=0 +char id=195 x=171 y=330 width=29 height=40 xoffset=0 yoffset=0 xadvance=29 page=0 chnl=0 +char id=196 x=171 y=374 width=29 height=38 xoffset=0 yoffset=2 xadvance=29 page=0 chnl=0 +char id=197 x=171 y=416 width=29 height=39 xoffset=0 yoffset=1 xadvance=29 page=0 chnl=0 +char id=198 x=300 y=158 width=29 height=32 xoffset=0 yoffset=8 xadvance=29 page=0 chnl=0 +char id=199 x=171 y=459 width=25 height=44 xoffset=2 yoffset=7 xadvance=29 page=0 chnl=0 +char id=200 x=204 y=195 width=24 height=41 xoffset=3 yoffset=-1 xadvance=29 page=0 chnl=0 +char id=201 x=204 y=240 width=24 height=41 xoffset=3 yoffset=-1 xadvance=29 page=0 chnl=0 +char id=202 x=204 y=285 width=24 height=41 xoffset=3 yoffset=-1 xadvance=29 page=0 chnl=0 +char id=203 x=204 y=330 width=24 height=38 xoffset=3 yoffset=2 xadvance=29 page=0 chnl=0 +char id=204 x=204 y=372 width=21 height=41 xoffset=4 yoffset=-1 xadvance=29 page=0 chnl=0 +char id=205 x=204 y=417 width=21 height=41 xoffset=4 yoffset=-1 xadvance=29 page=0 chnl=0 +char id=206 x=204 y=462 width=21 height=41 xoffset=4 yoffset=-1 xadvance=29 page=0 chnl=0 +char id=207 x=232 y=195 width=21 height=38 xoffset=4 yoffset=2 xadvance=29 page=0 chnl=0 +char id=208 x=333 y=158 width=27 height=32 xoffset=0 yoffset=8 xadvance=29 page=0 chnl=0 +char id=209 x=232 y=237 width=22 height=40 xoffset=3 yoffset=0 xadvance=29 page=0 chnl=0 +char id=210 x=258 y=237 width=25 height=42 xoffset=2 yoffset=-1 xadvance=29 page=0 chnl=0 +char id=211 x=287 y=237 width=25 height=42 xoffset=2 yoffset=-1 xadvance=29 page=0 chnl=0 +char id=212 x=316 y=237 width=25 height=42 xoffset=2 yoffset=-1 xadvance=29 page=0 chnl=0 +char id=213 x=345 y=237 width=25 height=41 xoffset=2 yoffset=0 xadvance=29 page=0 chnl=0 +char id=214 x=374 y=237 width=25 height=39 xoffset=2 yoffset=2 xadvance=29 page=0 chnl=0 +char id=215 x=364 y=158 width=23 height=22 xoffset=3 yoffset=13 xadvance=29 page=0 chnl=0 +char id=216 x=257 y=195 width=27 height=34 xoffset=1 yoffset=7 xadvance=29 page=0 chnl=0 +char id=217 x=403 y=237 width=23 height=42 xoffset=3 yoffset=-1 xadvance=29 page=0 chnl=0 +char id=218 x=430 y=237 width=23 height=42 xoffset=3 yoffset=-1 xadvance=29 page=0 chnl=0 +char id=219 x=457 y=237 width=23 height=42 xoffset=3 yoffset=-1 xadvance=29 page=0 chnl=0 +char id=220 x=484 y=237 width=23 height=39 xoffset=3 yoffset=2 xadvance=29 page=0 chnl=0 +char id=221 x=258 y=283 width=28 height=41 xoffset=0 yoffset=-1 xadvance=29 page=0 chnl=0 +char id=222 x=391 y=158 width=24 height=32 xoffset=3 yoffset=8 xadvance=29 page=0 chnl=0 +char id=223 x=288 y=195 width=25 height=36 xoffset=3 yoffset=5 xadvance=29 page=0 chnl=0 +char id=224 x=317 y=195 width=25 height=36 xoffset=3 yoffset=5 xadvance=29 page=0 chnl=0 +char id=225 x=346 y=195 width=25 height=36 xoffset=3 yoffset=5 xadvance=29 page=0 chnl=0 +char id=226 x=375 y=195 width=25 height=36 xoffset=3 yoffset=5 xadvance=29 page=0 chnl=0 +char id=227 x=404 y=195 width=25 height=35 xoffset=3 yoffset=6 xadvance=29 page=0 chnl=0 +char id=228 x=433 y=195 width=25 height=34 xoffset=3 yoffset=7 xadvance=29 page=0 chnl=0 +char id=229 x=462 y=195 width=25 height=38 xoffset=3 yoffset=3 xadvance=29 page=0 chnl=0 +char id=230 x=419 y=158 width=29 height=27 xoffset=0 yoffset=14 xadvance=29 page=0 chnl=0 +char id=231 x=258 y=328 width=23 height=37 xoffset=3 yoffset=14 xadvance=29 page=0 chnl=0 +char id=232 x=258 y=369 width=23 height=36 xoffset=3 yoffset=5 xadvance=29 page=0 chnl=0 +char id=233 x=258 y=409 width=23 height=36 xoffset=3 yoffset=5 xadvance=29 page=0 chnl=0 +char id=234 x=258 y=449 width=23 height=36 xoffset=3 yoffset=5 xadvance=29 page=0 chnl=0 +char id=235 x=290 y=283 width=23 height=34 xoffset=3 yoffset=7 xadvance=29 page=0 chnl=0 +char id=236 x=317 y=283 width=24 height=35 xoffset=3 yoffset=5 xadvance=29 page=0 chnl=0 +char id=237 x=345 y=283 width=24 height=35 xoffset=3 yoffset=5 xadvance=29 page=0 chnl=0 +char id=238 x=373 y=283 width=24 height=35 xoffset=3 yoffset=5 xadvance=29 page=0 chnl=0 +char id=239 x=452 y=158 width=24 height=33 xoffset=3 yoffset=7 xadvance=29 page=0 chnl=0 +char id=240 x=317 y=322 width=24 height=37 xoffset=2 yoffset=4 xadvance=29 page=0 chnl=0 +char id=241 x=232 y=281 width=21 height=34 xoffset=4 yoffset=6 xadvance=29 page=0 chnl=0 +char id=242 x=290 y=321 width=23 height=36 xoffset=3 yoffset=5 xadvance=29 page=0 chnl=0 +char id=243 x=290 y=361 width=23 height=36 xoffset=3 yoffset=5 xadvance=29 page=0 chnl=0 +char id=244 x=290 y=401 width=23 height=36 xoffset=3 yoffset=5 xadvance=29 page=0 chnl=0 +char id=245 x=290 y=441 width=23 height=35 xoffset=3 yoffset=6 xadvance=29 page=0 chnl=0 +char id=246 x=401 y=283 width=23 height=34 xoffset=3 yoffset=7 xadvance=29 page=0 chnl=0 +char id=247 x=480 y=158 width=25 height=22 xoffset=2 yoffset=13 xadvance=29 page=0 chnl=0 +char id=248 x=428 y=283 width=25 height=27 xoffset=2 yoffset=14 xadvance=29 page=0 chnl=0 +char id=249 x=232 y=319 width=21 height=36 xoffset=4 yoffset=5 xadvance=29 page=0 chnl=0 +char id=250 x=232 y=359 width=21 height=36 xoffset=4 yoffset=5 xadvance=29 page=0 chnl=0 +char id=251 x=232 y=399 width=21 height=36 xoffset=4 yoffset=5 xadvance=29 page=0 chnl=0 +char id=252 x=232 y=439 width=21 height=34 xoffset=4 yoffset=7 xadvance=29 page=0 chnl=0 +char id=253 x=345 y=322 width=27 height=45 xoffset=1 yoffset=5 xadvance=29 page=0 chnl=0 +char id=254 x=317 y=363 width=22 height=45 xoffset=4 yoffset=5 xadvance=29 page=0 chnl=0 +char id=255 x=376 y=322 width=27 height=43 xoffset=1 yoffset=7 xadvance=29 page=0 chnl=0 +kernings count=0 \ No newline at end of file diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/fonts/exo.fnt.params.yaml b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/fonts/exo.fnt.params.yaml new file mode 100644 index 0000000..e974670 --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/fonts/exo.fnt.params.yaml @@ -0,0 +1 @@ +flip: true \ No newline at end of file diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/fonts/exo.png b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/fonts/exo.png new file mode 100644 index 0000000..9b9e692 Binary files /dev/null and b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/fonts/exo.png differ diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/music/setuniman__music-box.mp3 b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/music/setuniman__music-box.mp3 new file mode 100644 index 0000000..73d6f76 Binary files /dev/null and b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/music/setuniman__music-box.mp3 differ diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/scenes/two-person.yaml b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/scenes/two-person.yaml new file mode 100644 index 0000000..395adb6 --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/scenes/two-person.yaml @@ -0,0 +1,17 @@ +entities: + - type: map + name: map + - type: person + name: person1 + components: + placement: + x: 1 + y: 1 + size: 1 + - type: person + name: person2 + components: + placement: + x: 8 + y: 8 + size: 1 \ No newline at end of file diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/glassy/font-big-export.fnt b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/glassy/font-big-export.fnt new file mode 100644 index 0000000..e4a3779 --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/glassy/font-big-export.fnt @@ -0,0 +1,104 @@ +info face="font-big-export" size=32 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 +common lineHeight=60 base=60 scaleW=341 scaleH=350 pages=1 packed=0 alphaChnl=1 redChnl=0 greenChnl=0 blueChnl=0 +page id=0 file="font-big-export.png" +chars count=98 +char id=33 x=332 y=299 width=8 height=46 xoffset=0 yoffset=14 xadvance=11 page=0 chnl=0 letter="!" +char id=34 x=235 y=326 width=16 height=14 xoffset=0 yoffset=14 xadvance=19 page=0 chnl=0 letter=""" +char id=35 x=126 y=0 width=33 height=45 xoffset=0 yoffset=14 xadvance=36 page=0 chnl=0 letter="#" +char id=36 x=224 y=92 width=29 height=57 xoffset=0 yoffset=12 xadvance=32 page=0 chnl=0 letter="$" +char id=37 x=47 y=255 width=43 height=49 xoffset=0 yoffset=13 xadvance=46 page=0 chnl=0 letter="%" +char id=38 x=51 y=90 width=39 height=44 xoffset=0 yoffset=16 xadvance=42 page=0 chnl=0 letter="&" +char id=39 x=252 y=334 width=4 height=14 xoffset=0 yoffset=14 xadvance=7 page=0 chnl=0 letter="'" +char id=40 x=321 y=0 width=11 height=58 xoffset=0 yoffset=13 xadvance=14 page=0 chnl=0 letter="(" +char id=41 x=320 y=288 width=11 height=58 xoffset=0 yoffset=13 xadvance=14 page=0 chnl=0 letter=")" +char id=42 x=193 y=324 width=21 height=21 xoffset=0 yoffset=14 xadvance=24 page=0 chnl=0 letter="*" +char id=43 x=160 y=135 width=31 height=30 xoffset=0 yoffset=22 xadvance=34 page=0 chnl=0 letter="+" +char id=44 x=81 y=135 width=9 height=14 xoffset=0 yoffset=50 xadvance=12 page=0 chnl=0 letter="," +char id=45 x=235 y=321 width=17 height=4 xoffset=0 yoffset=36 xadvance=20 page=0 chnl=0 letter="-" +char id=46 x=235 y=341 width=7 height=8 xoffset=0 yoffset=52 xadvance=10 page=0 chnl=0 letter="." +char id=47 x=280 y=137 width=23 height=51 xoffset=0 yoffset=14 xadvance=26 page=0 chnl=0 letter="/" +char id=48 x=193 y=0 width=30 height=45 xoffset=0 yoffset=15 xadvance=33 page=0 chnl=0 letter="0" +char id=49 x=306 y=230 width=11 height=44 xoffset=0 yoffset=16 xadvance=14 page=0 chnl=0 letter="1" +char id=50 x=193 y=233 width=30 height=44 xoffset=0 yoffset=15 xadvance=33 page=0 chnl=0 letter="2" +char id=51 x=193 y=46 width=29 height=45 xoffset=0 yoffset=15 xadvance=32 page=0 chnl=0 letter="3" +char id=52 x=192 y=135 width=31 height=44 xoffset=0 yoffset=15 xadvance=34 page=0 chnl=0 letter="4" +char id=53 x=223 y=46 width=29 height=45 xoffset=0 yoffset=15 xadvance=32 page=0 chnl=0 letter="5" +char id=54 x=253 y=196 width=27 height=45 xoffset=0 yoffset=15 xadvance=30 page=0 chnl=0 letter="6" +char id=55 x=224 y=0 width=28 height=45 xoffset=0 yoffset=15 xadvance=31 page=0 chnl=0 letter="7" +char id=56 x=193 y=278 width=30 height=45 xoffset=0 yoffset=15 xadvance=33 page=0 chnl=0 letter="8" +char id=57 x=253 y=46 width=27 height=45 xoffset=0 yoffset=15 xadvance=30 page=0 chnl=0 letter="9" +char id=58 x=330 y=216 width=8 height=35 xoffset=0 yoffset=25 xadvance=11 page=0 chnl=0 letter=":" +char id=59 x=323 y=176 width=9 height=39 xoffset=0 yoffset=25 xadvance=12 page=0 chnl=0 letter=";" +char id=60 x=128 y=209 width=31 height=32 xoffset=0 yoffset=21 xadvance=34 page=0 chnl=0 letter="<" +char id=61 x=192 y=214 width=30 height=18 xoffset=0 yoffset=28 xadvance=33 page=0 chnl=0 letter="=" +char id=62 x=160 y=209 width=31 height=32 xoffset=0 yoffset=21 xadvance=34 page=0 chnl=0 letter=">" +char id=63 x=253 y=242 width=26 height=46 xoffset=0 yoffset=14 xadvance=29 page=0 chnl=0 letter="?" +char id=64 x=47 y=207 width=45 height=47 xoffset=0 yoffset=13 xadvance=48 page=0 chnl=0 letter="@" +char id=65 x=47 y=305 width=42 height=44 xoffset=0 yoffset=15 xadvance=45 page=0 chnl=0 letter="A" +char id=66 x=160 y=294 width=32 height=44 xoffset=0 yoffset=15 xadvance=35 page=0 chnl=0 letter="B" +char id=67 x=48 y=159 width=42 height=45 xoffset=0 yoffset=15 xadvance=45 page=0 chnl=0 letter="C" +char id=68 x=53 y=0 width=37 height=44 xoffset=0 yoffset=15 xadvance=40 page=0 chnl=0 letter="D" +char id=69 x=254 y=126 width=25 height=44 xoffset=0 yoffset=16 xadvance=28 page=0 chnl=0 letter="E" +char id=70 x=279 y=289 width=25 height=44 xoffset=0 yoffset=16 xadvance=28 page=0 chnl=0 letter="F" +char id=71 x=0 y=255 width=46 height=45 xoffset=0 yoffset=15 xadvance=49 page=0 chnl=0 letter="G" +char id=72 x=160 y=45 width=32 height=44 xoffset=0 yoffset=16 xadvance=35 page=0 chnl=0 letter="H" +char id=73 x=334 y=104 width=5 height=44 xoffset=0 yoffset=16 xadvance=8 page=0 chnl=0 letter="I" +char id=74 x=305 y=288 width=14 height=57 xoffset=0 yoffset=15 xadvance=17 page=0 chnl=0 letter="J" +char id=75 x=160 y=90 width=32 height=44 xoffset=0 yoffset=16 xadvance=35 page=0 chnl=0 letter="K" +char id=76 x=281 y=189 width=22 height=44 xoffset=0 yoffset=15 xadvance=25 page=0 chnl=0 letter="L" +char id=77 x=0 y=45 width=50 height=44 xoffset=0 yoffset=16 xadvance=53 page=0 chnl=0 letter="M" +char id=78 x=90 y=305 width=35 height=44 xoffset=0 yoffset=16 xadvance=38 page=0 chnl=0 letter="N" +char id=79 x=0 y=301 width=46 height=45 xoffset=0 yoffset=15 xadvance=49 page=0 chnl=0 letter="O" +char id=80 x=224 y=231 width=28 height=44 xoffset=0 yoffset=15 xadvance=31 page=0 chnl=0 letter="P" +char id=81 x=0 y=207 width=46 height=47 xoffset=0 yoffset=15 xadvance=49 page=0 chnl=0 letter="Q" +char id=82 x=224 y=276 width=28 height=44 xoffset=0 yoffset=16 xadvance=31 page=0 chnl=0 letter="R" +char id=83 x=280 y=242 width=25 height=45 xoffset=0 yoffset=15 xadvance=28 page=0 chnl=0 letter="S" +char id=84 x=280 y=92 width=24 height=44 xoffset=0 yoffset=16 xadvance=27 page=0 chnl=0 letter="T" +char id=85 x=126 y=46 width=33 height=45 xoffset=0 yoffset=15 xadvance=36 page=0 chnl=0 letter="U" +char id=86 x=51 y=45 width=39 height=44 xoffset=0 yoffset=16 xadvance=42 page=0 chnl=0 letter="V" +char id=87 x=0 y=0 width=52 height=44 xoffset=0 yoffset=16 xadvance=55 page=0 chnl=0 letter="W" +char id=88 x=126 y=128 width=33 height=44 xoffset=0 yoffset=16 xadvance=36 page=0 chnl=0 letter="X" +char id=89 x=160 y=0 width=32 height=44 xoffset=0 yoffset=16 xadvance=35 page=0 chnl=0 letter="Y" +char id=90 x=253 y=289 width=25 height=44 xoffset=0 yoffset=16 xadvance=28 page=0 chnl=0 letter="Z" +char id=91 x=321 y=59 width=11 height=57 xoffset=0 yoffset=14 xadvance=14 page=0 chnl=0 letter="[" +char id=92 x=126 y=294 width=33 height=51 xoffset=0 yoffset=14 xadvance=36 page=0 chnl=0 letter="\" +char id=93 x=318 y=230 width=11 height=57 xoffset=0 yoffset=14 xadvance=14 page=0 chnl=0 letter="]" +char id=94 x=91 y=36 width=34 height=33 xoffset=0 yoffset=15 xadvance=37 page=0 chnl=0 letter="^" +char id=95 x=49 y=135 width=31 height=4 xoffset=0 yoffset=55 xadvance=34 page=0 chnl=0 letter="_" +char id=96 x=160 y=339 width=13 height=10 xoffset=0 yoffset=11 xadvance=16 page=0 chnl=0 letter="`" +char id=97 x=91 y=117 width=34 height=35 xoffset=0 yoffset=25 xadvance=37 page=0 chnl=0 letter="a" +char id=98 x=126 y=247 width=34 height=46 xoffset=0 yoffset=14 xadvance=37 page=0 chnl=0 letter="b" +char id=99 x=126 y=92 width=33 height=35 xoffset=0 yoffset=25 xadvance=36 page=0 chnl=0 letter="c" +char id=100 x=93 y=200 width=34 height=46 xoffset=0 yoffset=14 xadvance=37 page=0 chnl=0 letter="d" +char id=101 x=128 y=173 width=33 height=35 xoffset=0 yoffset=25 xadvance=36 page=0 chnl=0 letter="e" +char id=102 x=305 y=58 width=15 height=46 xoffset=0 yoffset=14 xadvance=18 page=0 chnl=0 letter="f" +char id=103 x=91 y=153 width=34 height=46 xoffset=0 yoffset=25 xadvance=37 page=0 chnl=0 letter="g" +char id=104 x=224 y=150 width=29 height=45 xoffset=0 yoffset=15 xadvance=32 page=0 chnl=0 letter="h" +char id=105 x=332 y=252 width=8 height=46 xoffset=0 yoffset=14 xadvance=11 page=0 chnl=0 letter="i" +char id=106 x=323 y=117 width=10 height=58 xoffset=0 yoffset=13 xadvance=13 page=0 chnl=0 letter="j" +char id=107 x=253 y=0 width=27 height=45 xoffset=0 yoffset=15 xadvance=30 page=0 chnl=0 letter="k" +char id=108 x=333 y=0 width=5 height=45 xoffset=0 yoffset=15 xadvance=8 page=0 chnl=0 letter="l" +char id=109 x=0 y=124 width=48 height=34 xoffset=0 yoffset=26 xadvance=51 page=0 chnl=0 letter="m" +char id=110 x=224 y=196 width=28 height=34 xoffset=0 yoffset=26 xadvance=31 page=0 chnl=0 letter="n" +char id=111 x=91 y=0 width=34 height=35 xoffset=0 yoffset=25 xadvance=37 page=0 chnl=0 letter="o" +char id=112 x=91 y=255 width=34 height=46 xoffset=0 yoffset=25 xadvance=37 page=0 chnl=0 letter="p" +char id=113 x=91 y=70 width=34 height=46 xoffset=0 yoffset=25 xadvance=37 page=0 chnl=0 letter="q" +char id=114 x=304 y=195 width=16 height=34 xoffset=0 yoffset=26 xadvance=19 page=0 chnl=0 letter="r" +char id=115 x=281 y=0 width=20 height=35 xoffset=0 yoffset=25 xadvance=23 page=0 chnl=0 letter="s" +char id=116 x=281 y=36 width=16 height=46 xoffset=0 yoffset=14 xadvance=19 page=0 chnl=0 letter="t" +char id=117 x=193 y=92 width=29 height=34 xoffset=0 yoffset=26 xadvance=32 page=0 chnl=0 letter="u" +char id=118 x=192 y=180 width=31 height=33 xoffset=0 yoffset=27 xadvance=34 page=0 chnl=0 letter="v" +char id=119 x=0 y=90 width=50 height=33 xoffset=0 yoffset=27 xadvance=53 page=0 chnl=0 letter="w" +char id=120 x=162 y=166 width=29 height=33 xoffset=0 yoffset=27 xadvance=32 page=0 chnl=0 letter="x" +char id=121 x=161 y=242 width=31 height=45 xoffset=0 yoffset=26 xadvance=34 page=0 chnl=0 letter="y" +char id=122 x=254 y=92 width=25 height=33 xoffset=0 yoffset=27 xadvance=28 page=0 chnl=0 letter="z" +char id=123 x=302 y=0 width=18 height=57 xoffset=0 yoffset=15 xadvance=21 page=0 chnl=0 letter="{" +char id=124 x=333 y=46 width=5 height=57 xoffset=0 yoffset=14 xadvance=8 page=0 chnl=0 letter="|" +char id=125 x=304 y=137 width=18 height=57 xoffset=0 yoffset=15 xadvance=21 page=0 chnl=0 letter="}" +char id=126 x=49 y=140 width=31 height=10 xoffset=0 yoffset=32 xadvance=34 page=0 chnl=0 letter="~" +char id=8226 x=215 y=324 width=19 height=19 xoffset=0 yoffset=34 xadvance=22 page=0 chnl=0 letter="•" +char id=169 x=0 y=159 width=47 height=47 xoffset=0 yoffset=13 xadvance=50 page=0 chnl=0 letter="©" +char id=32 x=0 y=0 width=0 height=0 xoffset=0 yoffset=0 xadvance=18 page=0 chnl=0 letter=" " +char id=9 x=0 y=0 width=0 height=0 xoffset=0 yoffset=0 xadvance=144 page=0 chnl=0 letter=" " + +kernings count=0 diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/glassy/font-export.fnt b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/glassy/font-export.fnt new file mode 100644 index 0000000..da78a49 --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/glassy/font-export.fnt @@ -0,0 +1,104 @@ +info face="font-export" size=32 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 +common lineHeight=19 base=19 scaleW=116 scaleH=117 pages=1 packed=0 alphaChnl=1 redChnl=0 greenChnl=0 blueChnl=0 +page id=0 file="font-export.png" +chars count=98 +char id=33 x=102 y=60 width=3 height=14 xoffset=0 yoffset=5 xadvance=4 page=0 chnl=0 letter="!" +char id=34 x=74 y=108 width=5 height=4 xoffset=0 yoffset=5 xadvance=6 page=0 chnl=0 letter=""" +char id=35 x=30 y=89 width=11 height=15 xoffset=0 yoffset=4 xadvance=12 page=0 chnl=0 letter="#" +char id=36 x=64 y=30 width=9 height=18 xoffset=0 yoffset=4 xadvance=10 page=0 chnl=0 letter="$" +char id=37 x=16 y=57 width=13 height=16 xoffset=0 yoffset=4 xadvance=14 page=0 chnl=0 letter="%" +char id=38 x=29 y=74 width=12 height=14 xoffset=0 yoffset=5 xadvance=13 page=0 chnl=0 letter="&" +char id=39 x=71 y=49 width=2 height=4 xoffset=0 yoffset=5 xadvance=3 page=0 chnl=0 letter="'" +char id=40 x=108 y=81 width=4 height=18 xoffset=0 yoffset=4 xadvance=5 page=0 chnl=0 letter="(" +char id=41 x=108 y=0 width=4 height=18 xoffset=0 yoffset=4 xadvance=5 page=0 chnl=0 letter=")" +char id=42 x=64 y=90 width=7 height=7 xoffset=0 yoffset=5 xadvance=8 page=0 chnl=0 letter="*" +char id=43 x=53 y=71 width=10 height=10 xoffset=0 yoffset=7 xadvance=11 page=0 chnl=0 letter="+" +char id=44 x=75 y=69 width=4 height=4 xoffset=0 yoffset=16 xadvance=5 page=0 chnl=0 letter="," +char id=45 x=42 y=102 width=6 height=2 xoffset=0 yoffset=11 xadvance=7 page=0 chnl=0 letter="-" +char id=46 x=75 y=74 width=3 height=3 xoffset=0 yoffset=16 xadvance=4 page=0 chnl=0 letter="." +char id=47 x=93 y=75 width=7 height=15 xoffset=0 yoffset=5 xadvance=8 page=0 chnl=0 letter="/" +char id=48 x=65 y=0 width=9 height=14 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=0 letter="0" +char id=49 x=102 y=45 width=4 height=14 xoffset=0 yoffset=5 xadvance=5 page=0 chnl=0 letter="1" +char id=50 x=63 y=56 width=10 height=14 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="2" +char id=51 x=75 y=0 width=9 height=14 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=0 letter="3" +char id=52 x=74 y=93 width=9 height=14 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=0 letter="4" +char id=53 x=84 y=15 width=9 height=14 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=0 letter="5" +char id=54 x=84 y=90 width=8 height=14 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="6" +char id=55 x=74 y=30 width=9 height=14 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=0 letter="7" +char id=56 x=42 y=87 width=10 height=14 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="8" +char id=57 x=93 y=45 width=8 height=14 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="9" +char id=58 x=108 y=32 width=2 height=11 xoffset=0 yoffset=8 xadvance=3 page=0 chnl=0 letter=":" +char id=59 x=108 y=19 width=3 height=12 xoffset=0 yoffset=8 xadvance=4 page=0 chnl=0 letter=";" +char id=60 x=53 y=30 width=10 height=10 xoffset=0 yoffset=7 xadvance=11 page=0 chnl=0 letter="<" +char id=61 x=64 y=71 width=10 height=6 xoffset=0 yoffset=9 xadvance=11 page=0 chnl=0 letter="=" +char id=62 x=52 y=102 width=10 height=10 xoffset=0 yoffset=7 xadvance=11 page=0 chnl=0 letter=">" +char id=63 x=93 y=60 width=8 height=14 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="?" +char id=64 x=15 y=101 width=14 height=15 xoffset=0 yoffset=4 xadvance=15 page=0 chnl=0 letter="@" +char id=65 x=16 y=27 width=13 height=14 xoffset=0 yoffset=5 xadvance=14 page=0 chnl=0 letter="A" +char id=66 x=30 y=0 width=11 height=14 xoffset=0 yoffset=5 xadvance=12 page=0 chnl=0 letter="B" +char id=67 x=16 y=42 width=13 height=14 xoffset=0 yoffset=5 xadvance=14 page=0 chnl=0 letter="C" +char id=68 x=17 y=0 width=12 height=14 xoffset=0 yoffset=5 xadvance=13 page=0 chnl=0 letter="D" +char id=69 x=84 y=75 width=8 height=14 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="E" +char id=70 x=93 y=30 width=8 height=14 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="F" +char id=71 x=0 y=59 width=15 height=14 xoffset=0 yoffset=5 xadvance=16 page=0 chnl=0 letter="G" +char id=72 x=63 y=98 width=10 height=14 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="H" +char id=73 x=108 y=100 width=2 height=14 xoffset=0 yoffset=5 xadvance=3 page=0 chnl=0 letter="I" +char id=74 x=102 y=27 width=5 height=17 xoffset=0 yoffset=5 xadvance=6 page=0 chnl=0 letter="J" +char id=75 x=54 y=0 width=10 height=14 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="K" +char id=76 x=93 y=91 width=7 height=14 xoffset=0 yoffset=5 xadvance=8 page=0 chnl=0 letter="L" +char id=77 x=0 y=74 width=15 height=14 xoffset=0 yoffset=5 xadvance=16 page=0 chnl=0 letter="M" +char id=78 x=30 y=30 width=11 height=14 xoffset=0 yoffset=5 xadvance=12 page=0 chnl=0 letter="N" +char id=79 x=0 y=101 width=14 height=14 xoffset=0 yoffset=5 xadvance=15 page=0 chnl=0 letter="O" +char id=80 x=74 y=15 width=9 height=14 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=0 letter="P" +char id=81 x=0 y=43 width=15 height=15 xoffset=0 yoffset=5 xadvance=16 page=0 chnl=0 letter="Q" +char id=82 x=74 y=78 width=9 height=14 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=0 letter="R" +char id=83 x=84 y=60 width=8 height=14 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="S" +char id=84 x=84 y=45 width=8 height=14 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="T" +char id=85 x=42 y=0 width=11 height=14 xoffset=0 yoffset=5 xadvance=12 page=0 chnl=0 letter="U" +char id=86 x=16 y=74 width=12 height=14 xoffset=0 yoffset=5 xadvance=13 page=0 chnl=0 letter="V" +char id=87 x=0 y=0 width=16 height=14 xoffset=0 yoffset=5 xadvance=17 page=0 chnl=0 letter="W" +char id=88 x=42 y=72 width=10 height=14 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="X" +char id=89 x=53 y=41 width=10 height=14 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="Y" +char id=90 x=85 y=0 width=8 height=14 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="Z" +char id=91 x=107 y=45 width=4 height=17 xoffset=0 yoffset=5 xadvance=5 page=0 chnl=0 letter="[" +char id=92 x=53 y=82 width=10 height=15 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="\" +char id=93 x=108 y=63 width=4 height=17 xoffset=0 yoffset=5 xadvance=5 page=0 chnl=0 letter="]" +char id=94 x=52 y=60 width=10 height=10 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="^" +char id=95 x=30 y=110 width=10 height=2 xoffset=0 yoffset=17 xadvance=11 page=0 chnl=0 letter="_" +char id=96 x=53 y=98 width=5 height=3 xoffset=0 yoffset=4 xadvance=6 page=0 chnl=0 letter="`" +char id=97 x=16 y=89 width=11 height=11 xoffset=0 yoffset=8 xadvance=12 page=0 chnl=0 letter="a" +char id=98 x=30 y=15 width=11 height=14 xoffset=0 yoffset=5 xadvance=12 page=0 chnl=0 letter="b" +char id=99 x=41 y=60 width=10 height=11 xoffset=0 yoffset=8 xadvance=11 page=0 chnl=0 letter="c" +char id=100 x=42 y=45 width=10 height=14 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="d" +char id=101 x=41 y=105 width=10 height=11 xoffset=0 yoffset=8 xadvance=11 page=0 chnl=0 letter="e" +char id=102 x=94 y=12 width=6 height=14 xoffset=0 yoffset=5 xadvance=7 page=0 chnl=0 letter="f" +char id=103 x=42 y=30 width=10 height=14 xoffset=0 yoffset=8 xadvance=11 page=0 chnl=0 letter="g" +char id=104 x=64 y=15 width=9 height=14 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=0 letter="h" +char id=105 x=113 y=56 width=2 height=14 xoffset=0 yoffset=5 xadvance=3 page=0 chnl=0 letter="i" +char id=106 x=112 y=19 width=3 height=18 xoffset=0 yoffset=4 xadvance=4 page=0 chnl=0 letter="j" +char id=107 x=84 y=30 width=8 height=14 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="k" +char id=108 x=111 y=100 width=2 height=14 xoffset=0 yoffset=5 xadvance=3 page=0 chnl=0 letter="l" +char id=109 x=0 y=15 width=16 height=11 xoffset=0 yoffset=8 xadvance=17 page=0 chnl=0 letter="m" +char id=110 x=74 y=45 width=9 height=11 xoffset=0 yoffset=8 xadvance=10 page=0 chnl=0 letter="n" +char id=111 x=17 y=15 width=11 height=11 xoffset=0 yoffset=8 xadvance=12 page=0 chnl=0 letter="o" +char id=112 x=42 y=15 width=10 height=14 xoffset=0 yoffset=8 xadvance=11 page=0 chnl=0 letter="p" +char id=113 x=30 y=45 width=11 height=14 xoffset=0 yoffset=8 xadvance=12 page=0 chnl=0 letter="q" +char id=114 x=94 y=0 width=6 height=11 xoffset=0 yoffset=8 xadvance=7 page=0 chnl=0 letter="r" +char id=115 x=101 y=0 width=6 height=11 xoffset=0 yoffset=8 xadvance=7 page=0 chnl=0 letter="s" +char id=116 x=101 y=12 width=5 height=14 xoffset=0 yoffset=5 xadvance=6 page=0 chnl=0 letter="t" +char id=117 x=74 y=57 width=9 height=11 xoffset=0 yoffset=8 xadvance=10 page=0 chnl=0 letter="u" +char id=118 x=30 y=60 width=10 height=11 xoffset=0 yoffset=8 xadvance=11 page=0 chnl=0 letter="v" +char id=119 x=0 y=89 width=15 height=11 xoffset=0 yoffset=8 xadvance=16 page=0 chnl=0 letter="w" +char id=120 x=64 y=78 width=9 height=11 xoffset=0 yoffset=8 xadvance=10 page=0 chnl=0 letter="x" +char id=121 x=53 y=15 width=10 height=14 xoffset=0 yoffset=8 xadvance=11 page=0 chnl=0 letter="y" +char id=122 x=84 y=105 width=8 height=11 xoffset=0 yoffset=8 xadvance=9 page=0 chnl=0 letter="z" +char id=123 x=101 y=94 width=6 height=18 xoffset=0 yoffset=5 xadvance=7 page=0 chnl=0 letter="{" +char id=124 x=112 y=38 width=2 height=17 xoffset=0 yoffset=5 xadvance=3 page=0 chnl=0 letter="|" +char id=125 x=101 y=75 width=6 height=18 xoffset=0 yoffset=5 xadvance=7 page=0 chnl=0 letter="}" +char id=126 x=30 y=105 width=10 height=4 xoffset=0 yoffset=10 xadvance=11 page=0 chnl=0 letter="~" +char id=8226 x=64 y=49 width=6 height=6 xoffset=0 yoffset=11 xadvance=7 page=0 chnl=0 letter="•" +char id=169 x=0 y=27 width=15 height=15 xoffset=0 yoffset=4 xadvance=16 page=0 chnl=0 letter="©" +char id=32 x=0 y=0 width=0 height=0 xoffset=0 yoffset=0 xadvance=6 page=0 chnl=0 letter=" " +char id=9 x=0 y=0 width=0 height=0 xoffset=0 yoffset=0 xadvance=48 page=0 chnl=0 letter=" " + +kernings count=0 diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/glassy/glassy-ui.atlas b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/glassy/glassy-ui.atlas new file mode 100644 index 0000000..0ecdc04 --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/glassy/glassy-ui.atlas @@ -0,0 +1,263 @@ + +glassy-ui.png +size: 1024,1024 +format: RGBA8888 +filter: Linear,Linear +repeat: none +button + rotate: false + xy: 1, 508 + size: 297, 106 + split: 49, 48, 52, 51 + pad: 28, 27, 7, 7 + orig: 297, 106 + offset: 0, 0 + index: -1 +button-down + rotate: false + xy: 344, 860 + size: 297, 106 + split: 49, 48, 52, 51 + pad: 28, 27, 7, 7 + orig: 297, 106 + offset: 0, 0 + index: -1 +button-small + rotate: false + xy: 1, 460 + size: 130, 46 + split: 21, 21, 22, 20 + orig: 130, 46 + offset: 0, 0 + index: -1 +button-small-down + rotate: false + xy: 344, 812 + size: 130, 46 + split: 21, 21, 22, 20 + orig: 130, 46 + offset: 0, 0 + index: -1 +checkbox + rotate: false + xy: 66, 319 + size: 25, 20 + orig: 25, 20 + offset: 0, 0 + index: -1 +checkbox-off + rotate: false + xy: 643, 923 + size: 25, 20 + orig: 25, 20 + offset: 0, 0 + index: -1 +font-big-export + rotate: false + xy: 1, 616 + size: 341, 350 + orig: 341, 350 + offset: 0, 0 + index: -1 +font-export + rotate: false + xy: 1, 341 + size: 116, 117 + orig: 116, 117 + offset: 0, 0 + index: -1 +horizontal-scroll-bar + rotate: false + xy: 643, 945 + size: 52, 21 + split: 14, 14, 9, 9 + pad: 8, 8, 5, 5 + orig: 52, 21 + offset: 0, 0 + index: -1 +horizontal-scroll-knob + rotate: false + xy: 133, 485 + size: 52, 21 + split: 14, 14, 10, 9 + pad: 0, 0, 0, 0 + orig: 52, 21 + offset: 0, 0 + index: -1 +horizontal-split-pane + rotate: false + xy: 119, 453 + size: 5, 5 + split: 2, 2, 1, 1 + pad: 0, 0, 0, 0 + orig: 5, 5 + offset: 0, 0 + index: -1 +list + rotate: false + xy: 35, 50 + size: 16, 15 + split: 4, 4, 4, 4 + pad: 4, 4, 2, 2 + orig: 16, 15 + offset: 0, 0 + index: -1 +minus + rotate: false + xy: 697, 946 + size: 25, 20 + orig: 25, 20 + offset: 0, 0 + index: -1 +plus + rotate: false + xy: 133, 463 + size: 25, 20 + orig: 25, 20 + offset: 0, 0 + index: -1 +progress-bar + rotate: false + xy: 300, 548 + size: 22, 32 + split: 7, 6, 6, 6 + pad: 3, 3, 3, 3 + orig: 22, 32 + offset: 0, 0 + index: -1 +progress-bar-knob + rotate: false + xy: 344, 732 + size: 1, 22 + split: 0, 0, 0, 21 + pad: 0, 0, 0, 0 + orig: 1, 22 + offset: 0, 0 + index: -1 +progress-bar-knob-vertical + rotate: false + xy: 476, 823 + size: 22, 1 + split: 0, 21, 0, 0 + pad: 0, 0, 0, 0 + orig: 22, 1 + offset: 0, 0 + index: -1 +progress-bar-vertical + rotate: false + xy: 1, 43 + size: 32, 22 + split: 6, 6, 7, 6 + pad: 3, 3, 3, 3 + orig: 32, 22 + offset: 0, 0 + index: -1 +radio-button + rotate: false + xy: 187, 486 + size: 25, 20 + orig: 25, 20 + offset: 0, 0 + index: -1 +radio-button-off + rotate: false + xy: 344, 756 + size: 25, 20 + orig: 25, 20 + offset: 0, 0 + index: -1 +select-box + rotate: false + xy: 344, 778 + size: 47, 32 + split: 4, 35, 28, 3 + pad: 7, 36, 3, 3 + orig: 47, 32 + offset: 0, 0 + index: -1 +select-box-down + rotate: false + xy: 476, 826 + size: 47, 32 + split: 4, 35, 28, 3 + pad: 3, 36, 3, 3 + orig: 47, 32 + offset: 0, 0 + index: -1 +slider + rotate: false + xy: 393, 778 + size: 25, 32 + split: 5, 5, 15, 14 + pad: 0, 0, 0, 0 + orig: 25, 32 + offset: 0, 0 + index: -1 +slider-knob + rotate: false + xy: 300, 582 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +slider-vertical + rotate: false + xy: 525, 826 + size: 25, 32 + split: 11, 11, 9, 7 + pad: 0, 0, 1, 0 + orig: 25, 32 + offset: 0, 0 + index: -1 +textfield + rotate: false + xy: 1, 1 + size: 22, 40 + split: 6, 6, 5, 5 + pad: 8, 8, 7, 7 + orig: 22, 40 + offset: 0, 0 + index: -1 +vertical-scroll-bar + rotate: false + xy: 66, 265 + size: 21, 52 + split: 9, 9, 14, 14 + pad: 5, 5, 8, 8 + orig: 21, 52 + offset: 0, 0 + index: -1 +vertical-scroll-knob + rotate: false + xy: 643, 869 + size: 21, 52 + split: 10, 9, 14, 14 + pad: 0, 0, 0, 0 + orig: 21, 52 + offset: 0, 0 + index: -1 +vertical-split-pane + rotate: false + xy: 334, 609 + size: 5, 5 + split: 1, 1, 2, 2 + pad: 0, 0, 0, 0 + orig: 5, 5 + offset: 0, 0 + index: -1 +white + rotate: false + xy: 93, 338 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +window + rotate: false + xy: 1, 67 + size: 63, 272 + split: 10, 10, 30, 0 + pad: 5, 5, 32, 24 + orig: 63, 272 + offset: 0, 0 + index: -1 diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/glassy/glassy-ui.json b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/glassy/glassy-ui.json new file mode 100644 index 0000000..2eaad5f --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/glassy/glassy-ui.json @@ -0,0 +1,213 @@ +{ +com.badlogic.gdx.graphics.g2d.BitmapFont: { + font: { + file: font-export.fnt + } + font-big: { + file: font-big-export.fnt + } +} +com.badlogic.gdx.graphics.Color: { + black: { + r: 0 + g: 0 + b: 0 + a: 1 + } + cyan: { + r: 0 + g: 1 + b: 0.99166656 + a: 1 + } + dark-cyan: { + r: 0 + g: 0.39373153 + b: 0.4333333 + a: 1 + } + white: { + r: 1 + g: 1 + b: 1 + a: 1 + } +} +com.badlogic.gdx.scenes.scene2d.ui.Skin$TintedDrawable: { + pale-blue: { + name: white + color: { + r: 0.48342222 + g: 0.76367503 + b: 0.99333334 + a: 1 + } + } + black: { + name: white + color: { + r: 0 + g: 0 + b: 0 + a: 1 + } + } +} +com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: { + default: { + up: button + down: button-down + } + small: { + up: button-small + down: button-small-down + } +} +com.badlogic.gdx.scenes.scene2d.ui.CheckBox$CheckBoxStyle: { + default: { + checkboxOn: checkbox + checkboxOff: checkbox-off + font: font + fontColor: white + } + radio: { + checkboxOn: radio-button + checkboxOff: radio-button-off + font: font + fontColor: white + } +} +com.badlogic.gdx.scenes.scene2d.ui.ImageButton$ImageButtonStyle: { + default: { + up: button + down: button-down + } +} +com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton$ImageTextButtonStyle: { + default: { + font: font-big + up: button + down: button-down + } +} +com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: { + default: { + font: font + } + big: { + font: font-big + } + black: { + font: font + fontColor: black + } +} +com.badlogic.gdx.scenes.scene2d.ui.List$ListStyle: { + default: { + font: font + fontColorSelected: white + fontColorUnselected: dark-cyan + selection: pale-blue + background: list + } + plain: { + font: font + fontColorSelected: white + fontColorUnselected: dark-cyan + selection: pale-blue + } +} +com.badlogic.gdx.scenes.scene2d.ui.ProgressBar$ProgressBarStyle: { + default-horizontal: { + background: progress-bar + knobBefore: progress-bar-knob + } + default-vertical: { + background: progress-bar-vertical + knobBefore: progress-bar-knob-vertical + } +} +com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle: { + default: { + hScroll: horizontal-scroll-bar + hScrollKnob: horizontal-scroll-knob + vScroll: vertical-scroll-bar + vScrollKnob: vertical-scroll-knob + } + scroll: { + background: list + hScroll: horizontal-scroll-bar + hScrollKnob: horizontal-scroll-knob + vScroll: vertical-scroll-bar + vScrollKnob: vertical-scroll-knob + } +} +com.badlogic.gdx.scenes.scene2d.ui.SelectBox$SelectBoxStyle: { + default: { + font: font + fontColor: dark-cyan + background: select-box + scrollStyle: scroll + listStyle: plain + } +} +com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle: { + default-horizontal: { + background: slider + knob: slider-knob + } + default-vertical: { + background: slider-vertical + knob: slider-knob + } +} +com.badlogic.gdx.scenes.scene2d.ui.SplitPane$SplitPaneStyle: { + default-horizontal: { + handle: horizontal-split-pane + } + default-vertical: { + handle: vertical-split-pane + } +} +com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle: { + default: { + font: font-big + up: button + down: button-down + } + small: { + font: font + up: button-small + down: button-small-down + } +} +com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldStyle: { + default: { + font: font + fontColor: black + background: textfield + cursor: black + selection: pale-blue + } +} +com.badlogic.gdx.scenes.scene2d.ui.TextTooltip$TextTooltipStyle: { + default: { + label: black + background: list + } +} +com.badlogic.gdx.scenes.scene2d.ui.Tree$TreeStyle: { + default: { + plus: plus + minus: minus + selection: pale-blue + } +} +com.badlogic.gdx.scenes.scene2d.ui.Window$WindowStyle: { + default: { + background: window + titleFont: font + titleFontColor: black + } +} +} \ No newline at end of file diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/glassy/glassy-ui.png b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/glassy/glassy-ui.png new file mode 100644 index 0000000..b4c04a7 Binary files /dev/null and b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/glassy/glassy-ui.png differ diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/neon/font-export.fnt b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/neon/font-export.fnt new file mode 100644 index 0000000..25809da --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/neon/font-export.fnt @@ -0,0 +1,710 @@ +info face="font-export" size=32 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 +common lineHeight=18 base=18 scaleW=116 scaleH=117 pages=1 packed=0 alphaChnl=1 redChnl=0 greenChnl=0 blueChnl=0 +page id=0 file="font-export.png" +chars count=98 +char id=33 x=106 y=17 width=4 height=13 xoffset=0 yoffset=5 xadvance=4 page=0 chnl=0 letter="!" +char id=34 x=98 y=109 width=6 height=7 xoffset=0 yoffset=5 xadvance=6 page=0 chnl=0 letter=""" +char id=35 x=27 y=14 width=11 height=13 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="#" +char id=36 x=38 y=42 width=10 height=16 xoffset=0 yoffset=3 xadvance=10 page=0 chnl=0 letter="$" +char id=37 x=0 y=14 width=14 height=14 xoffset=0 yoffset=4 xadvance=14 page=0 chnl=0 letter="%" +char id=38 x=26 y=85 width=11 height=13 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="&" +char id=39 x=100 y=25 width=5 height=7 xoffset=0 yoffset=5 xadvance=5 page=0 chnl=0 letter="'" +char id=40 x=100 y=0 width=6 height=16 xoffset=0 yoffset=5 xadvance=6 page=0 chnl=0 letter="(" +char id=41 x=99 y=59 width=6 height=16 xoffset=0 yoffset=5 xadvance=6 page=0 chnl=0 letter=")" +char id=42 x=90 y=109 width=7 height=7 xoffset=0 yoffset=5 xadvance=7 page=0 chnl=0 letter="*" +char id=43 x=49 y=80 width=10 height=10 xoffset=0 yoffset=7 xadvance=10 page=0 chnl=0 letter="+" +char id=44 x=100 y=17 width=5 height=7 xoffset=0 yoffset=13 xadvance=5 page=0 chnl=0 letter="," +char id=45 x=61 y=28 width=7 height=4 xoffset=0 yoffset=10 xadvance=7 page=0 chnl=0 letter="-" +char id=46 x=100 y=33 width=4 height=4 xoffset=0 yoffset=14 xadvance=4 page=0 chnl=0 letter="." +char id=47 x=70 y=83 width=9 height=14 xoffset=0 yoffset=4 xadvance=9 page=0 chnl=0 letter="/" +char id=48 x=49 y=54 width=10 height=13 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=0 letter="0" +char id=49 x=91 y=0 width=6 height=13 xoffset=0 yoffset=5 xadvance=6 page=0 chnl=0 letter="1" +char id=50 x=90 y=28 width=9 height=13 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="2" +char id=51 x=61 y=0 width=9 height=13 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="3" +char id=52 x=49 y=40 width=10 height=13 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=0 letter="4" +char id=53 x=80 y=71 width=9 height=13 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="5" +char id=54 x=80 y=57 width=9 height=13 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="6" +char id=55 x=80 y=85 width=9 height=13 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="7" +char id=56 x=80 y=99 width=9 height=13 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="8" +char id=57 x=90 y=14 width=9 height=13 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="9" +char id=58 x=106 y=49 width=4 height=11 xoffset=0 yoffset=7 xadvance=4 page=0 chnl=0 letter=":" +char id=59 x=99 y=76 width=5 height=14 xoffset=0 yoffset=7 xadvance=5 page=0 chnl=0 letter=";" +char id=60 x=49 y=91 width=10 height=10 xoffset=0 yoffset=8 xadvance=10 page=0 chnl=0 letter="<" +char id=61 x=14 y=71 width=10 height=7 xoffset=0 yoffset=9 xadvance=10 page=0 chnl=0 letter="=" +char id=62 x=50 y=28 width=10 height=10 xoffset=0 yoffset=8 xadvance=10 page=0 chnl=0 letter=">" +char id=63 x=81 y=0 width=9 height=13 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="?" +char id=64 x=0 y=29 width=13 height=13 xoffset=0 yoffset=5 xadvance=13 page=0 chnl=0 letter="@" +char id=65 x=13 y=81 width=12 height=13 xoffset=0 yoffset=5 xadvance=12 page=0 chnl=0 letter="A" +char id=66 x=39 y=26 width=10 height=13 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=0 letter="B" +char id=67 x=15 y=14 width=11 height=13 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="C" +char id=68 x=16 y=0 width=11 height=13 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="D" +char id=69 x=80 y=29 width=9 height=13 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="E" +char id=70 x=80 y=15 width=9 height=13 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="F" +char id=71 x=26 y=43 width=11 height=13 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="G" +char id=72 x=26 y=71 width=11 height=13 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="H" +char id=73 x=106 y=61 width=4 height=13 xoffset=0 yoffset=5 xadvance=4 page=0 chnl=0 letter="I" +char id=74 x=70 y=69 width=9 height=13 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="J" +char id=75 x=26 y=57 width=11 height=13 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="K" +char id=76 x=80 y=43 width=9 height=13 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="L" +char id=77 x=0 y=55 width=13 height=13 xoffset=0 yoffset=5 xadvance=13 page=0 chnl=0 letter="M" +char id=78 x=26 y=99 width=11 height=13 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="N" +char id=79 x=13 y=95 width=12 height=13 xoffset=0 yoffset=5 xadvance=12 page=0 chnl=0 letter="O" +char id=80 x=49 y=102 width=10 height=13 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=0 letter="P" +char id=81 x=0 y=94 width=12 height=13 xoffset=0 yoffset=5 xadvance=12 page=0 chnl=0 letter="Q" +char id=82 x=50 y=14 width=10 height=13 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=0 letter="R" +char id=83 x=38 y=74 width=10 height=13 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=0 letter="S" +char id=84 x=14 y=57 width=11 height=13 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="T" +char id=85 x=28 y=0 width=11 height=13 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="U" +char id=86 x=14 y=43 width=11 height=13 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="V" +char id=87 x=0 y=0 width=15 height=13 xoffset=0 yoffset=5 xadvance=15 page=0 chnl=0 letter="W" +char id=88 x=27 y=28 width=11 height=13 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=0 letter="X" +char id=89 x=14 y=29 width=12 height=13 xoffset=0 yoffset=5 xadvance=12 page=0 chnl=0 letter="Y" +char id=90 x=38 y=103 width=10 height=13 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=0 letter="Z" +char id=91 x=105 y=76 width=5 height=16 xoffset=0 yoffset=5 xadvance=5 page=0 chnl=0 letter="[" +char id=92 x=60 y=39 width=9 height=14 xoffset=0 yoffset=4 xadvance=9 page=0 chnl=0 letter="\" +char id=93 x=105 y=93 width=5 height=16 xoffset=0 yoffset=5 xadvance=5 page=0 chnl=0 letter="]" +char id=94 x=60 y=94 width=9 height=9 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="^" +char id=95 x=0 y=109 width=10 height=4 xoffset=0 yoffset=16 xadvance=10 page=0 chnl=0 letter="_" +char id=96 x=61 y=33 width=6 height=5 xoffset=0 yoffset=5 xadvance=6 page=0 chnl=0 letter="`" +char id=97 x=90 y=80 width=8 height=11 xoffset=0 yoffset=7 xadvance=8 page=0 chnl=0 letter="a" +char id=98 x=40 y=0 width=10 height=13 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=0 letter="b" +char id=99 x=51 y=0 width=9 height=11 xoffset=0 yoffset=7 xadvance=9 page=0 chnl=0 letter="c" +char id=100 x=61 y=14 width=9 height=13 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="d" +char id=101 x=60 y=104 width=9 height=11 xoffset=0 yoffset=7 xadvance=9 page=0 chnl=0 letter="e" +char id=102 x=70 y=43 width=9 height=13 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="f" +char id=103 x=70 y=28 width=9 height=14 xoffset=0 yoffset=7 xadvance=9 page=0 chnl=0 letter="g" +char id=104 x=60 y=66 width=9 height=13 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="h" +char id=105 x=111 y=14 width=4 height=13 xoffset=0 yoffset=5 xadvance=4 page=0 chnl=0 letter="i" +char id=106 x=90 y=92 width=7 height=16 xoffset=0 yoffset=5 xadvance=7 page=0 chnl=0 letter="j" +char id=107 x=60 y=80 width=9 height=13 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=0 letter="k" +char id=108 x=107 y=0 width=4 height=13 xoffset=0 yoffset=5 xadvance=4 page=0 chnl=0 letter="l" +char id=109 x=0 y=69 width=13 height=11 xoffset=0 yoffset=7 xadvance=13 page=0 chnl=0 letter="m" +char id=110 x=70 y=57 width=9 height=11 xoffset=0 yoffset=7 xadvance=9 page=0 chnl=0 letter="n" +char id=111 x=70 y=98 width=9 height=11 xoffset=0 yoffset=7 xadvance=9 page=0 chnl=0 letter="o" +char id=112 x=38 y=59 width=10 height=14 xoffset=0 yoffset=7 xadvance=10 page=0 chnl=0 letter="p" +char id=113 x=71 y=0 width=9 height=14 xoffset=0 yoffset=7 xadvance=9 page=0 chnl=0 letter="q" +char id=114 x=71 y=15 width=8 height=11 xoffset=0 yoffset=7 xadvance=8 page=0 chnl=0 letter="r" +char id=115 x=90 y=68 width=8 height=11 xoffset=0 yoffset=7 xadvance=8 page=0 chnl=0 letter="s" +char id=116 x=90 y=42 width=8 height=13 xoffset=0 yoffset=5 xadvance=8 page=0 chnl=0 letter="t" +char id=117 x=60 y=54 width=9 height=11 xoffset=0 yoffset=7 xadvance=9 page=0 chnl=0 letter="u" +char id=118 x=39 y=14 width=10 height=11 xoffset=0 yoffset=7 xadvance=10 page=0 chnl=0 letter="v" +char id=119 x=0 y=43 width=13 height=11 xoffset=0 yoffset=7 xadvance=13 page=0 chnl=0 letter="w" +char id=120 x=49 y=68 width=10 height=11 xoffset=0 yoffset=7 xadvance=10 page=0 chnl=0 letter="x" +char id=121 x=38 y=88 width=10 height=14 xoffset=0 yoffset=7 xadvance=10 page=0 chnl=0 letter="y" +char id=122 x=90 y=56 width=8 height=11 xoffset=0 yoffset=7 xadvance=8 page=0 chnl=0 letter="z" +char id=123 x=98 y=92 width=6 height=16 xoffset=0 yoffset=5 xadvance=6 page=0 chnl=0 letter="{" +char id=124 x=106 y=31 width=4 height=17 xoffset=0 yoffset=4 xadvance=4 page=0 chnl=0 letter="|" +char id=125 x=99 y=42 width=6 height=16 xoffset=0 yoffset=5 xadvance=6 page=0 chnl=0 letter="}" +char id=126 x=11 y=109 width=10 height=5 xoffset=0 yoffset=8 xadvance=10 page=0 chnl=0 letter="~" +char id=8226 x=70 y=110 width=5 height=5 xoffset=0 yoffset=9 xadvance=5 page=0 chnl=0 letter="•" +char id=169 x=0 y=81 width=12 height=12 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="©" +char id=32 x=0 y=0 width=0 height=0 xoffset=0 yoffset=0 xadvance=6 page=0 chnl=0 letter=" " +char id=9 x=0 y=0 width=0 height=0 xoffset=0 yoffset=0 xadvance=48 page=0 chnl=0 letter=" " + +kernings count=606 +kerning first=65 second=39 amount=-3 +kerning first=65 second=67 amount=-1 +kerning first=65 second=71 amount=-1 +kerning first=65 second=79 amount=-1 +kerning first=65 second=81 amount=-1 +kerning first=65 second=84 amount=-3 +kerning first=65 second=85 amount=-1 +kerning first=65 second=86 amount=-3 +kerning first=65 second=87 amount=-3 +kerning first=65 second=89 amount=-3 +kerning first=66 second=65 amount=-1 +kerning first=66 second=69 amount=-1 +kerning first=66 second=76 amount=-1 +kerning first=66 second=80 amount=-1 +kerning first=66 second=82 amount=-1 +kerning first=66 second=85 amount=-1 +kerning first=66 second=86 amount=-1 +kerning first=66 second=87 amount=-1 +kerning first=66 second=89 amount=-1 +kerning first=67 second=65 amount=-1 +kerning first=67 second=79 amount=-1 +kerning first=67 second=82 amount=-1 +kerning first=68 second=65 amount=-1 +kerning first=68 second=68 amount=-1 +kerning first=68 second=69 amount=-1 +kerning first=68 second=73 amount=-1 +kerning first=68 second=76 amount=-1 +kerning first=68 second=77 amount=-1 +kerning first=68 second=78 amount=-1 +kerning first=68 second=79 amount=-1 +kerning first=68 second=80 amount=-1 +kerning first=68 second=82 amount=-1 +kerning first=68 second=85 amount=-1 +kerning first=68 second=86 amount=-1 +kerning first=68 second=87 amount=-1 +kerning first=68 second=89 amount=-1 +kerning first=69 second=67 amount=-1 +kerning first=69 second=79 amount=-1 +kerning first=70 second=65 amount=-2 +kerning first=70 second=67 amount=-1 +kerning first=70 second=71 amount=-1 +kerning first=70 second=79 amount=-1 +kerning first=70 second=46 amount=-5 +kerning first=70 second=44 amount=-6 +kerning first=71 second=69 amount=-1 +kerning first=71 second=79 amount=-1 +kerning first=71 second=82 amount=-1 +kerning first=71 second=85 amount=-1 +kerning first=72 second=79 amount=-1 +kerning first=73 second=67 amount=-1 +kerning first=73 second=71 amount=-1 +kerning first=73 second=79 amount=-1 +kerning first=74 second=65 amount=-1 +kerning first=74 second=79 amount=-1 +kerning first=75 second=79 amount=-1 +kerning first=76 second=39 amount=-6 +kerning first=76 second=67 amount=-1 +kerning first=76 second=84 amount=-4 +kerning first=76 second=86 amount=-4 +kerning first=76 second=87 amount=-3 +kerning first=76 second=89 amount=-5 +kerning first=76 second=71 amount=-1 +kerning first=76 second=79 amount=-1 +kerning first=76 second=85 amount=-1 +kerning first=77 second=71 amount=-1 +kerning first=77 second=79 amount=-1 +kerning first=78 second=67 amount=-1 +kerning first=78 second=71 amount=-1 +kerning first=78 second=79 amount=-1 +kerning first=79 second=65 amount=-1 +kerning first=79 second=66 amount=-1 +kerning first=79 second=68 amount=-1 +kerning first=79 second=69 amount=-1 +kerning first=79 second=70 amount=-1 +kerning first=79 second=72 amount=-1 +kerning first=79 second=73 amount=-1 +kerning first=79 second=75 amount=-1 +kerning first=79 second=76 amount=-1 +kerning first=79 second=77 amount=-1 +kerning first=79 second=78 amount=-1 +kerning first=79 second=80 amount=-1 +kerning first=79 second=82 amount=-1 +kerning first=79 second=84 amount=-1 +kerning first=79 second=85 amount=-1 +kerning first=79 second=86 amount=-1 +kerning first=79 second=87 amount=-1 +kerning first=79 second=88 amount=-1 +kerning first=79 second=89 amount=-1 +kerning first=80 second=65 amount=-3 +kerning first=80 second=69 amount=-1 +kerning first=80 second=76 amount=-1 +kerning first=80 second=79 amount=-1 +kerning first=80 second=80 amount=-1 +kerning first=80 second=85 amount=-1 +kerning first=80 second=89 amount=-1 +kerning first=80 second=46 amount=-5 +kerning first=80 second=44 amount=-6 +kerning first=80 second=59 amount=-2 +kerning first=80 second=58 amount=-1 +kerning first=81 second=85 amount=-1 +kerning first=82 second=67 amount=-1 +kerning first=82 second=71 amount=-1 +kerning first=82 second=89 amount=-1 +kerning first=82 second=84 amount=-1 +kerning first=82 second=85 amount=-1 +kerning first=82 second=86 amount=-1 +kerning first=82 second=87 amount=-1 +kerning first=82 second=89 amount=-1 +kerning first=83 second=73 amount=-1 +kerning first=83 second=77 amount=-1 +kerning first=83 second=84 amount=-2 +kerning first=83 second=85 amount=-1 +kerning first=84 second=65 amount=-4 +kerning first=84 second=67 amount=-1 +kerning first=84 second=79 amount=-1 +kerning first=85 second=65 amount=-1 +kerning first=85 second=67 amount=-1 +kerning first=85 second=71 amount=-1 +kerning first=85 second=79 amount=-1 +kerning first=85 second=83 amount=-1 +kerning first=86 second=65 amount=-3 +kerning first=86 second=67 amount=-1 +kerning first=86 second=71 amount=-1 +kerning first=86 second=79 amount=-1 +kerning first=86 second=83 amount=-1 +kerning first=87 second=65 amount=-3 +kerning first=87 second=67 amount=-1 +kerning first=87 second=71 amount=-1 +kerning first=87 second=79 amount=-1 +kerning first=89 second=65 amount=-4 +kerning first=89 second=67 amount=-1 +kerning first=89 second=79 amount=-1 +kerning first=89 second=83 amount=-1 +kerning first=90 second=79 amount=-1 +kerning first=65 second=99 amount=-1 +kerning first=65 second=100 amount=-1 +kerning first=65 second=101 amount=-1 +kerning first=65 second=103 amount=-1 +kerning first=65 second=111 amount=-1 +kerning first=65 second=112 amount=-1 +kerning first=65 second=113 amount=-1 +kerning first=65 second=116 amount=-3 +kerning first=65 second=117 amount=-1 +kerning first=65 second=118 amount=-2 +kerning first=65 second=119 amount=-2 +kerning first=65 second=121 amount=-2 +kerning first=66 second=98 amount=-1 +kerning first=66 second=105 amount=-1 +kerning first=66 second=107 amount=-1 +kerning first=66 second=108 amount=-1 +kerning first=66 second=114 amount=-1 +kerning first=66 second=117 amount=-1 +kerning first=66 second=121 amount=-1 +kerning first=66 second=46 amount=-1 +kerning first=66 second=44 amount=-1 +kerning first=67 second=97 amount=-1 +kerning first=67 second=114 amount=-1 +kerning first=67 second=46 amount=-1 +kerning first=67 second=44 amount=-1 +kerning first=68 second=97 amount=-1 +kerning first=68 second=46 amount=-1 +kerning first=68 second=44 amount=-2 +kerning first=69 second=117 amount=-1 +kerning first=69 second=118 amount=-1 +kerning first=70 second=97 amount=-1 +kerning first=70 second=101 amount=-1 +kerning first=70 second=105 amount=-1 +kerning first=70 second=111 amount=-1 +kerning first=70 second=114 amount=-1 +kerning first=70 second=116 amount=-1 +kerning first=70 second=117 amount=-1 +kerning first=70 second=121 amount=-1 +kerning first=70 second=46 amount=-5 +kerning first=70 second=44 amount=-6 +kerning first=70 second=59 amount=-2 +kerning first=70 second=58 amount=-1 +kerning first=71 second=117 amount=-1 +kerning first=72 second=101 amount=-1 +kerning first=72 second=111 amount=-1 +kerning first=72 second=117 amount=-1 +kerning first=72 second=121 amount=-1 +kerning first=73 second=99 amount=-1 +kerning first=73 second=100 amount=-1 +kerning first=73 second=113 amount=-1 +kerning first=73 second=111 amount=-1 +kerning first=73 second=116 amount=-1 +kerning first=74 second=97 amount=-1 +kerning first=74 second=101 amount=-1 +kerning first=74 second=111 amount=-1 +kerning first=74 second=117 amount=-1 +kerning first=74 second=46 amount=-1 +kerning first=74 second=44 amount=-1 +kerning first=75 second=101 amount=-1 +kerning first=75 second=111 amount=-1 +kerning first=75 second=117 amount=-1 +kerning first=76 second=117 amount=-1 +kerning first=76 second=121 amount=-3 +kerning first=77 second=97 amount=-1 +kerning first=77 second=99 amount=-1 +kerning first=77 second=100 amount=-1 +kerning first=77 second=101 amount=-1 +kerning first=77 second=111 amount=-1 +kerning first=78 second=117 amount=-1 +kerning first=78 second=97 amount=-1 +kerning first=78 second=101 amount=-1 +kerning first=78 second=105 amount=-1 +kerning first=78 second=111 amount=-1 +kerning first=78 second=117 amount=-1 +kerning first=78 second=46 amount=-1 +kerning first=78 second=44 amount=-1 +kerning first=79 second=97 amount=-1 +kerning first=79 second=98 amount=-1 +kerning first=79 second=104 amount=-1 +kerning first=79 second=107 amount=-1 +kerning first=79 second=108 amount=-1 +kerning first=79 second=46 amount=-1 +kerning first=79 second=44 amount=-2 +kerning first=80 second=97 amount=-1 +kerning first=80 second=101 amount=-1 +kerning first=80 second=111 amount=-1 +kerning first=82 second=100 amount=-1 +kerning first=82 second=101 amount=-1 +kerning first=82 second=111 amount=-1 +kerning first=82 second=116 amount=-1 +kerning first=82 second=117 amount=-1 +kerning first=83 second=105 amount=-1 +kerning first=83 second=112 amount=-1 +kerning first=83 second=117 amount=-1 +kerning first=83 second=46 amount=-1 +kerning first=83 second=44 amount=-2 +kerning first=84 second=97 amount=-1 +kerning first=84 second=99 amount=-2 +kerning first=84 second=101 amount=-1 +kerning first=84 second=105 amount=-1 +kerning first=84 second=111 amount=-1 +kerning first=84 second=114 amount=-1 +kerning first=84 second=115 amount=-1 +kerning first=84 second=117 amount=-1 +kerning first=84 second=119 amount=-1 +kerning first=84 second=121 amount=-1 +kerning first=84 second=46 amount=-5 +kerning first=84 second=44 amount=-5 +kerning first=84 second=59 amount=-2 +kerning first=84 second=58 amount=-1 +kerning first=85 second=97 amount=-1 +kerning first=85 second=103 amount=-1 +kerning first=85 second=109 amount=-1 +kerning first=85 second=110 amount=-1 +kerning first=85 second=112 amount=-1 +kerning first=85 second=115 amount=-1 +kerning first=85 second=46 amount=-1 +kerning first=85 second=44 amount=-2 +kerning first=86 second=97 amount=-1 +kerning first=86 second=101 amount=-1 +kerning first=86 second=105 amount=-1 +kerning first=86 second=111 amount=-1 +kerning first=86 second=114 amount=-1 +kerning first=86 second=117 amount=-1 +kerning first=86 second=46 amount=-3 +kerning first=86 second=44 amount=-4 +kerning first=86 second=59 amount=-2 +kerning first=86 second=58 amount=-1 +kerning first=87 second=100 amount=-1 +kerning first=87 second=105 amount=-1 +kerning first=87 second=109 amount=-1 +kerning first=87 second=114 amount=-1 +kerning first=87 second=116 amount=-1 +kerning first=87 second=117 amount=-1 +kerning first=87 second=121 amount=-1 +kerning first=87 second=46 amount=-3 +kerning first=87 second=44 amount=-3 +kerning first=87 second=59 amount=-2 +kerning first=87 second=58 amount=-1 +kerning first=88 second=97 amount=-1 +kerning first=88 second=101 amount=-1 +kerning first=88 second=111 amount=-1 +kerning first=88 second=117 amount=-1 +kerning first=88 second=121 amount=-1 +kerning first=89 second=100 amount=-1 +kerning first=89 second=101 amount=-1 +kerning first=89 second=105 amount=-1 +kerning first=89 second=112 amount=-1 +kerning first=89 second=117 amount=-1 +kerning first=89 second=118 amount=-1 +kerning first=89 second=46 amount=-5 +kerning first=89 second=44 amount=-5 +kerning first=89 second=59 amount=-2 +kerning first=89 second=58 amount=-1 +kerning first=97 second=99 amount=-1 +kerning first=97 second=100 amount=-1 +kerning first=97 second=101 amount=-1 +kerning first=97 second=103 amount=-1 +kerning first=97 second=112 amount=-1 +kerning first=97 second=102 amount=-1 +kerning first=97 second=116 amount=-1 +kerning first=97 second=117 amount=-1 +kerning first=97 second=118 amount=-1 +kerning first=97 second=119 amount=-1 +kerning first=97 second=121 amount=-1 +kerning first=97 second=112 amount=-1 +kerning first=98 second=108 amount=-1 +kerning first=98 second=114 amount=-1 +kerning first=98 second=117 amount=-1 +kerning first=98 second=121 amount=-1 +kerning first=98 second=46 amount=-1 +kerning first=98 second=44 amount=-2 +kerning first=99 second=97 amount=-1 +kerning first=99 second=104 amount=-1 +kerning first=99 second=107 amount=-1 +kerning first=100 second=97 amount=-1 +kerning first=100 second=99 amount=-1 +kerning first=100 second=101 amount=-1 +kerning first=100 second=103 amount=-1 +kerning first=100 second=111 amount=-1 +kerning first=100 second=116 amount=-1 +kerning first=100 second=117 amount=-1 +kerning first=100 second=118 amount=-1 +kerning first=100 second=119 amount=-1 +kerning first=100 second=121 amount=-1 +kerning first=100 second=46 amount=-1 +kerning first=100 second=44 amount=-1 +kerning first=101 second=97 amount=-1 +kerning first=101 second=105 amount=-1 +kerning first=101 second=108 amount=-1 +kerning first=101 second=109 amount=-1 +kerning first=101 second=110 amount=-1 +kerning first=101 second=112 amount=-1 +kerning first=101 second=114 amount=-1 +kerning first=101 second=116 amount=-1 +kerning first=101 second=117 amount=-1 +kerning first=101 second=118 amount=-1 +kerning first=101 second=119 amount=-1 +kerning first=101 second=121 amount=-1 +kerning first=101 second=46 amount=-1 +kerning first=101 second=44 amount=-1 +kerning first=102 second=97 amount=-1 +kerning first=102 second=101 amount=-1 +kerning first=102 second=102 amount=-1 +kerning first=102 second=105 amount=-1 +kerning first=102 second=108 amount=-1 +kerning first=102 second=111 amount=-1 +kerning first=102 second=46 amount=-4 +kerning first=102 second=44 amount=-4 +kerning first=103 second=97 amount=-1 +kerning first=103 second=101 amount=-1 +kerning first=103 second=104 amount=-1 +kerning first=103 second=108 amount=-1 +kerning first=103 second=111 amount=-1 +kerning first=103 second=103 amount=-1 +kerning first=103 second=46 amount=-1 +kerning first=103 second=44 amount=-1 +kerning first=104 second=99 amount=-1 +kerning first=104 second=100 amount=-1 +kerning first=104 second=101 amount=-1 +kerning first=104 second=103 amount=-1 +kerning first=104 second=111 amount=-1 +kerning first=104 second=112 amount=-1 +kerning first=104 second=116 amount=-1 +kerning first=104 second=117 amount=-1 +kerning first=104 second=118 amount=-1 +kerning first=104 second=119 amount=-1 +kerning first=104 second=121 amount=-1 +kerning first=105 second=99 amount=-1 +kerning first=105 second=100 amount=-1 +kerning first=105 second=101 amount=-1 +kerning first=105 second=103 amount=-1 +kerning first=105 second=111 amount=-1 +kerning first=105 second=112 amount=-1 +kerning first=105 second=116 amount=-1 +kerning first=105 second=117 amount=-1 +kerning first=105 second=118 amount=-1 +kerning first=106 second=97 amount=-1 +kerning first=106 second=101 amount=-1 +kerning first=106 second=111 amount=-1 +kerning first=106 second=117 amount=-1 +kerning first=106 second=46 amount=-2 +kerning first=106 second=44 amount=-2 +kerning first=107 second=97 amount=-1 +kerning first=107 second=99 amount=-1 +kerning first=107 second=100 amount=-1 +kerning first=107 second=101 amount=-1 +kerning first=107 second=103 amount=-1 +kerning first=107 second=111 amount=-1 +kerning first=108 second=97 amount=-1 +kerning first=108 second=99 amount=-1 +kerning first=108 second=100 amount=-1 +kerning first=108 second=101 amount=-1 +kerning first=108 second=102 amount=-1 +kerning first=108 second=103 amount=-1 +kerning first=108 second=111 amount=-1 +kerning first=108 second=112 amount=-1 +kerning first=108 second=113 amount=-1 +kerning first=108 second=117 amount=-1 +kerning first=108 second=118 amount=-1 +kerning first=108 second=119 amount=-1 +kerning first=108 second=121 amount=-1 +kerning first=109 second=97 amount=-1 +kerning first=109 second=99 amount=-1 +kerning first=109 second=100 amount=-1 +kerning first=109 second=101 amount=-1 +kerning first=109 second=103 amount=-1 +kerning first=109 second=110 amount=-1 +kerning first=109 second=111 amount=-1 +kerning first=109 second=112 amount=-1 +kerning first=109 second=116 amount=-1 +kerning first=109 second=117 amount=-1 +kerning first=109 second=118 amount=-1 +kerning first=109 second=121 amount=-1 +kerning first=110 second=99 amount=-1 +kerning first=110 second=100 amount=-1 +kerning first=110 second=101 amount=-1 +kerning first=110 second=103 amount=-1 +kerning first=110 second=111 amount=-1 +kerning first=110 second=112 amount=-1 +kerning first=110 second=116 amount=-1 +kerning first=110 second=117 amount=-1 +kerning first=110 second=118 amount=-1 +kerning first=110 second=119 amount=-1 +kerning first=110 second=121 amount=-1 +kerning first=111 second=98 amount=-1 +kerning first=111 second=102 amount=-1 +kerning first=111 second=104 amount=-1 +kerning first=111 second=106 amount=-3 +kerning first=111 second=107 amount=-1 +kerning first=111 second=108 amount=-1 +kerning first=111 second=109 amount=-1 +kerning first=111 second=110 amount=-1 +kerning first=111 second=112 amount=-1 +kerning first=111 second=114 amount=-1 +kerning first=111 second=117 amount=-1 +kerning first=111 second=118 amount=-1 +kerning first=111 second=119 amount=-1 +kerning first=111 second=120 amount=-1 +kerning first=111 second=121 amount=-1 +kerning first=111 second=46 amount=-1 +kerning first=111 second=44 amount=-1 +kerning first=112 second=97 amount=-1 +kerning first=112 second=104 amount=-1 +kerning first=112 second=105 amount=-1 +kerning first=112 second=108 amount=-1 +kerning first=112 second=112 amount=-1 +kerning first=112 second=117 amount=-1 +kerning first=112 second=46 amount=-1 +kerning first=112 second=44 amount=-2 +kerning first=113 second=117 amount=-1 +kerning first=116 second=46 amount=-1 +kerning first=114 second=97 amount=-1 +kerning first=114 second=100 amount=-1 +kerning first=114 second=101 amount=-1 +kerning first=114 second=103 amount=-1 +kerning first=114 second=107 amount=-1 +kerning first=114 second=108 amount=-1 +kerning first=114 second=109 amount=-1 +kerning first=114 second=110 amount=-1 +kerning first=114 second=111 amount=-1 +kerning first=114 second=113 amount=-1 +kerning first=114 second=114 amount=-1 +kerning first=114 second=116 amount=-1 +kerning first=114 second=118 amount=-1 +kerning first=114 second=121 amount=-1 +kerning first=114 second=46 amount=-5 +kerning first=114 second=44 amount=-5 +kerning first=115 second=104 amount=-1 +kerning first=115 second=116 amount=-1 +kerning first=115 second=117 amount=-1 +kerning first=115 second=46 amount=-1 +kerning first=115 second=44 amount=-1 +kerning first=116 second=100 amount=-1 +kerning first=116 second=97 amount=-1 +kerning first=116 second=101 amount=-1 +kerning first=116 second=111 amount=-1 +kerning first=116 second=46 amount=-1 +kerning first=116 second=44 amount=-1 +kerning first=117 second=97 amount=-1 +kerning first=117 second=99 amount=-1 +kerning first=117 second=100 amount=-1 +kerning first=117 second=101 amount=-1 +kerning first=117 second=103 amount=-1 +kerning first=117 second=111 amount=-1 +kerning first=117 second=112 amount=-1 +kerning first=117 second=113 amount=-1 +kerning first=117 second=116 amount=-1 +kerning first=117 second=118 amount=-1 +kerning first=117 second=119 amount=-1 +kerning first=117 second=121 amount=-1 +kerning first=118 second=97 amount=-1 +kerning first=118 second=98 amount=-1 +kerning first=118 second=99 amount=-1 +kerning first=118 second=100 amount=-1 +kerning first=118 second=101 amount=-1 +kerning first=118 second=103 amount=-1 +kerning first=118 second=111 amount=-1 +kerning first=118 second=118 amount=-1 +kerning first=118 second=121 amount=-1 +kerning first=118 second=46 amount=-3 +kerning first=118 second=44 amount=-3 +kerning first=119 second=97 amount=-1 +kerning first=119 second=120 amount=-1 +kerning first=119 second=100 amount=-1 +kerning first=119 second=101 amount=-1 +kerning first=119 second=103 amount=-1 +kerning first=119 second=104 amount=-1 +kerning first=119 second=111 amount=-1 +kerning first=119 second=46 amount=-2 +kerning first=119 second=44 amount=-3 +kerning first=120 second=97 amount=-1 +kerning first=120 second=101 amount=-1 +kerning first=120 second=111 amount=-1 +kerning first=121 second=46 amount=-3 +kerning first=121 second=44 amount=-3 +kerning first=121 second=97 amount=-1 +kerning first=121 second=99 amount=-1 +kerning first=121 second=100 amount=-1 +kerning first=121 second=101 amount=-1 +kerning first=121 second=111 amount=-1 +kerning first=117 second=109 amount=-1 +kerning first=84 second=104 amount=-1 +kerning first=118 second=101 amount=-1 +kerning first=119 second=110 amount=-1 +kerning first=112 second=115 amount=-1 +kerning first=76 second=97 amount=-1 +kerning first=117 second=105 amount=-1 +kerning first=98 second=101 amount=-1 +kerning first=99 second=111 amount=-1 +kerning first=102 second=103 amount=-1 +kerning first=118 second=119 amount=-1 +kerning first=120 second=121 amount=-1 +kerning first=121 second=122 amount=-1 +kerning first=119 second=119 amount=-1 +kerning first=99 second=101 amount=-1 +kerning first=101 second=115 amount=-1 +kerning first=101 second=102 amount=-1 +kerning first=98 second=97 amount=-1 +kerning first=116 second=104 amount=-1 +kerning first=116 second=105 amount=-1 +kerning first=101 second=101 amount=-1 +kerning first=104 second=97 amount=-1 +kerning first=111 second=101 amount=-1 +kerning first=119 second=105 amount=-1 +kerning first=88 second=89 amount=-1 +kerning first=89 second=90 amount=-1 +kerning first=82 second=83 amount=-1 +kerning first=75 second=76 amount=-1 +kerning first=101 second=100 amount=-1 +kerning first=116 second=111 amount=-1 +kerning first=87 second=104 amount=-1 +kerning first=107 second=110 amount=-1 +kerning first=119 second=115 amount=-1 +kerning first=116 second=114 amount=-1 +kerning first=102 second=114 amount=-1 +kerning first=65 second=110 amount=-1 +kerning first=116 second=116 amount=-1 +kerning first=66 second=67 amount=-1 +kerning first=67 second=68 amount=-1 +kerning first=65 second=66 amount=-1 +kerning first=89 second=111 amount=-1 +kerning first=102 second=117 amount=-1 +kerning first=67 second=111 amount=-1 +kerning first=116 second=115 amount=-1 +kerning first=111 second=111 amount=-1 +kerning first=68 second=111 amount=-1 +kerning first=101 second=97 amount=-1 +kerning first=76 second=111 amount=-1 +kerning first=115 second=105 amount=-1 +kerning first=111 second=116 amount=-1 +kerning first=111 second=103 amount=-1 +kerning first=82 second=97 amount=-1 +kerning first=101 second=99 amount=-1 +kerning first=66 second=111 amount=-1 +kerning first=111 second=99 amount=-1 +kerning first=115 second=111 amount=-1 +kerning first=83 second=119 amount=-2 +kerning first=66 second=101 amount=-1 +kerning first=99 second=116 amount=-1 +kerning first=98 second=106 amount=-3 +kerning first=115 second=101 amount=-1 +kerning first=121 second=119 amount=-1 +kerning first=111 second=97 amount=-1 +kerning first=68 second=88 amount=-1 +kerning first=101 second=98 amount=-1 +kerning first=115 second=119 amount=-1 +kerning first=97 second=120 amount=-1 +kerning first=73 second=110 amount=-1 +kerning first=73 second=74 amount=-1 +kerning first=116 second=112 amount=-1 +kerning first=104 second=105 amount=-1 +kerning first=105 second=115 amount=-1 +kerning first=98 second=99 amount=-1 +kerning first=115 second=112 amount=-1 +kerning first=100 second=105 amount=-1 +kerning first=105 second=106 amount=-3 +kerning first=108 second=109 amount=-1 +kerning first=107 second=108 amount=-1 +kerning first=108 second=105 amount=-1 +kerning first=112 second=113 amount=-1 +kerning first=108 second=108 amount=-1 +kerning first=49 second=50 amount=-1 +kerning first=106 second=107 amount=-1 +kerning first=117 second=110 amount=-1 +kerning first=113 second=114 amount=-1 +kerning first=116 second=117 amount=-1 +kerning first=114 second=115 amount=-1 +kerning first=117 second=114 amount=-1 +kerning first=73 second=112 amount=-1 +kerning first=79 second=112 amount=-1 +kerning first=101 second=103 amount=-1 diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/neon/font-over-export.fnt b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/neon/font-over-export.fnt new file mode 100644 index 0000000..3e0feef --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/neon/font-over-export.fnt @@ -0,0 +1,710 @@ +info face="font-over-export" size=32 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 +common lineHeight=22 base=22 scaleW=142 scaleH=144 pages=1 packed=0 alphaChnl=1 redChnl=0 greenChnl=0 blueChnl=0 +page id=0 file="font-over-export.png" +chars count=98 +char id=33 x=133 y=101 width=7 height=16 xoffset=0 yoffset=6 xadvance=7 page=0 chnl=0 letter="!" +char id=34 x=123 y=132 width=9 height=10 xoffset=0 yoffset=6 xadvance=9 page=0 chnl=0 letter=""" +char id=35 x=16 y=68 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="#" +char id=36 x=74 y=98 width=12 height=18 xoffset=0 yoffset=5 xadvance=12 page=0 chnl=0 letter="$" +char id=37 x=0 y=0 width=17 height=16 xoffset=0 yoffset=6 xadvance=17 page=0 chnl=0 letter="%" +char id=38 x=16 y=100 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="&" +char id=39 x=133 y=0 width=7 height=9 xoffset=0 yoffset=6 xadvance=7 page=0 chnl=0 letter="'" +char id=40 x=113 y=115 width=9 height=19 xoffset=0 yoffset=6 xadvance=9 page=0 chnl=0 letter="(" +char id=41 x=124 y=61 width=9 height=19 xoffset=0 yoffset=6 xadvance=9 page=0 chnl=0 letter=")" +char id=42 x=60 y=132 width=10 height=10 xoffset=0 yoffset=6 xadvance=10 page=0 chnl=0 letter="*" +char id=43 x=74 y=68 width=12 height=12 xoffset=0 yoffset=9 xadvance=12 page=0 chnl=0 letter="+" +char id=44 x=114 y=20 width=8 height=9 xoffset=0 yoffset=15 xadvance=8 page=0 chnl=0 letter="," +char id=45 x=27 y=136 width=11 height=7 xoffset=0 yoffset=12 xadvance=11 page=0 chnl=0 letter="-" +char id=46 x=124 y=81 width=7 height=8 xoffset=0 yoffset=14 xadvance=7 page=0 chnl=0 letter="." +char id=47 x=113 y=61 width=10 height=16 xoffset=0 yoffset=6 xadvance=10 page=0 chnl=0 letter="/" +char id=48 x=74 y=81 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="0" +char id=49 x=123 y=115 width=9 height=16 xoffset=0 yoffset=6 xadvance=9 page=0 chnl=0 letter="1" +char id=50 x=75 y=34 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="2" +char id=51 x=76 y=17 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="3" +char id=52 x=60 y=67 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="4" +char id=53 x=88 y=34 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="5" +char id=54 x=62 y=17 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="6" +char id=55 x=60 y=84 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="7" +char id=56 x=100 y=111 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="8" +char id=57 x=60 y=115 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="9" +char id=58 x=134 y=44 width=7 height=13 xoffset=0 yoffset=9 xadvance=7 page=0 chnl=0 letter=":" +char id=59 x=125 y=40 width=8 height=15 xoffset=0 yoffset=9 xadvance=8 page=0 chnl=0 letter=";" +char id=60 x=100 y=128 width=12 height=13 xoffset=0 yoffset=9 xadvance=12 page=0 chnl=0 letter="<" +char id=61 x=46 y=130 width=13 height=10 xoffset=0 yoffset=10 xadvance=13 page=0 chnl=0 letter="=" +char id=62 x=60 y=101 width=13 height=13 xoffset=0 yoffset=9 xadvance=13 page=0 chnl=0 letter=">" +char id=63 x=102 y=13 width=11 height=16 xoffset=0 yoffset=6 xadvance=11 page=0 chnl=0 letter="?" +char id=64 x=0 y=85 width=15 height=16 xoffset=0 yoffset=6 xadvance=15 page=0 chnl=0 letter="@" +char id=65 x=16 y=117 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="A" +char id=66 x=18 y=0 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="B" +char id=67 x=31 y=85 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="C" +char id=68 x=18 y=17 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="D" +char id=69 x=89 y=17 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="E" +char id=70 x=89 y=0 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="F" +char id=71 x=16 y=51 width=15 height=16 xoffset=0 yoffset=6 xadvance=15 page=0 chnl=0 letter="G" +char id=72 x=32 y=34 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="H" +char id=73 x=134 y=27 width=7 height=16 xoffset=0 yoffset=6 xadvance=7 page=0 chnl=0 letter="I" +char id=74 x=87 y=113 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="J" +char id=75 x=32 y=51 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="K" +char id=76 x=48 y=17 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="L" +char id=77 x=0 y=34 width=16 height=16 xoffset=0 yoffset=6 xadvance=16 page=0 chnl=0 letter="M" +char id=78 x=17 y=34 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="N" +char id=79 x=0 y=68 width=15 height=16 xoffset=0 yoffset=6 xadvance=15 page=0 chnl=0 letter="O" +char id=80 x=76 y=0 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="P" +char id=81 x=0 y=51 width=15 height=16 xoffset=0 yoffset=6 xadvance=15 page=0 chnl=0 letter="Q" +char id=82 x=74 y=51 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="R" +char id=83 x=62 y=0 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="S" +char id=84 x=31 y=68 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="T" +char id=85 x=31 y=102 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="U" +char id=86 x=33 y=0 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="V" +char id=87 x=0 y=17 width=17 height=16 xoffset=0 yoffset=6 xadvance=17 page=0 chnl=0 letter="W" +char id=88 x=33 y=17 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="X" +char id=89 x=31 y=119 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="Y" +char id=90 x=61 y=34 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="Z" +char id=91 x=113 y=95 width=9 height=19 xoffset=0 yoffset=6 xadvance=9 page=0 chnl=0 letter="[" +char id=92 x=113 y=30 width=11 height=16 xoffset=0 yoffset=6 xadvance=11 page=0 chnl=0 letter="\" +char id=93 x=133 y=81 width=8 height=19 xoffset=0 yoffset=6 xadvance=8 page=0 chnl=0 letter="]" +char id=94 x=102 y=0 width=11 height=12 xoffset=0 yoffset=6 xadvance=11 page=0 chnl=0 letter="^" +char id=95 x=0 y=136 width=13 height=7 xoffset=0 yoffset=17 xadvance=13 page=0 chnl=0 letter="_" +char id=96 x=71 y=134 width=8 height=8 xoffset=0 yoffset=6 xadvance=8 page=0 chnl=0 letter="`" +char id=97 x=100 y=97 width=12 height=13 xoffset=0 yoffset=9 xadvance=12 page=0 chnl=0 letter="a" +char id=98 x=48 y=0 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="b" +char id=99 x=101 y=34 width=11 height=13 xoffset=0 yoffset=9 xadvance=11 page=0 chnl=0 letter="c" +char id=100 x=47 y=34 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="d" +char id=101 x=46 y=116 width=13 height=13 xoffset=0 yoffset=9 xadvance=13 page=0 chnl=0 letter="e" +char id=102 x=101 y=48 width=11 height=16 xoffset=0 yoffset=6 xadvance=11 page=0 chnl=0 letter="f" +char id=103 x=46 y=83 width=13 height=16 xoffset=0 yoffset=9 xadvance=13 page=0 chnl=0 letter="g" +char id=104 x=74 y=117 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="h" +char id=105 x=134 y=10 width=7 height=16 xoffset=0 yoffset=6 xadvance=7 page=0 chnl=0 letter="i" +char id=106 x=123 y=95 width=9 height=19 xoffset=0 yoffset=6 xadvance=9 page=0 chnl=0 letter="j" +char id=107 x=87 y=96 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="k" +char id=108 x=133 y=118 width=7 height=16 xoffset=0 yoffset=6 xadvance=7 page=0 chnl=0 letter="l" +char id=109 x=0 y=116 width=15 height=14 xoffset=0 yoffset=8 xadvance=15 page=0 chnl=0 letter="m" +char id=110 x=46 y=68 width=13 height=14 xoffset=0 yoffset=8 xadvance=13 page=0 chnl=0 letter="n" +char id=111 x=100 y=83 width=12 height=13 xoffset=0 yoffset=9 xadvance=12 page=0 chnl=0 letter="o" +char id=112 x=46 y=100 width=13 height=15 xoffset=0 yoffset=9 xadvance=13 page=0 chnl=0 letter="p" +char id=113 x=47 y=51 width=13 height=15 xoffset=0 yoffset=9 xadvance=13 page=0 chnl=0 letter="q" +char id=114 x=88 y=51 width=12 height=14 xoffset=0 yoffset=8 xadvance=12 page=0 chnl=0 letter="r" +char id=115 x=113 y=47 width=11 height=13 xoffset=0 yoffset=9 xadvance=11 page=0 chnl=0 letter="s" +char id=116 x=113 y=78 width=10 height=16 xoffset=0 yoffset=6 xadvance=10 page=0 chnl=0 letter="t" +char id=117 x=61 y=51 width=12 height=13 xoffset=0 yoffset=9 xadvance=12 page=0 chnl=0 letter="u" +char id=118 x=87 y=68 width=12 height=13 xoffset=0 yoffset=9 xadvance=12 page=0 chnl=0 letter="v" +char id=119 x=0 y=102 width=15 height=13 xoffset=0 yoffset=9 xadvance=15 page=0 chnl=0 letter="w" +char id=120 x=87 y=82 width=12 height=13 xoffset=0 yoffset=9 xadvance=12 page=0 chnl=0 letter="x" +char id=121 x=100 y=66 width=12 height=16 xoffset=0 yoffset=9 xadvance=12 page=0 chnl=0 letter="y" +char id=122 x=87 y=130 width=12 height=13 xoffset=0 yoffset=9 xadvance=12 page=0 chnl=0 letter="z" +char id=123 x=125 y=20 width=8 height=19 xoffset=0 yoffset=6 xadvance=8 page=0 chnl=0 letter="{" +char id=124 x=124 y=0 width=8 height=19 xoffset=0 yoffset=6 xadvance=8 page=0 chnl=0 letter="|" +char id=125 x=114 y=0 width=9 height=19 xoffset=0 yoffset=6 xadvance=9 page=0 chnl=0 letter="}" +char id=126 x=14 y=134 width=12 height=8 xoffset=0 yoffset=10 xadvance=12 page=0 chnl=0 letter="~" +char id=8226 x=113 y=135 width=8 height=8 xoffset=0 yoffset=10 xadvance=8 page=0 chnl=0 letter="•" +char id=169 x=16 y=85 width=14 height=14 xoffset=0 yoffset=7 xadvance=14 page=0 chnl=0 letter="©" +char id=32 x=0 y=0 width=0 height=0 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=0 letter=" " +char id=9 x=0 y=0 width=0 height=0 xoffset=0 yoffset=0 xadvance=64 page=0 chnl=0 letter=" " + +kernings count=606 +kerning first=65 second=39 amount=-3 +kerning first=65 second=67 amount=-1 +kerning first=65 second=71 amount=-2 +kerning first=65 second=79 amount=-1 +kerning first=65 second=81 amount=-1 +kerning first=65 second=84 amount=-3 +kerning first=65 second=85 amount=-2 +kerning first=65 second=86 amount=-4 +kerning first=65 second=87 amount=-3 +kerning first=65 second=89 amount=-4 +kerning first=66 second=65 amount=-1 +kerning first=66 second=69 amount=-1 +kerning first=66 second=76 amount=-1 +kerning first=66 second=80 amount=-1 +kerning first=66 second=82 amount=-1 +kerning first=66 second=85 amount=-1 +kerning first=66 second=86 amount=-2 +kerning first=66 second=87 amount=-2 +kerning first=66 second=89 amount=-2 +kerning first=67 second=65 amount=-1 +kerning first=67 second=79 amount=-1 +kerning first=67 second=82 amount=-1 +kerning first=68 second=65 amount=-1 +kerning first=68 second=68 amount=-1 +kerning first=68 second=69 amount=-1 +kerning first=68 second=73 amount=-1 +kerning first=68 second=76 amount=-1 +kerning first=68 second=77 amount=-1 +kerning first=68 second=78 amount=-1 +kerning first=68 second=79 amount=-1 +kerning first=68 second=80 amount=-1 +kerning first=68 second=82 amount=-1 +kerning first=68 second=85 amount=-1 +kerning first=68 second=86 amount=-2 +kerning first=68 second=87 amount=-1 +kerning first=68 second=89 amount=-2 +kerning first=69 second=67 amount=-1 +kerning first=69 second=79 amount=-1 +kerning first=70 second=65 amount=-1 +kerning first=70 second=67 amount=-1 +kerning first=70 second=71 amount=-1 +kerning first=70 second=79 amount=-1 +kerning first=70 second=46 amount=-2 +kerning first=70 second=44 amount=-3 +kerning first=71 second=69 amount=-1 +kerning first=71 second=79 amount=-1 +kerning first=71 second=82 amount=-1 +kerning first=71 second=85 amount=-1 +kerning first=72 second=79 amount=-1 +kerning first=73 second=67 amount=-1 +kerning first=73 second=71 amount=-1 +kerning first=73 second=79 amount=-1 +kerning first=74 second=65 amount=-1 +kerning first=74 second=79 amount=-1 +kerning first=75 second=79 amount=-2 +kerning first=76 second=39 amount=-6 +kerning first=76 second=67 amount=-2 +kerning first=76 second=84 amount=-5 +kerning first=76 second=86 amount=-5 +kerning first=76 second=87 amount=-4 +kerning first=76 second=89 amount=-5 +kerning first=76 second=71 amount=-3 +kerning first=76 second=79 amount=-2 +kerning first=76 second=85 amount=-3 +kerning first=77 second=71 amount=-1 +kerning first=77 second=79 amount=-1 +kerning first=78 second=67 amount=-1 +kerning first=78 second=71 amount=-1 +kerning first=78 second=79 amount=-1 +kerning first=79 second=65 amount=-1 +kerning first=79 second=66 amount=-1 +kerning first=79 second=68 amount=-1 +kerning first=79 second=69 amount=-1 +kerning first=79 second=70 amount=-1 +kerning first=79 second=72 amount=-1 +kerning first=79 second=73 amount=-1 +kerning first=79 second=75 amount=-1 +kerning first=79 second=76 amount=-1 +kerning first=79 second=77 amount=-1 +kerning first=79 second=78 amount=-1 +kerning first=79 second=80 amount=-1 +kerning first=79 second=82 amount=-1 +kerning first=79 second=84 amount=-1 +kerning first=79 second=85 amount=-1 +kerning first=79 second=86 amount=-2 +kerning first=79 second=87 amount=-1 +kerning first=79 second=88 amount=-2 +kerning first=79 second=89 amount=-2 +kerning first=80 second=65 amount=-1 +kerning first=80 second=69 amount=-1 +kerning first=80 second=76 amount=-1 +kerning first=80 second=79 amount=-1 +kerning first=80 second=80 amount=-1 +kerning first=80 second=85 amount=-1 +kerning first=80 second=89 amount=-1 +kerning first=80 second=46 amount=-2 +kerning first=80 second=44 amount=-3 +kerning first=80 second=59 amount=-2 +kerning first=80 second=58 amount=-1 +kerning first=81 second=85 amount=-1 +kerning first=82 second=67 amount=-1 +kerning first=82 second=71 amount=-1 +kerning first=82 second=89 amount=-1 +kerning first=82 second=84 amount=-1 +kerning first=82 second=85 amount=-1 +kerning first=82 second=86 amount=-1 +kerning first=82 second=87 amount=-1 +kerning first=82 second=89 amount=-1 +kerning first=83 second=73 amount=-1 +kerning first=83 second=77 amount=-1 +kerning first=83 second=84 amount=-2 +kerning first=83 second=85 amount=-1 +kerning first=84 second=65 amount=-4 +kerning first=84 second=67 amount=-2 +kerning first=84 second=79 amount=-2 +kerning first=85 second=65 amount=-1 +kerning first=85 second=67 amount=-1 +kerning first=85 second=71 amount=-1 +kerning first=85 second=79 amount=-1 +kerning first=85 second=83 amount=-1 +kerning first=86 second=65 amount=-3 +kerning first=86 second=67 amount=-2 +kerning first=86 second=71 amount=-2 +kerning first=86 second=79 amount=-2 +kerning first=86 second=83 amount=-1 +kerning first=87 second=65 amount=-2 +kerning first=87 second=67 amount=-1 +kerning first=87 second=71 amount=-2 +kerning first=87 second=79 amount=-1 +kerning first=89 second=65 amount=-4 +kerning first=89 second=67 amount=-2 +kerning first=89 second=79 amount=-2 +kerning first=89 second=83 amount=-1 +kerning first=90 second=79 amount=-2 +kerning first=65 second=99 amount=-1 +kerning first=65 second=100 amount=-2 +kerning first=65 second=101 amount=-2 +kerning first=65 second=103 amount=-1 +kerning first=65 second=111 amount=-1 +kerning first=65 second=112 amount=-1 +kerning first=65 second=113 amount=-2 +kerning first=65 second=116 amount=-2 +kerning first=65 second=117 amount=-2 +kerning first=65 second=118 amount=-2 +kerning first=65 second=119 amount=-2 +kerning first=65 second=121 amount=-2 +kerning first=66 second=98 amount=-1 +kerning first=66 second=105 amount=-1 +kerning first=66 second=107 amount=-1 +kerning first=66 second=108 amount=-1 +kerning first=66 second=114 amount=-1 +kerning first=66 second=117 amount=-1 +kerning first=66 second=121 amount=-2 +kerning first=66 second=46 amount=-1 +kerning first=66 second=44 amount=-2 +kerning first=67 second=97 amount=-1 +kerning first=67 second=114 amount=-1 +kerning first=67 second=46 amount=-1 +kerning first=67 second=44 amount=-2 +kerning first=68 second=97 amount=-1 +kerning first=68 second=46 amount=-2 +kerning first=68 second=44 amount=-3 +kerning first=69 second=117 amount=-1 +kerning first=69 second=118 amount=-1 +kerning first=70 second=97 amount=-1 +kerning first=70 second=101 amount=-1 +kerning first=70 second=105 amount=-1 +kerning first=70 second=111 amount=-1 +kerning first=70 second=114 amount=-1 +kerning first=70 second=116 amount=-1 +kerning first=70 second=117 amount=-1 +kerning first=70 second=121 amount=-1 +kerning first=70 second=46 amount=-2 +kerning first=70 second=44 amount=-3 +kerning first=70 second=59 amount=-2 +kerning first=70 second=58 amount=-1 +kerning first=71 second=117 amount=-1 +kerning first=72 second=101 amount=-1 +kerning first=72 second=111 amount=-1 +kerning first=72 second=117 amount=-1 +kerning first=72 second=121 amount=-1 +kerning first=73 second=99 amount=-1 +kerning first=73 second=100 amount=-1 +kerning first=73 second=113 amount=-1 +kerning first=73 second=111 amount=-1 +kerning first=73 second=116 amount=-1 +kerning first=74 second=97 amount=-1 +kerning first=74 second=101 amount=-1 +kerning first=74 second=111 amount=-1 +kerning first=74 second=117 amount=-1 +kerning first=74 second=46 amount=-2 +kerning first=74 second=44 amount=-2 +kerning first=75 second=101 amount=-3 +kerning first=75 second=111 amount=-2 +kerning first=75 second=117 amount=-2 +kerning first=76 second=117 amount=-3 +kerning first=76 second=121 amount=-2 +kerning first=77 second=97 amount=-1 +kerning first=77 second=99 amount=-1 +kerning first=77 second=100 amount=-1 +kerning first=77 second=101 amount=-1 +kerning first=77 second=111 amount=-1 +kerning first=78 second=117 amount=-1 +kerning first=78 second=97 amount=-1 +kerning first=78 second=101 amount=-1 +kerning first=78 second=105 amount=-1 +kerning first=78 second=111 amount=-1 +kerning first=78 second=117 amount=-1 +kerning first=78 second=46 amount=-1 +kerning first=78 second=44 amount=-2 +kerning first=79 second=97 amount=-1 +kerning first=79 second=98 amount=-1 +kerning first=79 second=104 amount=-1 +kerning first=79 second=107 amount=-1 +kerning first=79 second=108 amount=-1 +kerning first=79 second=46 amount=-1 +kerning first=79 second=44 amount=-2 +kerning first=80 second=97 amount=-1 +kerning first=80 second=101 amount=-1 +kerning first=80 second=111 amount=-1 +kerning first=82 second=100 amount=-2 +kerning first=82 second=101 amount=-2 +kerning first=82 second=111 amount=-1 +kerning first=82 second=116 amount=-1 +kerning first=82 second=117 amount=-1 +kerning first=83 second=105 amount=-1 +kerning first=83 second=112 amount=-1 +kerning first=83 second=117 amount=-1 +kerning first=83 second=46 amount=-2 +kerning first=83 second=44 amount=-2 +kerning first=84 second=97 amount=-2 +kerning first=84 second=99 amount=-2 +kerning first=84 second=101 amount=-3 +kerning first=84 second=105 amount=-1 +kerning first=84 second=111 amount=-2 +kerning first=84 second=114 amount=-3 +kerning first=84 second=115 amount=-2 +kerning first=84 second=117 amount=-3 +kerning first=84 second=119 amount=-2 +kerning first=84 second=121 amount=-2 +kerning first=84 second=46 amount=-5 +kerning first=84 second=44 amount=-5 +kerning first=84 second=59 amount=-3 +kerning first=84 second=58 amount=-2 +kerning first=85 second=97 amount=-1 +kerning first=85 second=103 amount=-1 +kerning first=85 second=109 amount=-1 +kerning first=85 second=110 amount=-1 +kerning first=85 second=112 amount=-1 +kerning first=85 second=115 amount=-1 +kerning first=85 second=46 amount=-1 +kerning first=85 second=44 amount=-2 +kerning first=86 second=97 amount=-2 +kerning first=86 second=101 amount=-3 +kerning first=86 second=105 amount=-1 +kerning first=86 second=111 amount=-2 +kerning first=86 second=114 amount=-2 +kerning first=86 second=117 amount=-2 +kerning first=86 second=46 amount=-4 +kerning first=86 second=44 amount=-4 +kerning first=86 second=59 amount=-3 +kerning first=86 second=58 amount=-2 +kerning first=87 second=100 amount=-2 +kerning first=87 second=105 amount=-1 +kerning first=87 second=109 amount=-1 +kerning first=87 second=114 amount=-2 +kerning first=87 second=116 amount=-1 +kerning first=87 second=117 amount=-2 +kerning first=87 second=121 amount=-1 +kerning first=87 second=46 amount=-3 +kerning first=87 second=44 amount=-3 +kerning first=87 second=59 amount=-2 +kerning first=87 second=58 amount=-1 +kerning first=88 second=97 amount=-1 +kerning first=88 second=101 amount=-2 +kerning first=88 second=111 amount=-1 +kerning first=88 second=117 amount=-2 +kerning first=88 second=121 amount=-1 +kerning first=89 second=100 amount=-3 +kerning first=89 second=101 amount=-3 +kerning first=89 second=105 amount=-1 +kerning first=89 second=112 amount=-3 +kerning first=89 second=117 amount=-3 +kerning first=89 second=118 amount=-2 +kerning first=89 second=46 amount=-4 +kerning first=89 second=44 amount=-5 +kerning first=89 second=59 amount=-3 +kerning first=89 second=58 amount=-2 +kerning first=97 second=99 amount=-1 +kerning first=97 second=100 amount=-1 +kerning first=97 second=101 amount=-1 +kerning first=97 second=103 amount=-1 +kerning first=97 second=112 amount=-1 +kerning first=97 second=102 amount=-1 +kerning first=97 second=116 amount=-1 +kerning first=97 second=117 amount=-1 +kerning first=97 second=118 amount=-1 +kerning first=97 second=119 amount=-1 +kerning first=97 second=121 amount=-1 +kerning first=97 second=112 amount=-1 +kerning first=98 second=108 amount=-1 +kerning first=98 second=114 amount=-1 +kerning first=98 second=117 amount=-1 +kerning first=98 second=121 amount=-2 +kerning first=98 second=46 amount=-2 +kerning first=98 second=44 amount=-2 +kerning first=99 second=97 amount=-1 +kerning first=99 second=104 amount=-1 +kerning first=99 second=107 amount=-1 +kerning first=100 second=97 amount=-1 +kerning first=100 second=99 amount=-1 +kerning first=100 second=101 amount=-1 +kerning first=100 second=103 amount=-1 +kerning first=100 second=111 amount=-1 +kerning first=100 second=116 amount=-1 +kerning first=100 second=117 amount=-1 +kerning first=100 second=118 amount=-1 +kerning first=100 second=119 amount=-1 +kerning first=100 second=121 amount=-1 +kerning first=100 second=46 amount=-1 +kerning first=100 second=44 amount=-1 +kerning first=101 second=97 amount=-1 +kerning first=101 second=105 amount=-1 +kerning first=101 second=108 amount=-1 +kerning first=101 second=109 amount=-1 +kerning first=101 second=110 amount=-1 +kerning first=101 second=112 amount=-1 +kerning first=101 second=114 amount=-1 +kerning first=101 second=116 amount=-1 +kerning first=101 second=117 amount=-1 +kerning first=101 second=118 amount=-1 +kerning first=101 second=119 amount=-1 +kerning first=101 second=121 amount=-1 +kerning first=101 second=46 amount=-2 +kerning first=101 second=44 amount=-2 +kerning first=102 second=97 amount=-2 +kerning first=102 second=101 amount=-3 +kerning first=102 second=102 amount=-2 +kerning first=102 second=105 amount=-1 +kerning first=102 second=108 amount=-1 +kerning first=102 second=111 amount=-2 +kerning first=102 second=46 amount=-4 +kerning first=102 second=44 amount=-4 +kerning first=103 second=97 amount=-1 +kerning first=103 second=101 amount=-1 +kerning first=103 second=104 amount=-1 +kerning first=103 second=108 amount=-1 +kerning first=103 second=111 amount=-1 +kerning first=103 second=103 amount=-1 +kerning first=103 second=46 amount=-1 +kerning first=103 second=44 amount=-2 +kerning first=104 second=99 amount=-1 +kerning first=104 second=100 amount=-1 +kerning first=104 second=101 amount=-1 +kerning first=104 second=103 amount=-1 +kerning first=104 second=111 amount=-1 +kerning first=104 second=112 amount=-1 +kerning first=104 second=116 amount=-2 +kerning first=104 second=117 amount=-1 +kerning first=104 second=118 amount=-2 +kerning first=104 second=119 amount=-2 +kerning first=104 second=121 amount=-2 +kerning first=105 second=99 amount=-1 +kerning first=105 second=100 amount=-1 +kerning first=105 second=101 amount=-1 +kerning first=105 second=103 amount=-1 +kerning first=105 second=111 amount=-1 +kerning first=105 second=112 amount=-1 +kerning first=105 second=116 amount=-1 +kerning first=105 second=117 amount=-1 +kerning first=105 second=118 amount=-1 +kerning first=106 second=97 amount=-1 +kerning first=106 second=101 amount=-1 +kerning first=106 second=111 amount=-1 +kerning first=106 second=117 amount=-1 +kerning first=106 second=46 amount=-1 +kerning first=106 second=44 amount=-1 +kerning first=107 second=97 amount=-1 +kerning first=107 second=99 amount=-1 +kerning first=107 second=100 amount=-2 +kerning first=107 second=101 amount=-2 +kerning first=107 second=103 amount=-1 +kerning first=107 second=111 amount=-1 +kerning first=108 second=97 amount=-1 +kerning first=108 second=99 amount=-1 +kerning first=108 second=100 amount=-1 +kerning first=108 second=101 amount=-1 +kerning first=108 second=102 amount=-1 +kerning first=108 second=103 amount=-1 +kerning first=108 second=111 amount=-1 +kerning first=108 second=112 amount=-1 +kerning first=108 second=113 amount=-1 +kerning first=108 second=117 amount=-1 +kerning first=108 second=118 amount=-1 +kerning first=108 second=119 amount=-1 +kerning first=108 second=121 amount=-1 +kerning first=109 second=97 amount=-1 +kerning first=109 second=99 amount=-1 +kerning first=109 second=100 amount=-1 +kerning first=109 second=101 amount=-1 +kerning first=109 second=103 amount=-1 +kerning first=109 second=110 amount=-1 +kerning first=109 second=111 amount=-1 +kerning first=109 second=112 amount=-1 +kerning first=109 second=116 amount=-1 +kerning first=109 second=117 amount=-1 +kerning first=109 second=118 amount=-1 +kerning first=109 second=121 amount=-1 +kerning first=110 second=99 amount=-1 +kerning first=110 second=100 amount=-1 +kerning first=110 second=101 amount=-1 +kerning first=110 second=103 amount=-1 +kerning first=110 second=111 amount=-1 +kerning first=110 second=112 amount=-1 +kerning first=110 second=116 amount=-2 +kerning first=110 second=117 amount=-1 +kerning first=110 second=118 amount=-2 +kerning first=110 second=119 amount=-2 +kerning first=110 second=121 amount=-2 +kerning first=111 second=98 amount=-1 +kerning first=111 second=102 amount=-1 +kerning first=111 second=104 amount=-1 +kerning first=111 second=106 amount=-2 +kerning first=111 second=107 amount=-1 +kerning first=111 second=108 amount=-1 +kerning first=111 second=109 amount=-1 +kerning first=111 second=110 amount=-1 +kerning first=111 second=112 amount=-1 +kerning first=111 second=114 amount=-1 +kerning first=111 second=117 amount=-1 +kerning first=111 second=118 amount=-1 +kerning first=111 second=119 amount=-1 +kerning first=111 second=120 amount=-1 +kerning first=111 second=121 amount=-1 +kerning first=111 second=46 amount=-1 +kerning first=111 second=44 amount=-2 +kerning first=112 second=97 amount=-1 +kerning first=112 second=104 amount=-1 +kerning first=112 second=105 amount=-1 +kerning first=112 second=108 amount=-1 +kerning first=112 second=112 amount=-1 +kerning first=112 second=117 amount=-1 +kerning first=112 second=46 amount=-1 +kerning first=112 second=44 amount=-2 +kerning first=113 second=117 amount=-1 +kerning first=116 second=46 amount=-1 +kerning first=114 second=97 amount=-1 +kerning first=114 second=100 amount=-2 +kerning first=114 second=101 amount=-2 +kerning first=114 second=103 amount=-1 +kerning first=114 second=107 amount=-1 +kerning first=114 second=108 amount=-1 +kerning first=114 second=109 amount=-1 +kerning first=114 second=110 amount=-1 +kerning first=114 second=111 amount=-1 +kerning first=114 second=113 amount=-2 +kerning first=114 second=114 amount=-1 +kerning first=114 second=116 amount=-1 +kerning first=114 second=118 amount=-1 +kerning first=114 second=121 amount=-1 +kerning first=114 second=46 amount=-3 +kerning first=114 second=44 amount=-4 +kerning first=115 second=104 amount=-1 +kerning first=115 second=116 amount=-1 +kerning first=115 second=117 amount=-1 +kerning first=115 second=46 amount=-1 +kerning first=115 second=44 amount=-2 +kerning first=116 second=100 amount=-2 +kerning first=116 second=97 amount=-1 +kerning first=116 second=101 amount=-2 +kerning first=116 second=111 amount=-1 +kerning first=116 second=46 amount=-1 +kerning first=116 second=44 amount=-1 +kerning first=117 second=97 amount=-1 +kerning first=117 second=99 amount=-1 +kerning first=117 second=100 amount=-1 +kerning first=117 second=101 amount=-1 +kerning first=117 second=103 amount=-1 +kerning first=117 second=111 amount=-1 +kerning first=117 second=112 amount=-1 +kerning first=117 second=113 amount=-1 +kerning first=117 second=116 amount=-1 +kerning first=117 second=118 amount=-1 +kerning first=117 second=119 amount=-1 +kerning first=117 second=121 amount=-1 +kerning first=118 second=97 amount=-1 +kerning first=118 second=98 amount=-1 +kerning first=118 second=99 amount=-1 +kerning first=118 second=100 amount=-2 +kerning first=118 second=101 amount=-2 +kerning first=118 second=103 amount=-1 +kerning first=118 second=111 amount=-1 +kerning first=118 second=118 amount=-1 +kerning first=118 second=121 amount=-1 +kerning first=118 second=46 amount=-2 +kerning first=118 second=44 amount=-3 +kerning first=119 second=97 amount=-1 +kerning first=119 second=120 amount=-1 +kerning first=119 second=100 amount=-2 +kerning first=119 second=101 amount=-2 +kerning first=119 second=103 amount=-1 +kerning first=119 second=104 amount=-1 +kerning first=119 second=111 amount=-1 +kerning first=119 second=46 amount=-2 +kerning first=119 second=44 amount=-3 +kerning first=120 second=97 amount=-1 +kerning first=120 second=101 amount=-2 +kerning first=120 second=111 amount=-1 +kerning first=121 second=46 amount=-2 +kerning first=121 second=44 amount=-3 +kerning first=121 second=97 amount=-1 +kerning first=121 second=99 amount=-1 +kerning first=121 second=100 amount=-2 +kerning first=121 second=101 amount=-2 +kerning first=121 second=111 amount=-1 +kerning first=117 second=109 amount=-1 +kerning first=84 second=104 amount=-1 +kerning first=118 second=101 amount=-2 +kerning first=119 second=110 amount=-1 +kerning first=112 second=115 amount=-1 +kerning first=76 second=97 amount=-2 +kerning first=117 second=105 amount=-1 +kerning first=98 second=101 amount=-1 +kerning first=99 second=111 amount=-1 +kerning first=102 second=103 amount=-2 +kerning first=118 second=119 amount=-1 +kerning first=120 second=121 amount=-1 +kerning first=121 second=122 amount=-1 +kerning first=119 second=119 amount=-1 +kerning first=99 second=101 amount=-1 +kerning first=101 second=115 amount=-1 +kerning first=101 second=102 amount=-1 +kerning first=98 second=97 amount=-1 +kerning first=116 second=104 amount=-1 +kerning first=116 second=105 amount=-1 +kerning first=101 second=101 amount=-1 +kerning first=104 second=97 amount=-1 +kerning first=111 second=101 amount=-1 +kerning first=119 second=105 amount=-1 +kerning first=88 second=89 amount=-1 +kerning first=89 second=90 amount=-1 +kerning first=82 second=83 amount=-1 +kerning first=75 second=76 amount=-2 +kerning first=101 second=100 amount=-1 +kerning first=116 second=111 amount=-1 +kerning first=87 second=104 amount=-1 +kerning first=107 second=110 amount=-2 +kerning first=119 second=115 amount=-1 +kerning first=116 second=114 amount=-1 +kerning first=102 second=114 amount=-2 +kerning first=65 second=110 amount=-1 +kerning first=116 second=116 amount=-1 +kerning first=66 second=67 amount=-1 +kerning first=67 second=68 amount=-1 +kerning first=65 second=66 amount=-1 +kerning first=89 second=111 amount=-2 +kerning first=102 second=117 amount=-2 +kerning first=67 second=111 amount=-1 +kerning first=116 second=115 amount=-1 +kerning first=111 second=111 amount=-1 +kerning first=68 second=111 amount=-1 +kerning first=101 second=97 amount=-1 +kerning first=76 second=111 amount=-2 +kerning first=115 second=105 amount=-1 +kerning first=111 second=116 amount=-1 +kerning first=111 second=103 amount=-1 +kerning first=82 second=97 amount=-1 +kerning first=101 second=99 amount=-1 +kerning first=66 second=111 amount=-1 +kerning first=111 second=99 amount=-1 +kerning first=115 second=111 amount=-1 +kerning first=83 second=119 amount=-2 +kerning first=66 second=101 amount=-1 +kerning first=99 second=116 amount=-1 +kerning first=98 second=106 amount=-3 +kerning first=115 second=101 amount=-1 +kerning first=121 second=119 amount=-1 +kerning first=111 second=97 amount=-1 +kerning first=68 second=88 amount=-2 +kerning first=101 second=98 amount=-1 +kerning first=115 second=119 amount=-1 +kerning first=97 second=120 amount=-1 +kerning first=73 second=110 amount=-1 +kerning first=73 second=74 amount=-1 +kerning first=116 second=112 amount=-1 +kerning first=104 second=105 amount=-1 +kerning first=105 second=115 amount=-1 +kerning first=98 second=99 amount=-1 +kerning first=115 second=112 amount=-1 +kerning first=100 second=105 amount=-1 +kerning first=105 second=106 amount=-1 +kerning first=108 second=109 amount=-1 +kerning first=107 second=108 amount=-1 +kerning first=108 second=105 amount=-1 +kerning first=112 second=113 amount=-1 +kerning first=108 second=108 amount=-1 +kerning first=49 second=50 amount=-1 +kerning first=106 second=107 amount=-1 +kerning first=117 second=110 amount=-1 +kerning first=113 second=114 amount=-1 +kerning first=116 second=117 amount=-1 +kerning first=114 second=115 amount=-1 +kerning first=117 second=114 amount=-1 +kerning first=73 second=112 amount=-1 +kerning first=79 second=112 amount=-1 +kerning first=101 second=103 amount=-1 diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/neon/font-pressed-export.fnt b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/neon/font-pressed-export.fnt new file mode 100644 index 0000000..eb5509d --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/neon/font-pressed-export.fnt @@ -0,0 +1,710 @@ +info face="font-pressed-export" size=32 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 +common lineHeight=22 base=22 scaleW=142 scaleH=144 pages=1 packed=0 alphaChnl=1 redChnl=0 greenChnl=0 blueChnl=0 +page id=0 file="font-pressed-export.png" +chars count=98 +char id=33 x=133 y=101 width=7 height=16 xoffset=0 yoffset=6 xadvance=7 page=0 chnl=0 letter="!" +char id=34 x=123 y=132 width=9 height=10 xoffset=0 yoffset=6 xadvance=9 page=0 chnl=0 letter=""" +char id=35 x=16 y=68 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="#" +char id=36 x=74 y=98 width=12 height=18 xoffset=0 yoffset=5 xadvance=12 page=0 chnl=0 letter="$" +char id=37 x=0 y=0 width=17 height=16 xoffset=0 yoffset=6 xadvance=17 page=0 chnl=0 letter="%" +char id=38 x=16 y=100 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="&" +char id=39 x=133 y=0 width=7 height=9 xoffset=0 yoffset=6 xadvance=7 page=0 chnl=0 letter="'" +char id=40 x=113 y=115 width=9 height=19 xoffset=0 yoffset=6 xadvance=9 page=0 chnl=0 letter="(" +char id=41 x=124 y=61 width=9 height=19 xoffset=0 yoffset=6 xadvance=9 page=0 chnl=0 letter=")" +char id=42 x=60 y=132 width=10 height=10 xoffset=0 yoffset=6 xadvance=10 page=0 chnl=0 letter="*" +char id=43 x=74 y=68 width=12 height=12 xoffset=0 yoffset=9 xadvance=12 page=0 chnl=0 letter="+" +char id=44 x=114 y=20 width=8 height=9 xoffset=0 yoffset=15 xadvance=8 page=0 chnl=0 letter="," +char id=45 x=27 y=136 width=11 height=7 xoffset=0 yoffset=12 xadvance=11 page=0 chnl=0 letter="-" +char id=46 x=124 y=81 width=7 height=8 xoffset=0 yoffset=14 xadvance=7 page=0 chnl=0 letter="." +char id=47 x=113 y=61 width=10 height=16 xoffset=0 yoffset=6 xadvance=10 page=0 chnl=0 letter="/" +char id=48 x=74 y=81 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="0" +char id=49 x=123 y=115 width=9 height=16 xoffset=0 yoffset=6 xadvance=9 page=0 chnl=0 letter="1" +char id=50 x=75 y=34 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="2" +char id=51 x=76 y=17 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="3" +char id=52 x=60 y=67 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="4" +char id=53 x=88 y=34 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="5" +char id=54 x=62 y=17 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="6" +char id=55 x=60 y=84 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="7" +char id=56 x=100 y=111 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="8" +char id=57 x=60 y=115 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="9" +char id=58 x=134 y=44 width=7 height=13 xoffset=0 yoffset=9 xadvance=7 page=0 chnl=0 letter=":" +char id=59 x=125 y=40 width=8 height=15 xoffset=0 yoffset=9 xadvance=8 page=0 chnl=0 letter=";" +char id=60 x=100 y=128 width=12 height=13 xoffset=0 yoffset=9 xadvance=12 page=0 chnl=0 letter="<" +char id=61 x=46 y=130 width=13 height=10 xoffset=0 yoffset=10 xadvance=13 page=0 chnl=0 letter="=" +char id=62 x=60 y=101 width=13 height=13 xoffset=0 yoffset=9 xadvance=13 page=0 chnl=0 letter=">" +char id=63 x=102 y=13 width=11 height=16 xoffset=0 yoffset=6 xadvance=11 page=0 chnl=0 letter="?" +char id=64 x=0 y=85 width=15 height=16 xoffset=0 yoffset=6 xadvance=15 page=0 chnl=0 letter="@" +char id=65 x=16 y=117 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="A" +char id=66 x=18 y=0 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="B" +char id=67 x=31 y=85 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="C" +char id=68 x=18 y=17 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="D" +char id=69 x=89 y=17 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="E" +char id=70 x=89 y=0 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="F" +char id=71 x=16 y=51 width=15 height=16 xoffset=0 yoffset=6 xadvance=15 page=0 chnl=0 letter="G" +char id=72 x=32 y=34 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="H" +char id=73 x=134 y=27 width=7 height=16 xoffset=0 yoffset=6 xadvance=7 page=0 chnl=0 letter="I" +char id=74 x=87 y=113 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="J" +char id=75 x=32 y=51 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="K" +char id=76 x=48 y=17 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="L" +char id=77 x=0 y=34 width=16 height=16 xoffset=0 yoffset=6 xadvance=16 page=0 chnl=0 letter="M" +char id=78 x=17 y=34 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="N" +char id=79 x=0 y=68 width=15 height=16 xoffset=0 yoffset=6 xadvance=15 page=0 chnl=0 letter="O" +char id=80 x=76 y=0 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="P" +char id=81 x=0 y=51 width=15 height=16 xoffset=0 yoffset=6 xadvance=15 page=0 chnl=0 letter="Q" +char id=82 x=74 y=51 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="R" +char id=83 x=62 y=0 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="S" +char id=84 x=31 y=68 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="T" +char id=85 x=31 y=102 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="U" +char id=86 x=33 y=0 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="V" +char id=87 x=0 y=17 width=17 height=16 xoffset=0 yoffset=6 xadvance=17 page=0 chnl=0 letter="W" +char id=88 x=33 y=17 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="X" +char id=89 x=31 y=119 width=14 height=16 xoffset=0 yoffset=6 xadvance=14 page=0 chnl=0 letter="Y" +char id=90 x=61 y=34 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="Z" +char id=91 x=113 y=95 width=9 height=19 xoffset=0 yoffset=6 xadvance=9 page=0 chnl=0 letter="[" +char id=92 x=113 y=30 width=11 height=16 xoffset=0 yoffset=6 xadvance=11 page=0 chnl=0 letter="\" +char id=93 x=133 y=81 width=8 height=19 xoffset=0 yoffset=6 xadvance=8 page=0 chnl=0 letter="]" +char id=94 x=102 y=0 width=11 height=12 xoffset=0 yoffset=6 xadvance=11 page=0 chnl=0 letter="^" +char id=95 x=0 y=136 width=13 height=7 xoffset=0 yoffset=17 xadvance=13 page=0 chnl=0 letter="_" +char id=96 x=71 y=134 width=8 height=8 xoffset=0 yoffset=6 xadvance=8 page=0 chnl=0 letter="`" +char id=97 x=100 y=97 width=12 height=13 xoffset=0 yoffset=9 xadvance=12 page=0 chnl=0 letter="a" +char id=98 x=48 y=0 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="b" +char id=99 x=101 y=34 width=11 height=13 xoffset=0 yoffset=9 xadvance=11 page=0 chnl=0 letter="c" +char id=100 x=47 y=34 width=13 height=16 xoffset=0 yoffset=6 xadvance=13 page=0 chnl=0 letter="d" +char id=101 x=46 y=116 width=13 height=13 xoffset=0 yoffset=9 xadvance=13 page=0 chnl=0 letter="e" +char id=102 x=101 y=48 width=11 height=16 xoffset=0 yoffset=6 xadvance=11 page=0 chnl=0 letter="f" +char id=103 x=46 y=83 width=13 height=16 xoffset=0 yoffset=9 xadvance=13 page=0 chnl=0 letter="g" +char id=104 x=74 y=117 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="h" +char id=105 x=134 y=10 width=7 height=16 xoffset=0 yoffset=6 xadvance=7 page=0 chnl=0 letter="i" +char id=106 x=123 y=95 width=9 height=19 xoffset=0 yoffset=6 xadvance=9 page=0 chnl=0 letter="j" +char id=107 x=87 y=96 width=12 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 letter="k" +char id=108 x=133 y=118 width=7 height=16 xoffset=0 yoffset=6 xadvance=7 page=0 chnl=0 letter="l" +char id=109 x=0 y=116 width=15 height=14 xoffset=0 yoffset=8 xadvance=15 page=0 chnl=0 letter="m" +char id=110 x=46 y=68 width=13 height=14 xoffset=0 yoffset=8 xadvance=13 page=0 chnl=0 letter="n" +char id=111 x=100 y=83 width=12 height=13 xoffset=0 yoffset=9 xadvance=12 page=0 chnl=0 letter="o" +char id=112 x=46 y=100 width=13 height=15 xoffset=0 yoffset=9 xadvance=13 page=0 chnl=0 letter="p" +char id=113 x=47 y=51 width=13 height=15 xoffset=0 yoffset=9 xadvance=13 page=0 chnl=0 letter="q" +char id=114 x=88 y=51 width=12 height=14 xoffset=0 yoffset=8 xadvance=12 page=0 chnl=0 letter="r" +char id=115 x=113 y=47 width=11 height=13 xoffset=0 yoffset=9 xadvance=11 page=0 chnl=0 letter="s" +char id=116 x=113 y=78 width=10 height=16 xoffset=0 yoffset=6 xadvance=10 page=0 chnl=0 letter="t" +char id=117 x=61 y=51 width=12 height=13 xoffset=0 yoffset=9 xadvance=12 page=0 chnl=0 letter="u" +char id=118 x=87 y=68 width=12 height=13 xoffset=0 yoffset=9 xadvance=12 page=0 chnl=0 letter="v" +char id=119 x=0 y=102 width=15 height=13 xoffset=0 yoffset=9 xadvance=15 page=0 chnl=0 letter="w" +char id=120 x=87 y=82 width=12 height=13 xoffset=0 yoffset=9 xadvance=12 page=0 chnl=0 letter="x" +char id=121 x=100 y=66 width=12 height=16 xoffset=0 yoffset=9 xadvance=12 page=0 chnl=0 letter="y" +char id=122 x=87 y=130 width=12 height=13 xoffset=0 yoffset=9 xadvance=12 page=0 chnl=0 letter="z" +char id=123 x=125 y=20 width=8 height=19 xoffset=0 yoffset=6 xadvance=8 page=0 chnl=0 letter="{" +char id=124 x=124 y=0 width=8 height=19 xoffset=0 yoffset=6 xadvance=8 page=0 chnl=0 letter="|" +char id=125 x=114 y=0 width=9 height=19 xoffset=0 yoffset=6 xadvance=9 page=0 chnl=0 letter="}" +char id=126 x=14 y=134 width=12 height=8 xoffset=0 yoffset=10 xadvance=12 page=0 chnl=0 letter="~" +char id=8226 x=113 y=135 width=8 height=8 xoffset=0 yoffset=10 xadvance=8 page=0 chnl=0 letter="•" +char id=169 x=16 y=85 width=14 height=14 xoffset=0 yoffset=7 xadvance=14 page=0 chnl=0 letter="©" +char id=32 x=0 y=0 width=0 height=0 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=0 letter=" " +char id=9 x=0 y=0 width=0 height=0 xoffset=0 yoffset=0 xadvance=64 page=0 chnl=0 letter=" " + +kernings count=606 +kerning first=65 second=39 amount=-3 +kerning first=65 second=67 amount=-1 +kerning first=65 second=71 amount=-2 +kerning first=65 second=79 amount=-1 +kerning first=65 second=81 amount=-1 +kerning first=65 second=84 amount=-3 +kerning first=65 second=85 amount=-2 +kerning first=65 second=86 amount=-4 +kerning first=65 second=87 amount=-3 +kerning first=65 second=89 amount=-4 +kerning first=66 second=65 amount=-1 +kerning first=66 second=69 amount=-1 +kerning first=66 second=76 amount=-1 +kerning first=66 second=80 amount=-1 +kerning first=66 second=82 amount=-1 +kerning first=66 second=85 amount=-1 +kerning first=66 second=86 amount=-2 +kerning first=66 second=87 amount=-2 +kerning first=66 second=89 amount=-2 +kerning first=67 second=65 amount=-1 +kerning first=67 second=79 amount=-1 +kerning first=67 second=82 amount=-1 +kerning first=68 second=65 amount=-1 +kerning first=68 second=68 amount=-1 +kerning first=68 second=69 amount=-1 +kerning first=68 second=73 amount=-1 +kerning first=68 second=76 amount=-1 +kerning first=68 second=77 amount=-1 +kerning first=68 second=78 amount=-1 +kerning first=68 second=79 amount=-1 +kerning first=68 second=80 amount=-1 +kerning first=68 second=82 amount=-1 +kerning first=68 second=85 amount=-1 +kerning first=68 second=86 amount=-2 +kerning first=68 second=87 amount=-1 +kerning first=68 second=89 amount=-2 +kerning first=69 second=67 amount=-1 +kerning first=69 second=79 amount=-1 +kerning first=70 second=65 amount=-1 +kerning first=70 second=67 amount=-1 +kerning first=70 second=71 amount=-1 +kerning first=70 second=79 amount=-1 +kerning first=70 second=46 amount=-2 +kerning first=70 second=44 amount=-3 +kerning first=71 second=69 amount=-1 +kerning first=71 second=79 amount=-1 +kerning first=71 second=82 amount=-1 +kerning first=71 second=85 amount=-1 +kerning first=72 second=79 amount=-1 +kerning first=73 second=67 amount=-1 +kerning first=73 second=71 amount=-1 +kerning first=73 second=79 amount=-1 +kerning first=74 second=65 amount=-1 +kerning first=74 second=79 amount=-1 +kerning first=75 second=79 amount=-2 +kerning first=76 second=39 amount=-6 +kerning first=76 second=67 amount=-2 +kerning first=76 second=84 amount=-5 +kerning first=76 second=86 amount=-5 +kerning first=76 second=87 amount=-4 +kerning first=76 second=89 amount=-5 +kerning first=76 second=71 amount=-3 +kerning first=76 second=79 amount=-2 +kerning first=76 second=85 amount=-3 +kerning first=77 second=71 amount=-1 +kerning first=77 second=79 amount=-1 +kerning first=78 second=67 amount=-1 +kerning first=78 second=71 amount=-1 +kerning first=78 second=79 amount=-1 +kerning first=79 second=65 amount=-1 +kerning first=79 second=66 amount=-1 +kerning first=79 second=68 amount=-1 +kerning first=79 second=69 amount=-1 +kerning first=79 second=70 amount=-1 +kerning first=79 second=72 amount=-1 +kerning first=79 second=73 amount=-1 +kerning first=79 second=75 amount=-1 +kerning first=79 second=76 amount=-1 +kerning first=79 second=77 amount=-1 +kerning first=79 second=78 amount=-1 +kerning first=79 second=80 amount=-1 +kerning first=79 second=82 amount=-1 +kerning first=79 second=84 amount=-1 +kerning first=79 second=85 amount=-1 +kerning first=79 second=86 amount=-2 +kerning first=79 second=87 amount=-1 +kerning first=79 second=88 amount=-2 +kerning first=79 second=89 amount=-2 +kerning first=80 second=65 amount=-1 +kerning first=80 second=69 amount=-1 +kerning first=80 second=76 amount=-1 +kerning first=80 second=79 amount=-1 +kerning first=80 second=80 amount=-1 +kerning first=80 second=85 amount=-1 +kerning first=80 second=89 amount=-1 +kerning first=80 second=46 amount=-2 +kerning first=80 second=44 amount=-3 +kerning first=80 second=59 amount=-2 +kerning first=80 second=58 amount=-1 +kerning first=81 second=85 amount=-1 +kerning first=82 second=67 amount=-1 +kerning first=82 second=71 amount=-1 +kerning first=82 second=89 amount=-1 +kerning first=82 second=84 amount=-1 +kerning first=82 second=85 amount=-1 +kerning first=82 second=86 amount=-1 +kerning first=82 second=87 amount=-1 +kerning first=82 second=89 amount=-1 +kerning first=83 second=73 amount=-1 +kerning first=83 second=77 amount=-1 +kerning first=83 second=84 amount=-2 +kerning first=83 second=85 amount=-1 +kerning first=84 second=65 amount=-4 +kerning first=84 second=67 amount=-2 +kerning first=84 second=79 amount=-2 +kerning first=85 second=65 amount=-1 +kerning first=85 second=67 amount=-1 +kerning first=85 second=71 amount=-1 +kerning first=85 second=79 amount=-1 +kerning first=85 second=83 amount=-1 +kerning first=86 second=65 amount=-3 +kerning first=86 second=67 amount=-2 +kerning first=86 second=71 amount=-2 +kerning first=86 second=79 amount=-2 +kerning first=86 second=83 amount=-1 +kerning first=87 second=65 amount=-2 +kerning first=87 second=67 amount=-1 +kerning first=87 second=71 amount=-2 +kerning first=87 second=79 amount=-1 +kerning first=89 second=65 amount=-4 +kerning first=89 second=67 amount=-2 +kerning first=89 second=79 amount=-2 +kerning first=89 second=83 amount=-1 +kerning first=90 second=79 amount=-2 +kerning first=65 second=99 amount=-1 +kerning first=65 second=100 amount=-2 +kerning first=65 second=101 amount=-2 +kerning first=65 second=103 amount=-1 +kerning first=65 second=111 amount=-1 +kerning first=65 second=112 amount=-1 +kerning first=65 second=113 amount=-2 +kerning first=65 second=116 amount=-2 +kerning first=65 second=117 amount=-2 +kerning first=65 second=118 amount=-2 +kerning first=65 second=119 amount=-2 +kerning first=65 second=121 amount=-2 +kerning first=66 second=98 amount=-1 +kerning first=66 second=105 amount=-1 +kerning first=66 second=107 amount=-1 +kerning first=66 second=108 amount=-1 +kerning first=66 second=114 amount=-1 +kerning first=66 second=117 amount=-1 +kerning first=66 second=121 amount=-2 +kerning first=66 second=46 amount=-1 +kerning first=66 second=44 amount=-2 +kerning first=67 second=97 amount=-1 +kerning first=67 second=114 amount=-1 +kerning first=67 second=46 amount=-1 +kerning first=67 second=44 amount=-2 +kerning first=68 second=97 amount=-1 +kerning first=68 second=46 amount=-2 +kerning first=68 second=44 amount=-3 +kerning first=69 second=117 amount=-1 +kerning first=69 second=118 amount=-1 +kerning first=70 second=97 amount=-1 +kerning first=70 second=101 amount=-1 +kerning first=70 second=105 amount=-1 +kerning first=70 second=111 amount=-1 +kerning first=70 second=114 amount=-1 +kerning first=70 second=116 amount=-1 +kerning first=70 second=117 amount=-1 +kerning first=70 second=121 amount=-1 +kerning first=70 second=46 amount=-2 +kerning first=70 second=44 amount=-3 +kerning first=70 second=59 amount=-2 +kerning first=70 second=58 amount=-1 +kerning first=71 second=117 amount=-1 +kerning first=72 second=101 amount=-1 +kerning first=72 second=111 amount=-1 +kerning first=72 second=117 amount=-1 +kerning first=72 second=121 amount=-1 +kerning first=73 second=99 amount=-1 +kerning first=73 second=100 amount=-1 +kerning first=73 second=113 amount=-1 +kerning first=73 second=111 amount=-1 +kerning first=73 second=116 amount=-1 +kerning first=74 second=97 amount=-1 +kerning first=74 second=101 amount=-1 +kerning first=74 second=111 amount=-1 +kerning first=74 second=117 amount=-1 +kerning first=74 second=46 amount=-2 +kerning first=74 second=44 amount=-2 +kerning first=75 second=101 amount=-3 +kerning first=75 second=111 amount=-2 +kerning first=75 second=117 amount=-2 +kerning first=76 second=117 amount=-3 +kerning first=76 second=121 amount=-2 +kerning first=77 second=97 amount=-1 +kerning first=77 second=99 amount=-1 +kerning first=77 second=100 amount=-1 +kerning first=77 second=101 amount=-1 +kerning first=77 second=111 amount=-1 +kerning first=78 second=117 amount=-1 +kerning first=78 second=97 amount=-1 +kerning first=78 second=101 amount=-1 +kerning first=78 second=105 amount=-1 +kerning first=78 second=111 amount=-1 +kerning first=78 second=117 amount=-1 +kerning first=78 second=46 amount=-1 +kerning first=78 second=44 amount=-2 +kerning first=79 second=97 amount=-1 +kerning first=79 second=98 amount=-1 +kerning first=79 second=104 amount=-1 +kerning first=79 second=107 amount=-1 +kerning first=79 second=108 amount=-1 +kerning first=79 second=46 amount=-1 +kerning first=79 second=44 amount=-2 +kerning first=80 second=97 amount=-1 +kerning first=80 second=101 amount=-1 +kerning first=80 second=111 amount=-1 +kerning first=82 second=100 amount=-2 +kerning first=82 second=101 amount=-2 +kerning first=82 second=111 amount=-1 +kerning first=82 second=116 amount=-1 +kerning first=82 second=117 amount=-1 +kerning first=83 second=105 amount=-1 +kerning first=83 second=112 amount=-1 +kerning first=83 second=117 amount=-1 +kerning first=83 second=46 amount=-2 +kerning first=83 second=44 amount=-2 +kerning first=84 second=97 amount=-2 +kerning first=84 second=99 amount=-2 +kerning first=84 second=101 amount=-3 +kerning first=84 second=105 amount=-1 +kerning first=84 second=111 amount=-2 +kerning first=84 second=114 amount=-3 +kerning first=84 second=115 amount=-2 +kerning first=84 second=117 amount=-3 +kerning first=84 second=119 amount=-2 +kerning first=84 second=121 amount=-2 +kerning first=84 second=46 amount=-5 +kerning first=84 second=44 amount=-5 +kerning first=84 second=59 amount=-3 +kerning first=84 second=58 amount=-2 +kerning first=85 second=97 amount=-1 +kerning first=85 second=103 amount=-1 +kerning first=85 second=109 amount=-1 +kerning first=85 second=110 amount=-1 +kerning first=85 second=112 amount=-1 +kerning first=85 second=115 amount=-1 +kerning first=85 second=46 amount=-1 +kerning first=85 second=44 amount=-2 +kerning first=86 second=97 amount=-2 +kerning first=86 second=101 amount=-3 +kerning first=86 second=105 amount=-1 +kerning first=86 second=111 amount=-2 +kerning first=86 second=114 amount=-2 +kerning first=86 second=117 amount=-2 +kerning first=86 second=46 amount=-4 +kerning first=86 second=44 amount=-4 +kerning first=86 second=59 amount=-3 +kerning first=86 second=58 amount=-2 +kerning first=87 second=100 amount=-2 +kerning first=87 second=105 amount=-1 +kerning first=87 second=109 amount=-1 +kerning first=87 second=114 amount=-2 +kerning first=87 second=116 amount=-1 +kerning first=87 second=117 amount=-2 +kerning first=87 second=121 amount=-1 +kerning first=87 second=46 amount=-3 +kerning first=87 second=44 amount=-3 +kerning first=87 second=59 amount=-2 +kerning first=87 second=58 amount=-1 +kerning first=88 second=97 amount=-1 +kerning first=88 second=101 amount=-2 +kerning first=88 second=111 amount=-1 +kerning first=88 second=117 amount=-2 +kerning first=88 second=121 amount=-1 +kerning first=89 second=100 amount=-3 +kerning first=89 second=101 amount=-3 +kerning first=89 second=105 amount=-1 +kerning first=89 second=112 amount=-3 +kerning first=89 second=117 amount=-3 +kerning first=89 second=118 amount=-2 +kerning first=89 second=46 amount=-4 +kerning first=89 second=44 amount=-5 +kerning first=89 second=59 amount=-3 +kerning first=89 second=58 amount=-2 +kerning first=97 second=99 amount=-1 +kerning first=97 second=100 amount=-1 +kerning first=97 second=101 amount=-1 +kerning first=97 second=103 amount=-1 +kerning first=97 second=112 amount=-1 +kerning first=97 second=102 amount=-1 +kerning first=97 second=116 amount=-1 +kerning first=97 second=117 amount=-1 +kerning first=97 second=118 amount=-1 +kerning first=97 second=119 amount=-1 +kerning first=97 second=121 amount=-1 +kerning first=97 second=112 amount=-1 +kerning first=98 second=108 amount=-1 +kerning first=98 second=114 amount=-1 +kerning first=98 second=117 amount=-1 +kerning first=98 second=121 amount=-2 +kerning first=98 second=46 amount=-2 +kerning first=98 second=44 amount=-2 +kerning first=99 second=97 amount=-1 +kerning first=99 second=104 amount=-1 +kerning first=99 second=107 amount=-1 +kerning first=100 second=97 amount=-1 +kerning first=100 second=99 amount=-1 +kerning first=100 second=101 amount=-1 +kerning first=100 second=103 amount=-1 +kerning first=100 second=111 amount=-1 +kerning first=100 second=116 amount=-1 +kerning first=100 second=117 amount=-1 +kerning first=100 second=118 amount=-1 +kerning first=100 second=119 amount=-1 +kerning first=100 second=121 amount=-1 +kerning first=100 second=46 amount=-1 +kerning first=100 second=44 amount=-1 +kerning first=101 second=97 amount=-1 +kerning first=101 second=105 amount=-1 +kerning first=101 second=108 amount=-1 +kerning first=101 second=109 amount=-1 +kerning first=101 second=110 amount=-1 +kerning first=101 second=112 amount=-1 +kerning first=101 second=114 amount=-1 +kerning first=101 second=116 amount=-1 +kerning first=101 second=117 amount=-1 +kerning first=101 second=118 amount=-1 +kerning first=101 second=119 amount=-1 +kerning first=101 second=121 amount=-1 +kerning first=101 second=46 amount=-2 +kerning first=101 second=44 amount=-2 +kerning first=102 second=97 amount=-2 +kerning first=102 second=101 amount=-3 +kerning first=102 second=102 amount=-2 +kerning first=102 second=105 amount=-1 +kerning first=102 second=108 amount=-1 +kerning first=102 second=111 amount=-2 +kerning first=102 second=46 amount=-4 +kerning first=102 second=44 amount=-4 +kerning first=103 second=97 amount=-1 +kerning first=103 second=101 amount=-1 +kerning first=103 second=104 amount=-1 +kerning first=103 second=108 amount=-1 +kerning first=103 second=111 amount=-1 +kerning first=103 second=103 amount=-1 +kerning first=103 second=46 amount=-1 +kerning first=103 second=44 amount=-2 +kerning first=104 second=99 amount=-1 +kerning first=104 second=100 amount=-1 +kerning first=104 second=101 amount=-1 +kerning first=104 second=103 amount=-1 +kerning first=104 second=111 amount=-1 +kerning first=104 second=112 amount=-1 +kerning first=104 second=116 amount=-2 +kerning first=104 second=117 amount=-1 +kerning first=104 second=118 amount=-2 +kerning first=104 second=119 amount=-2 +kerning first=104 second=121 amount=-2 +kerning first=105 second=99 amount=-1 +kerning first=105 second=100 amount=-1 +kerning first=105 second=101 amount=-1 +kerning first=105 second=103 amount=-1 +kerning first=105 second=111 amount=-1 +kerning first=105 second=112 amount=-1 +kerning first=105 second=116 amount=-1 +kerning first=105 second=117 amount=-1 +kerning first=105 second=118 amount=-1 +kerning first=106 second=97 amount=-1 +kerning first=106 second=101 amount=-1 +kerning first=106 second=111 amount=-1 +kerning first=106 second=117 amount=-1 +kerning first=106 second=46 amount=-1 +kerning first=106 second=44 amount=-1 +kerning first=107 second=97 amount=-1 +kerning first=107 second=99 amount=-1 +kerning first=107 second=100 amount=-2 +kerning first=107 second=101 amount=-2 +kerning first=107 second=103 amount=-1 +kerning first=107 second=111 amount=-1 +kerning first=108 second=97 amount=-1 +kerning first=108 second=99 amount=-1 +kerning first=108 second=100 amount=-1 +kerning first=108 second=101 amount=-1 +kerning first=108 second=102 amount=-1 +kerning first=108 second=103 amount=-1 +kerning first=108 second=111 amount=-1 +kerning first=108 second=112 amount=-1 +kerning first=108 second=113 amount=-1 +kerning first=108 second=117 amount=-1 +kerning first=108 second=118 amount=-1 +kerning first=108 second=119 amount=-1 +kerning first=108 second=121 amount=-1 +kerning first=109 second=97 amount=-1 +kerning first=109 second=99 amount=-1 +kerning first=109 second=100 amount=-1 +kerning first=109 second=101 amount=-1 +kerning first=109 second=103 amount=-1 +kerning first=109 second=110 amount=-1 +kerning first=109 second=111 amount=-1 +kerning first=109 second=112 amount=-1 +kerning first=109 second=116 amount=-1 +kerning first=109 second=117 amount=-1 +kerning first=109 second=118 amount=-1 +kerning first=109 second=121 amount=-1 +kerning first=110 second=99 amount=-1 +kerning first=110 second=100 amount=-1 +kerning first=110 second=101 amount=-1 +kerning first=110 second=103 amount=-1 +kerning first=110 second=111 amount=-1 +kerning first=110 second=112 amount=-1 +kerning first=110 second=116 amount=-2 +kerning first=110 second=117 amount=-1 +kerning first=110 second=118 amount=-2 +kerning first=110 second=119 amount=-2 +kerning first=110 second=121 amount=-2 +kerning first=111 second=98 amount=-1 +kerning first=111 second=102 amount=-1 +kerning first=111 second=104 amount=-1 +kerning first=111 second=106 amount=-2 +kerning first=111 second=107 amount=-1 +kerning first=111 second=108 amount=-1 +kerning first=111 second=109 amount=-1 +kerning first=111 second=110 amount=-1 +kerning first=111 second=112 amount=-1 +kerning first=111 second=114 amount=-1 +kerning first=111 second=117 amount=-1 +kerning first=111 second=118 amount=-1 +kerning first=111 second=119 amount=-1 +kerning first=111 second=120 amount=-1 +kerning first=111 second=121 amount=-1 +kerning first=111 second=46 amount=-1 +kerning first=111 second=44 amount=-2 +kerning first=112 second=97 amount=-1 +kerning first=112 second=104 amount=-1 +kerning first=112 second=105 amount=-1 +kerning first=112 second=108 amount=-1 +kerning first=112 second=112 amount=-1 +kerning first=112 second=117 amount=-1 +kerning first=112 second=46 amount=-1 +kerning first=112 second=44 amount=-2 +kerning first=113 second=117 amount=-1 +kerning first=116 second=46 amount=-1 +kerning first=114 second=97 amount=-1 +kerning first=114 second=100 amount=-2 +kerning first=114 second=101 amount=-2 +kerning first=114 second=103 amount=-1 +kerning first=114 second=107 amount=-1 +kerning first=114 second=108 amount=-1 +kerning first=114 second=109 amount=-1 +kerning first=114 second=110 amount=-1 +kerning first=114 second=111 amount=-1 +kerning first=114 second=113 amount=-2 +kerning first=114 second=114 amount=-1 +kerning first=114 second=116 amount=-1 +kerning first=114 second=118 amount=-1 +kerning first=114 second=121 amount=-1 +kerning first=114 second=46 amount=-3 +kerning first=114 second=44 amount=-4 +kerning first=115 second=104 amount=-1 +kerning first=115 second=116 amount=-1 +kerning first=115 second=117 amount=-1 +kerning first=115 second=46 amount=-1 +kerning first=115 second=44 amount=-2 +kerning first=116 second=100 amount=-2 +kerning first=116 second=97 amount=-1 +kerning first=116 second=101 amount=-2 +kerning first=116 second=111 amount=-1 +kerning first=116 second=46 amount=-1 +kerning first=116 second=44 amount=-1 +kerning first=117 second=97 amount=-1 +kerning first=117 second=99 amount=-1 +kerning first=117 second=100 amount=-1 +kerning first=117 second=101 amount=-1 +kerning first=117 second=103 amount=-1 +kerning first=117 second=111 amount=-1 +kerning first=117 second=112 amount=-1 +kerning first=117 second=113 amount=-1 +kerning first=117 second=116 amount=-1 +kerning first=117 second=118 amount=-1 +kerning first=117 second=119 amount=-1 +kerning first=117 second=121 amount=-1 +kerning first=118 second=97 amount=-1 +kerning first=118 second=98 amount=-1 +kerning first=118 second=99 amount=-1 +kerning first=118 second=100 amount=-2 +kerning first=118 second=101 amount=-2 +kerning first=118 second=103 amount=-1 +kerning first=118 second=111 amount=-1 +kerning first=118 second=118 amount=-1 +kerning first=118 second=121 amount=-1 +kerning first=118 second=46 amount=-2 +kerning first=118 second=44 amount=-3 +kerning first=119 second=97 amount=-1 +kerning first=119 second=120 amount=-1 +kerning first=119 second=100 amount=-2 +kerning first=119 second=101 amount=-2 +kerning first=119 second=103 amount=-1 +kerning first=119 second=104 amount=-1 +kerning first=119 second=111 amount=-1 +kerning first=119 second=46 amount=-2 +kerning first=119 second=44 amount=-3 +kerning first=120 second=97 amount=-1 +kerning first=120 second=101 amount=-2 +kerning first=120 second=111 amount=-1 +kerning first=121 second=46 amount=-2 +kerning first=121 second=44 amount=-3 +kerning first=121 second=97 amount=-1 +kerning first=121 second=99 amount=-1 +kerning first=121 second=100 amount=-2 +kerning first=121 second=101 amount=-2 +kerning first=121 second=111 amount=-1 +kerning first=117 second=109 amount=-1 +kerning first=84 second=104 amount=-1 +kerning first=118 second=101 amount=-2 +kerning first=119 second=110 amount=-1 +kerning first=112 second=115 amount=-1 +kerning first=76 second=97 amount=-2 +kerning first=117 second=105 amount=-1 +kerning first=98 second=101 amount=-1 +kerning first=99 second=111 amount=-1 +kerning first=102 second=103 amount=-2 +kerning first=118 second=119 amount=-1 +kerning first=120 second=121 amount=-1 +kerning first=121 second=122 amount=-1 +kerning first=119 second=119 amount=-1 +kerning first=99 second=101 amount=-1 +kerning first=101 second=115 amount=-1 +kerning first=101 second=102 amount=-1 +kerning first=98 second=97 amount=-1 +kerning first=116 second=104 amount=-1 +kerning first=116 second=105 amount=-1 +kerning first=101 second=101 amount=-1 +kerning first=104 second=97 amount=-1 +kerning first=111 second=101 amount=-1 +kerning first=119 second=105 amount=-1 +kerning first=88 second=89 amount=-1 +kerning first=89 second=90 amount=-1 +kerning first=82 second=83 amount=-1 +kerning first=75 second=76 amount=-2 +kerning first=101 second=100 amount=-1 +kerning first=116 second=111 amount=-1 +kerning first=87 second=104 amount=-1 +kerning first=107 second=110 amount=-2 +kerning first=119 second=115 amount=-1 +kerning first=116 second=114 amount=-1 +kerning first=102 second=114 amount=-2 +kerning first=65 second=110 amount=-1 +kerning first=116 second=116 amount=-1 +kerning first=66 second=67 amount=-1 +kerning first=67 second=68 amount=-1 +kerning first=65 second=66 amount=-1 +kerning first=89 second=111 amount=-2 +kerning first=102 second=117 amount=-2 +kerning first=67 second=111 amount=-1 +kerning first=116 second=115 amount=-1 +kerning first=111 second=111 amount=-1 +kerning first=68 second=111 amount=-1 +kerning first=101 second=97 amount=-1 +kerning first=76 second=111 amount=-2 +kerning first=115 second=105 amount=-1 +kerning first=111 second=116 amount=-1 +kerning first=111 second=103 amount=-1 +kerning first=82 second=97 amount=-1 +kerning first=101 second=99 amount=-1 +kerning first=66 second=111 amount=-1 +kerning first=111 second=99 amount=-1 +kerning first=115 second=111 amount=-1 +kerning first=83 second=119 amount=-2 +kerning first=66 second=101 amount=-1 +kerning first=99 second=116 amount=-1 +kerning first=98 second=106 amount=-3 +kerning first=115 second=101 amount=-1 +kerning first=121 second=119 amount=-1 +kerning first=111 second=97 amount=-1 +kerning first=68 second=88 amount=-2 +kerning first=101 second=98 amount=-1 +kerning first=115 second=119 amount=-1 +kerning first=97 second=120 amount=-1 +kerning first=73 second=110 amount=-1 +kerning first=73 second=74 amount=-1 +kerning first=116 second=112 amount=-1 +kerning first=104 second=105 amount=-1 +kerning first=105 second=115 amount=-1 +kerning first=98 second=99 amount=-1 +kerning first=115 second=112 amount=-1 +kerning first=100 second=105 amount=-1 +kerning first=105 second=106 amount=-1 +kerning first=108 second=109 amount=-1 +kerning first=107 second=108 amount=-1 +kerning first=108 second=105 amount=-1 +kerning first=112 second=113 amount=-1 +kerning first=108 second=108 amount=-1 +kerning first=49 second=50 amount=-1 +kerning first=106 second=107 amount=-1 +kerning first=117 second=110 amount=-1 +kerning first=113 second=114 amount=-1 +kerning first=116 second=117 amount=-1 +kerning first=114 second=115 amount=-1 +kerning first=117 second=114 amount=-1 +kerning first=73 second=112 amount=-1 +kerning first=79 second=112 amount=-1 +kerning first=101 second=103 amount=-1 diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/neon/neon-ui.atlas b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/neon/neon-ui.atlas new file mode 100644 index 0000000..768a675 --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/neon/neon-ui.atlas @@ -0,0 +1,382 @@ + +neon-ui.png +size: 512,512 +format: RGBA8888 +filter: Linear,Linear +repeat: none +button + rotate: false + xy: 145, 41 + size: 46, 42 + split: 17, 17, 15, 16 + pad: 15, 15, 14, 14 + orig: 46, 42 + offset: 0, 0 + index: -1 +button-over + rotate: false + xy: 197, 141 + size: 46, 42 + split: 17, 17, 15, 16 + pad: 15, 15, 14, 14 + orig: 46, 42 + offset: 0, 0 + index: -1 +button-pressed + rotate: false + xy: 197, 97 + size: 46, 42 + split: 17, 17, 15, 16 + pad: 15, 15, 14, 14 + orig: 46, 42 + offset: 0, 0 + index: -1 +checkbox + rotate: false + xy: 222, 70 + size: 22, 22 + orig: 22, 22 + offset: 0, 0 + index: -1 +checkbox-over + rotate: false + xy: 222, 46 + size: 22, 22 + orig: 22, 22 + offset: 0, 0 + index: -1 +checkbox-pressed + rotate: false + xy: 219, 205 + size: 22, 22 + orig: 22, 22 + offset: 0, 0 + index: -1 +checkbox-pressed-over + rotate: false + xy: 245, 343 + size: 22, 22 + orig: 22, 22 + offset: 0, 0 + index: -1 +font-export + rotate: false + xy: 388, 394 + size: 116, 117 + orig: 116, 117 + offset: 0, 0 + index: -1 +font-over-export + rotate: false + xy: 1, 41 + size: 142, 144 + orig: 142, 144 + offset: 0, 0 + index: -1 +font-pressed-export + rotate: false + xy: 244, 367 + size: 142, 144 + orig: 142, 144 + offset: 0, 0 + index: -1 +list + rotate: false + xy: 1, 1 + size: 52, 38 + split: 18, 18, 0, 16 + pad: 14, 14, 0, 12 + orig: 52, 38 + offset: 0, 0 + index: -1 +minus + rotate: false + xy: 208, 345 + size: 18, 18 + orig: 18, 18 + offset: 0, 0 + index: -1 +plus + rotate: false + xy: 269, 347 + size: 18, 18 + orig: 18, 18 + offset: 0, 0 + index: -1 +progress-bar + rotate: false + xy: 496, 355 + size: 9, 37 + split: 0, 0, 0, 23 + pad: 0, 0, 0, 0 + orig: 9, 37 + offset: 0, 0 + index: -1 +progress-bar-big + rotate: false + xy: 1, 429 + size: 241, 82 + split: 50, 47, 0, 0 + pad: 17, 18, 0, 0 + orig: 241, 82 + offset: 0, 0 + index: -1 +progress-bar-big-knob + rotate: false + xy: 1, 345 + size: 205, 82 + orig: 205, 82 + offset: 0, 0 + index: -1 +progress-bar-knob + rotate: false + xy: 245, 146 + size: 1, 37 + split: 0, 0, 0, 36 + pad: 0, 0, 0, 0 + orig: 1, 37 + offset: 0, 0 + index: -1 +progress-bar-vertical + rotate: false + xy: 55, 1 + size: 37, 9 + split: 0, 20, 0, 0 + pad: 0, 0, 0, 0 + orig: 37, 9 + offset: 0, 0 + index: -1 +progress-bar-vertical-knob + rotate: false + xy: 197, 94 + size: 37, 1 + split: 0, 36, 0, 0 + pad: 0, 0, 0, 0 + orig: 37, 1 + offset: 0, 0 + index: -1 +radio + rotate: false + xy: 163, 15 + size: 24, 24 + orig: 24, 24 + offset: 0, 0 + index: -1 +radio-over + rotate: false + xy: 189, 13 + size: 24, 24 + orig: 24, 24 + offset: 0, 0 + index: -1 +radio-pressed + rotate: false + xy: 215, 13 + size: 24, 24 + orig: 24, 24 + offset: 0, 0 + index: -1 +scroll-horizontal + rotate: false + xy: 55, 12 + size: 44, 27 + split: 11, 11, 11, 11 + pad: 0, 0, 0, 0 + orig: 44, 27 + offset: 0, 0 + index: -1 +scroll-vertical + rotate: false + xy: 193, 39 + size: 27, 44 + split: 11, 11, 11, 11 + pad: 0, 0, 0, 0 + orig: 27, 44 + offset: 0, 0 + index: -1 +select-box + rotate: false + xy: 165, 185 + size: 52, 42 + split: 18, 22, 14, 21 + pad: 15, 23, 14, 14 + orig: 52, 42 + offset: 0, 0 + index: -1 +select-box-over + rotate: false + xy: 388, 350 + size: 52, 42 + split: 18, 22, 14, 21 + pad: 15, 23, 14, 14 + orig: 52, 42 + offset: 0, 0 + index: -1 +select-box-pressed + rotate: false + xy: 442, 350 + size: 52, 42 + split: 18, 22, 14, 21 + pad: 15, 23, 14, 14 + orig: 52, 42 + offset: 0, 0 + index: -1 +slider + rotate: false + xy: 228, 341 + size: 8, 22 + split: 2, 2, 10, 10 + pad: 0, 0, 0, 0 + orig: 8, 22 + offset: 0, 0 + index: -1 +slider-before + rotate: false + xy: 239, 405 + size: 1, 22 + split: 0, 0, 9, 9 + pad: 0, 0, 0, 0 + orig: 1, 22 + offset: 0, 0 + index: -1 +slider-knob + rotate: false + xy: 289, 355 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +slider-knob-pressed + rotate: false + xy: 301, 355 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +slider-vertical + rotate: false + xy: 219, 195 + size: 22, 8 + split: 10, 10, 2, 2 + pad: 0, 0, 0, 0 + orig: 22, 8 + offset: 0, 0 + index: -1 +slider-vertical-before + rotate: false + xy: 163, 12 + size: 22, 1 + split: 9, 9, 0, 0 + pad: 0, 0, 0, 0 + orig: 22, 1 + offset: 0, 0 + index: -1 +split-pane-horizontal + rotate: false + xy: 313, 356 + size: 1, 9 + orig: 1, 9 + offset: 0, 0 + index: -1 +split-pane-vertical + rotate: false + xy: 236, 94 + size: 9, 1 + orig: 9, 1 + offset: 0, 0 + index: -1 +textfield + rotate: false + xy: 219, 185 + size: 14, 8 + split: 3, 3, 0, 7 + pad: 4, 4, 0, 6 + orig: 14, 8 + offset: 0, 0 + index: -1 +textfield-login + rotate: false + xy: 208, 397 + size: 29, 30 + split: 18, 3, 0, 29 + pad: 20, 4, 0, 6 + orig: 29, 30 + offset: 0, 0 + index: -1 +textfield-login-selected + rotate: false + xy: 208, 365 + size: 29, 30 + split: 18, 3, 0, 29 + pad: 20, 4, 0, 6 + orig: 29, 30 + offset: 0, 0 + index: -1 +textfield-password + rotate: false + xy: 101, 9 + size: 29, 30 + split: 19, 3, 0, 29 + pad: 21, 4, 0, 6 + orig: 29, 30 + offset: 0, 0 + index: -1 +textfield-password-selected + rotate: false + xy: 132, 9 + size: 29, 30 + split: 20, 3, 0, 29 + pad: 21, 4, 0, 6 + orig: 29, 30 + offset: 0, 0 + index: -1 +textfield-selected + rotate: false + xy: 235, 185 + size: 14, 8 + split: 3, 3, 0, 7 + pad: 4, 4, 0, 6 + orig: 14, 8 + offset: 0, 0 + index: -1 +tooltip + rotate: false + xy: 145, 85 + size: 50, 98 + split: 14, 14, 15, 16 + pad: 13, 13, 13, 13 + orig: 50, 98 + offset: 0, 0 + index: -1 +touchpad + rotate: false + xy: 1, 187 + size: 162, 156 + split: 54, 53, 57, 50 + pad: 0, 0, 1, 0 + orig: 162, 156 + offset: 0, 0 + index: -1 +touchpad-knob + rotate: false + xy: 165, 287 + size: 56, 56 + orig: 56, 56 + offset: 0, 0 + index: -1 +white + rotate: false + xy: 94, 9 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +window + rotate: false + xy: 165, 229 + size: 56, 56 + split: 17, 16, 17, 17 + pad: 16, 15, 16, 16 + orig: 56, 56 + offset: 0, 0 + index: -1 diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/neon/neon-ui.json b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/neon/neon-ui.json new file mode 100644 index 0000000..c67e63a --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/neon/neon-ui.json @@ -0,0 +1,423 @@ +{ +com.badlogic.gdx.graphics.g2d.BitmapFont: { + font: { + file: font-export.fnt + } + font-over: { + file: font-over-export.fnt + } + font-pressed: { + file: font-pressed-export.fnt + } +} +com.badlogic.gdx.graphics.Color: { + color: { + r: 0 + g: 1 + b: 1 + a: 1 + } + selected: { + r: 0 + g: .4 + b: .4 + a: 1 + } + text: { + r: .580392156 + g: 1 + b: 1 + a: 1 + } + text-selected: { + r: 1 + g: 1 + b: 1 + a: 1 + } +} +com.badlogic.gdx.scenes.scene2d.ui.Skin$TintedDrawable: { + button-c: { + name: button + color: color + } + button-over-c: { + name: button-over + color: color + } + button-pressed-c: { + name: button-pressed + color: color + } + checkbox-pressed-c: { + name: checkbox-pressed + color: color + } + checkbox-c: { + name: checkbox + color: color + } + checkbox-over-c: { + name: checkbox-over + color: color + } + radio-c: { + name: radio + color: color + } + radio-pressed-c: { + name: radio-pressed + color: color + } + radio-over-c: { + name: radio-over + color: color + } + color: { + name: white + color: color + } + list-c: { + name: list + color: color + } + slider-c: { + name: slider + color: color + } + progress-bar-c: { + name: progress-bar + color: color + } + progress-bar-knob-c: { + name: progress-bar-knob + color: color + } + progress-bar-vertical-c: { + name: progress-bar-vertical + color: color + } + progress-bar-vertical-knob-c: { + name: progress-bar-vertical-knob + color: color + } + scroll-horizontal-c: { + name: scroll-horizontal + color: color + } + scroll-vertical-c: { + name: scroll-vertical + color: color + } + select-box-c: { + name: select-box + color: color + } + select-box-over-c: { + name: select-box-over + color: color + } + select-box-pressed-c: { + name: select-box-pressed + color: color + } + slider-before-c: { + name: slider-before + color: color + } + slider-knob-c: { + name: slider-knob + color: color + } + slider-knob-pressed-c: { + name: slider-knob-pressed + color: color + } + slider-vertical-c: { + name: slider-vertical + color: color + } + slider-vertical-before-c: { + name: slider-vertical-before + color: color + } + split-pane-horizontal-c: { + name: split-pane-horizontal + color: color + } + split-pane-vertical-c: { + name: split-pane-vertical + color: color + } + selected: { + name: white + color: selected + } + textfield-c: { + name: textfield + color: color + } + textfield-login-c: { + name: textfield-login + color: color + } + textfield-selected-c: { + name: textfield-selected + color: color + } + textfield-login-selected-c: { + name: textfield-login-selected + color: color + } + textfield-password-c: { + name: textfield-password + color: color + } + textfield-password-selected-c: { + name: textfield-password-selected + color: color + } + tooltip-c: { + name: tooltip + color: color + } + touchpad-c: { + name: touchpad + color: color + } + touchpad-knob-c: { + name: touchpad-knob + color: color + } + plus-c: { + name: plus + color: color + } + minus-c: { + name: minus + color: color + } + window-c: { + name: window + color: color + } + checkbox-pressed-over-c: { + name: checkbox-pressed-over + color: color + } + progress-bar-big-c: { + name: progress-bar-big + color: color + } + progress-bar-big-knob-c: { + name: progress-bar-big-knob + color: color + } +} +com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: { + default: { + up: button-c + down: button-pressed-c + over: button-over-c + } +} +com.badlogic.gdx.scenes.scene2d.ui.CheckBox$CheckBoxStyle: { + default: { + checkboxOn: checkbox-pressed-c + checkboxOff: checkbox-c + checkboxOver: checkbox-over-c + font: font + fontColor: text + downFontColor: text-selected + checkedFontColor: text-selected + } + radio: { + checkboxOn: radio-pressed-c + checkboxOff: radio-c + checkboxOver: radio-over-c + font: font + fontColor: color + downFontColor: selected + checkedFontColor: selected + } +} +com.badlogic.gdx.scenes.scene2d.ui.ImageButton$ImageButtonStyle: { + default: { + imageUp: button-c + imageDown: button-pressed-c + imageOver: button-over-c + } +} +com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton$ImageTextButtonStyle: { + default: { + font: font + fontColor: text + downFontColor: text-selected + up: button-c + down: button-pressed-c + over: button-over-c + } + checkbox: { + imageUp: checkbox-c + imageDown: checkbox-pressed-c + imageOver: checkbox-over-c + imageChecked: checkbox-pressed-c + imageCheckedOver: checkbox-pressed-over-c + font: font + fontColor: text + downFontColor: text-selected + checkedFontColor: text-selected + } + radio: { + imageUp: radio-c + imageDown: radio-pressed-c + imageOver: radio-over-c + imageChecked: radio-pressed-c + imageCheckedOver: radio-over-c + font: font + fontColor: text + downFontColor: text-selected + checkedFontColor: text-selected + } +} +com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: { + default: { + font: font + fontColor: text + } + over: { + font: font-over + fontColor: text + } + pressed: { + font: font-pressed + fontColor: text + } +} +com.badlogic.gdx.scenes.scene2d.ui.List$ListStyle: { + default: { + font: font + fontColorSelected: selected + fontColorUnselected: text + selection: color + background: list-c + } +} +com.badlogic.gdx.scenes.scene2d.ui.ProgressBar$ProgressBarStyle: { + default-horizontal: { + background: progress-bar-c + knobBefore: progress-bar-knob-c + } + default-vertical: { + background: progress-bar-vertical-c + knobBefore: progress-bar-vertical-knob-c + } + big: { + background: progress-bar-big-c + knobBefore: progress-bar-big-knob-c + } +} +com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle: { + default: { + hScrollKnob: scroll-horizontal-c + vScrollKnob: scroll-vertical-c + } +} +com.badlogic.gdx.scenes.scene2d.ui.SelectBox$SelectBoxStyle: { + default: { + font: font + fontColor: text + background: select-box-c + scrollStyle: default + listStyle: default + backgroundOver: select-box-over-c + backgroundOpen: select-box-pressed-c + } +} +com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle: { + default-horizontal: { + knobOver: slider-knob-pressed-c + knobDown: slider-knob-pressed-c + background: slider-c + knob: slider-knob-c + knobBefore: slider-before-c + } + default-vertical: { + knobOver: slider-knob-pressed-c + knobDown: slider-knob-pressed-c + background: slider-vertical-c + knob: slider-knob-c + knobBefore: slider-vertical-before-c + } +} +com.badlogic.gdx.scenes.scene2d.ui.SplitPane$SplitPaneStyle: { + default-horizontal: { + handle: split-pane-horizontal-c + } + default-vertical: { + handle: split-pane-vertical-c + } +} +com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle: { + default: { + font: font + fontColor: text + downFontColor: text-selected + up: button-c + down: button-pressed-c + over: button-over-c + } +} +com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldStyle: { + default: { + font: font + fontColor: text + background: textfield-c + focusedBackground: textfield-selected-c + cursor: color + selection: selected + } + login: { + font: font + fontColor: text + background: textfield-login-c + focusedBackground: textfield-login-selected-c + cursor: color + selection: selected + } + password: { + font: font + fontColor: text + background: textfield-password-c + focusedBackground: textfield-password-selected-c + cursor: color + selection: selected + } +} +com.badlogic.gdx.scenes.scene2d.ui.TextTooltip$TextTooltipStyle: { + default: { + label: default + background: tooltip-c + } +} +com.badlogic.gdx.scenes.scene2d.ui.Touchpad$TouchpadStyle: { + default: { + background: touchpad-c + knob: touchpad-knob-c + } +} +com.badlogic.gdx.scenes.scene2d.ui.Tree$TreeStyle: { + default: { + plus: plus-c + minus: minus-c + selection: selected + } +} +com.badlogic.gdx.scenes.scene2d.ui.Window$WindowStyle: { + default: { + background: window-c + titleFont: font + titleFont: font + } +} +} \ No newline at end of file diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/neon/neon-ui.png b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/neon/neon-ui.png new file mode 100644 index 0000000..56c36eb Binary files /dev/null and b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/skins/neon/neon-ui.png differ diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/sounds/pinkyfinger__piano-e.wav b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/sounds/pinkyfinger__piano-e.wav new file mode 100644 index 0000000..948f01f Binary files /dev/null and b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/sounds/pinkyfinger__piano-e.wav differ diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/textures/icon2.png b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/textures/icon2.png new file mode 100644 index 0000000..3b462cf Binary files /dev/null and b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/textures/icon2.png differ diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/textures/icon2.png.params.yaml b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/textures/icon2.png.params.yaml new file mode 100644 index 0000000..afc8860 --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/textures/icon2.png.params.yaml @@ -0,0 +1 @@ +format: RGBA8888 \ No newline at end of file diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/all-tilesets.tmx b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/all-tilesets.tmx new file mode 100644 index 0000000..5822d60 --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/all-tilesets.tmx @@ -0,0 +1,21 @@ + + + + + + + + +0,0,0,0,0,0,0,0,0,0, +0,18,520,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0, +0,0,0,309,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,383,0,0,0,0 + + + diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/land-features.png b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/land-features.png new file mode 100644 index 0000000..e13c45a Binary files /dev/null and b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/land-features.png differ diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/land-features.tsx b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/land-features.tsx new file mode 100644 index 0000000..8cbd4a7 --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/land-features.tsx @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/test.tmx b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/test.tmx new file mode 100644 index 0000000..16a5854 --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/test.tmx @@ -0,0 +1,217 @@ + + + + + +130,130,130,130,130,130,130,130,130,130,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,130,130,130,130,130,130,130,130,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,130,130,130,130,130,130,130,130,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,130,130,130,130,130,130,130,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,130,130,130,130,130,130,130,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,130,130,130,130,130,130,130,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,130,130,130,130,130,130,130,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,130,130,130,130,130,130,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,130,130,130,130,130,130,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,130,130,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,18,18,18,18,18,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82, +82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82 + + + + +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,0,0,0,0,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,0,0,0,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + + + + + + + + diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/tilesheet-buttons.png b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/tilesheet-buttons.png new file mode 100644 index 0000000..97d3ca1 Binary files /dev/null and b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/tilesheet-buttons.png differ diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/tilesheet-buttons.tsx b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/tilesheet-buttons.tsx new file mode 100644 index 0000000..b521f33 --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/tilesheet-buttons.tsx @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/tilesheet-future.png b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/tilesheet-future.png new file mode 100644 index 0000000..d26bfa3 Binary files /dev/null and b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/tilesheet-future.png differ diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/tilesheet-future.tsx b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/tilesheet-future.tsx new file mode 100644 index 0000000..2313df1 --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/tilesheet-future.tsx @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/tilesheet-medieval.png b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/tilesheet-medieval.png new file mode 100644 index 0000000..ad13183 Binary files /dev/null and b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/tilesheet-medieval.png differ diff --git a/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/tilesheet-medieval.tsx b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/tilesheet-medieval.tsx new file mode 100644 index 0000000..52af05c --- /dev/null +++ b/test-projects/definitions-libgdx-tests/all-resource-types/src/main/resources/tiledmaps/tilesheet-medieval.tsx @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-projects/ecs-loading-ashley/build.gradle b/test-projects/ecs-loading-ashley/build.gradle index ce5b429..cf9504d 100644 --- a/test-projects/ecs-loading-ashley/build.gradle +++ b/test-projects/ecs-loading-ashley/build.gradle @@ -1,5 +1,5 @@ dependencies { - implementation project(":definitions") + implementation project(":definitions-builder") implementation project(":definitions-ecs") implementation project(":definitions-ecs-ashley") implementation project(":test-projects:ecs-loading") diff --git a/test-projects/ecs-loading-fled/build.gradle b/test-projects/ecs-loading-fled/build.gradle index c0b190b..8a19d93 100644 --- a/test-projects/ecs-loading-fled/build.gradle +++ b/test-projects/ecs-loading-fled/build.gradle @@ -1,5 +1,5 @@ dependencies { - implementation project(":definitions") + implementation project(":definitions-builder") implementation project(":definitions-ecs") implementation project(":definitions-ecs-fled") implementation "io.fledware:fledecs:$fledEcsVersion" diff --git a/test-projects/ecs-loading-override/build.gradle b/test-projects/ecs-loading-override/build.gradle index b5adb01..c4b238c 100644 --- a/test-projects/ecs-loading-override/build.gradle +++ b/test-projects/ecs-loading-override/build.gradle @@ -1,5 +1,5 @@ dependencies { - implementation project(":definitions") + implementation project(":definitions-builder") implementation project(":definitions-ecs") implementation project(":test-projects:ecs-loading") } \ No newline at end of file diff --git a/test-projects/ecs-loading/build.gradle b/test-projects/ecs-loading/build.gradle index 872fd16..9bd14d6 100644 --- a/test-projects/ecs-loading/build.gradle +++ b/test-projects/ecs-loading/build.gradle @@ -1,4 +1,4 @@ dependencies { - implementation project(":definitions") + implementation project(":definitions-builder") implementation project(":definitions-ecs") } \ No newline at end of file diff --git a/test-projects/ecs-loading/src/main/resources/entities/coolguy.yaml b/test-projects/ecs-loading/src/main/resources/entities/coolguy.yaml index 186a455..f9affb5 100644 --- a/test-projects/ecs-loading/src/main/resources/entities/coolguy.yaml +++ b/test-projects/ecs-loading/src/main/resources/entities/coolguy.yaml @@ -1,4 +1,4 @@ -extends: /person +extends: person components: health: health: 10 \ No newline at end of file diff --git a/test-projects/ecs-loading/src/main/resources/entities/coolguy2.yaml b/test-projects/ecs-loading/src/main/resources/entities/coolguy2.yaml index 230668f..c28aa9b 100644 --- a/test-projects/ecs-loading/src/main/resources/entities/coolguy2.yaml +++ b/test-projects/ecs-loading/src/main/resources/entities/coolguy2.yaml @@ -1,4 +1,4 @@ -extends: /coolguy +extends: coolguy components: movement: deltaX: 1 diff --git a/test-projects/ecs-loading/src/main/resources/scenes/two-person.yaml b/test-projects/ecs-loading/src/main/resources/scenes/two-person.yaml index d8a4d84..395adb6 100644 --- a/test-projects/ecs-loading/src/main/resources/scenes/two-person.yaml +++ b/test-projects/ecs-loading/src/main/resources/scenes/two-person.yaml @@ -1,14 +1,14 @@ entities: - - type: /map + - type: map name: map - - type: /person + - type: person name: person1 components: placement: x: 1 y: 1 size: 1 - - type: /person + - type: person name: person2 components: placement: diff --git a/test-projects/ecs-loading/src/main/resources/worlds/main.yaml b/test-projects/ecs-loading/src/main/resources/worlds/main.yaml index 43bf2ba..253ac6d 100644 --- a/test-projects/ecs-loading/src/main/resources/worlds/main.yaml +++ b/test-projects/ecs-loading/src/main/resources/worlds/main.yaml @@ -2,15 +2,15 @@ systems: - movement - damage entities: - - type: /map + - type: map name: map - - type: /person + - type: person components: placement: x: 1 y: 1 size: 1 - - type: /person + - type: person components: placement: x: 8 diff --git a/test-projects/simplegame/src/main/kotlin/simplegame/MovementSystem.kt b/test-projects/simplegame/src/main/kotlin/simplegame/MovementSystem.kt index c4ba8a2..0bf16bc 100644 --- a/test-projects/simplegame/src/main/kotlin/simplegame/MovementSystem.kt +++ b/test-projects/simplegame/src/main/kotlin/simplegame/MovementSystem.kt @@ -5,7 +5,7 @@ import fledware.ecs.GroupIteratorSystem import fledware.ecs.WorldData import fledware.ecs.definitions.EcsSystem import fledware.ecs.componentIndexOf -import fledware.ecs.definitions.instantiator.MutableComponentArgument +import fledware.ecs.definitions.MutableComponentArgument val WorldData.map get() = entitiesNamed["map"] ?: throw IllegalStateException("map not found") val inputX = MutableComponentArgument("placement", Placement::x.name)