New home for the tools

This commit is contained in:
Aaron Fischer 2019-06-24 00:53:43 +02:00
commit ff790c8e4a
74 changed files with 2805 additions and 0 deletions

71
.gitignore vendored Normal file
View file

@ -0,0 +1,71 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# Visual Studio Code related
.vscode/
# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.packages
.pub-cache/
.pub/
/mobile-app/build/
# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java
# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/mobile-app/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

10
mobile-app/.metadata Normal file
View file

@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: 7a4c33425ddd78c54aba07d86f3f9a4a0051769b
channel: stable
project_type: app

16
mobile-app/README.md Normal file
View file

@ -0,0 +1,16 @@
# toolheim
A new Flutter project.
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.

View file

@ -0,0 +1,61 @@
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.toolheim"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

View file

@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.toolheim">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

View file

@ -0,0 +1,33 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.toolheim">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="toolheim"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in @style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>

View file

@ -0,0 +1,13 @@
package com.example.toolheim;
import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
public class MainActivity extends FlutterActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
}
}

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
</resources>

View file

@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.toolheim">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

View file

@ -0,0 +1,29 @@
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}

View file

@ -0,0 +1 @@
org.gradle.jvmargs=-Xmx1536M

View file

@ -0,0 +1,6 @@
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

View file

@ -0,0 +1,15 @@
include ':app'
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}
plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
}

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
</dict>
</plist>

View file

@ -0,0 +1 @@
#include "Generated.xcconfig"

View file

@ -0,0 +1 @@
#include "Generated.xcconfig"

View file

@ -0,0 +1,506 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEBA1CF902C7004384FC /* Flutter.framework */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
);
name = Flutter;
sourceTree = "<group>";
};
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
CF3B75C9A7D2FA2A4C99F110 /* Frameworks */,
);
sourceTree = "<group>";
};
97C146EF1CF9000F007C117D /* Products */ = {
isa = PBXGroup;
children = (
97C146EE1CF9000F007C117D /* Runner.app */,
);
name = Products;
sourceTree = "<group>";
};
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */,
97C146F11CF9000F007C117D /* Supporting Files */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
);
path = Runner;
sourceTree = "<group>";
};
97C146F11CF9000F007C117D /* Supporting Files */ = {
isa = PBXGroup;
children = (
97C146F21CF9000F007C117D /* main.m */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
97C146ED1CF9000F007C117D /* Runner */ = {
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
);
buildRules = (
);
dependencies = (
);
name = Runner;
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0910;
ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
};
};
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
97C146ED1CF9000F007C117D /* Runner */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
97C146EC1CF9000F007C117D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Thin Binary";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
97C146EA1CF9000F007C117D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
97C146F31CF9000F007C117D /* main.m in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C146FB1CF9000F007C117D /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C147001CF9000F007C117D /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Profile;
};
249021D4217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = S8QB4VV633;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.toolheim;
PRODUCT_NAME = "$(TARGET_NAME)";
VERSIONING_SYSTEM = "apple-generic";
};
name = Profile;
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
97C147061CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.toolheim;
PRODUCT_NAME = "$(TARGET_NAME)";
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
97C147071CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.toolheim;
PRODUCT_NAME = "$(TARGET_NAME)";
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147031CF9000F007C117D /* Debug */,
97C147041CF9000F007C117D /* Release */,
249021D3217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147061CF9000F007C117D /* Debug */,
97C147071CF9000F007C117D /* Release */,
249021D4217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
</Workspace>

View file

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
</Workspace>

View file

@ -0,0 +1,6 @@
#import <Flutter/Flutter.h>
#import <UIKit/UIKit.h>
@interface AppDelegate : FlutterAppDelegate
@end

View file

@ -0,0 +1,13 @@
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GeneratedPluginRegistrant registerWithRegistry:self];
// Override point for customization after application launch.
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end

View file

@ -0,0 +1,122 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "LaunchImage.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

View file

@ -0,0 +1,5 @@
# Launch Screen Assets
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.

View file

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="LaunchImage" width="168" height="185"/>
</resources>
</document>

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--Flutter View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>

View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>toolheim</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>

View file

@ -0,0 +1,9 @@
#import <Flutter/Flutter.h>
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char* argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}

View file

@ -0,0 +1,66 @@
import 'dart:collection';
import 'package:json_annotation/json_annotation.dart';
import 'package:yaml/yaml.dart';
part 'Warband.g.dart';
// flutter packages pub run build_runner build --delete-conflicting-outputs
@JsonSerializable(nullable: true, anyMap: true)
class Hero {
@JsonKey(name: 'hero')
final String name;
final String stats;
final String skilllists;
final String weapons;
final String amour;
final String rules;
final int warbandaddition;
Hero(this.stats, this.skilllists, this.weapons, this.amour, this.rules, this.warbandaddition, this.name);
factory Hero.fromJson(yaml) =>
_$HeroFromJson(yaml);
}
@JsonSerializable(nullable: true, anyMap: true)
class Warband {
@JsonKey(name: 'warband', fromJson: _warbandNameAndRace)
HashMap<String, String> nameAndRace;
@JsonKey(ignore: true)
String name;
@JsonKey(ignore: true)
String race;
@JsonKey(name: 'campaign')
final int campaignPoints;
final String objective;
final String alignment;
final String achievments;
final int gc;
final int shards;
final String equipment;
final List<Hero> heros;
Warband(this.nameAndRace, this.campaignPoints, this.objective, this.alignment, this.gc, this.shards, this.equipment, this.achievments, this.heros) {
this.race = this.nameAndRace['name'];
this.name = this.nameAndRace['race'];
}
static HashMap<String, String>_warbandNameAndRace(String nameAndRace) {
HashMap<String, String> nr = new HashMap();
RegExp re = new RegExp(r"(.*) \((.*)\)");
var matches = re.allMatches(nameAndRace);
nr['name'] = matches.toList().first.group(1).toString();
nr['race'] = matches.toList().first.group(2).toString();
return nr;
}
factory Warband.fromJson(YamlMap yaml) =>
_$WarbandFromJson(yaml);
}

View file

@ -0,0 +1,55 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'Warband.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Hero _$HeroFromJson(Map json) {
return Hero(
json['stats'] as String,
json['skilllists'] as String,
json['weapons'] as String,
json['amour'] as String,
json['rules'] as String,
json['warbandaddition'] as int,
json['hero'] as String);
}
Map<String, dynamic> _$HeroToJson(Hero instance) => <String, dynamic>{
'hero': instance.name,
'stats': instance.stats,
'skilllists': instance.skilllists,
'weapons': instance.weapons,
'amour': instance.amour,
'rules': instance.rules,
'warbandaddition': instance.warbandaddition
};
Warband _$WarbandFromJson(Map json) {
return Warband(
Warband._warbandNameAndRace(json['warband'] as String),
json['campaign'] as int,
json['objective'] as String,
json['alignment'] as String,
json['gc'] as int,
json['shards'] as int,
json['equipment'] as String,
json['achievments'] as String,
(json['heros'] as List)
?.map((e) => e == null ? null : Hero.fromJson(e))
?.toList());
}
Map<String, dynamic> _$WarbandToJson(Warband instance) => <String, dynamic>{
'warband': instance.nameAndRace,
'campaign': instance.campaignPoints,
'objective': instance.objective,
'alignment': instance.alignment,
'achievments': instance.achievments,
'gc': instance.gc,
'shards': instance.shards,
'equipment': instance.equipment,
'heros': instance.heros
};

57
mobile-app/lib/main.dart Normal file
View file

@ -0,0 +1,57 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:toolheim/Warband.dart';
import 'package:yaml/yaml.dart';
void main() => runApp(Toolheim());
class Toolheim extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Toolheim',
theme: ThemeData(
primarySwatch: Colors.brown,
accentColor: Colors.grey,
),
home: RoasterWidget(),
);
}
}
class RoasterWidget extends StatefulWidget {
@override
_RoasterWidgetState createState() => _RoasterWidgetState();
}
class _RoasterWidgetState extends State<RoasterWidget> {
final String urlPath = 'https://raw.githubusercontent.com/Labernator/Mordheim/master/Mordheim-BorderTownBurning/Warband%20Rosters/Aaron/aaron.mordheim.yml';
Warband warband;
Future fetchWarband() async {
http.Response response = await http.get(urlPath);
YamlMap yamlObject = loadYaml(response.body);
Warband _warband = Warband.fromJson(yamlObject);
setState(() {
warband = _warband;
});
}
void initState() {
fetchWarband();
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(warband.name)
),
body: Text(warband.race, textScaleFactor: 1.3)
);
}
}

454
mobile-app/pubspec.lock Normal file
View file

@ -0,0 +1,454 @@
# Generated by pub
# See https://www.dartlang.org/tools/pub/glossary#lockfile
packages:
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "0.36.3"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.2"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
build:
dependency: transitive
description:
name: build
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.4"
build_config:
dependency: transitive
description:
name: build_config
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.0"
build_daemon:
dependency: transitive
description:
name: build_daemon
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
build_resolvers:
dependency: transitive
description:
name: build_resolvers
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
build_runner:
dependency: "direct dev"
description:
name: build_runner
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.0"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.6"
built_collection:
dependency: transitive
description:
name: built_collection
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.2"
built_value:
dependency: transitive
description:
name: built_value
url: "https://pub.dartlang.org"
source: hosted
version: "6.6.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
checked_yaml:
dependency: "direct main"
description:
name: checked_yaml
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
code_builder:
dependency: transitive
description:
name: code_builder
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.11"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.6"
csslib:
dependency: transitive
description:
name: csslib
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.0"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
dart_style:
dependency: transitive
description:
name: dart_style
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.7"
fixnum:
dependency: transitive
description:
name: fixnum
url: "https://pub.dartlang.org"
source: hosted
version: "0.10.9"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
front_end:
dependency: transitive
description:
name: front_end
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.18"
glob:
dependency: transitive
description:
name: glob
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.7"
graphs:
dependency: transitive
description:
name: graphs
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
html:
dependency: transitive
description:
name: html
url: "https://pub.dartlang.org"
source: hosted
version: "0.14.0+2"
http:
dependency: "direct main"
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.0+2"
http_multi_server:
dependency: transitive
description:
name: http_multi_server
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.3"
io:
dependency: transitive
description:
name: io
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.3"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.1+1"
json_annotation:
dependency: transitive
description:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
json_serializable:
dependency: "direct dev"
description:
name: json_serializable
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
kernel:
dependency: transitive
description:
name: kernel
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.18"
logging:
dependency: transitive
description:
name: logging
url: "https://pub.dartlang.org"
source: hosted
version: "0.11.3+2"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.5"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
mime:
dependency: transitive
description:
name: mime
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.6+3"
package_config:
dependency: transitive
description:
name: package_config
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
package_resolver:
dependency: transitive
description:
name: package_resolver
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.10"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.2"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.0"
pool:
dependency: transitive
description:
name: pool
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.0"
pub_semver:
dependency: transitive
description:
name: pub_semver
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.2"
pubspec_parse:
dependency: transitive
description:
name: pubspec_parse
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
shelf:
dependency: transitive
description:
name: shelf
url: "https://pub.dartlang.org"
source: hosted
version: "0.7.5"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.3"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
source_gen:
dependency: transitive
description:
name: source_gen
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.4+2"
source_span:
dependency: transitive
description:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.5"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.3"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
stream_transform:
dependency: transitive
description:
name: stream_transform
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.19"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.4"
timing:
dependency: transitive
description:
name: timing
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1+1"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
watcher:
dependency: transitive
description:
name: watcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.7+10"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.13"
yaml:
dependency: "direct main"
description:
name: yaml
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.16"
sdks:
dart: ">=2.3.0-dev.0.1 <3.0.0"

77
mobile-app/pubspec.yaml Normal file
View file

@ -0,0 +1,77 @@
name: toolheim
description: A new Flutter project.
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
yaml:
checked_yaml:
http:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
build_runner:
json_serializable:
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages

View file

@ -0,0 +1,30 @@
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:toolheim/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(Toolheim());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}

34
pdf-exporter/.travis.yml Normal file
View file

@ -0,0 +1,34 @@
language: go
go:
- 1.12.x
os:
- linux
- windows
dist: trusty
sudo: false
install: true
script:
- env GO111MODULE=on GOOS=linux GOARCH=amd64 go build -o bin/toolheim_linux .
- env GO111MOBULE=on GOOS=windows GOARCH=amd64 go build -o bin/toolheim_windows.exe .
- env GO111MODULE=on GOOS=darwin GOARCH=amd64 go build -o bin/toolheim_osx .
before_deploy:
- git config --local user.name "Aaron Fischer"
- git config --local user.email "mail@aaron-fischer.net"
- export TRAVIS_TAG=${TRAVIS_TAG:-$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)}
- git tag $TRAVIS_TAG
deploy:
provider: releases
skip_cleanup: true
api_key:
secure: Yc14JpZUZvnS2M9K07AMBt2vUSJBgMDUH/ykGUPjK+RAtKEv5KDqzVnsDMSSLxFv+hfCI9Hr1GNcTqBnQi66kORdpwTC5jTbz+rRGtopDWsciHqpwczSRUwcc9WiG3NjJSTDQejfTlIdgjdcwijLYNy/wvQMF8FqfRzyJYSev3IXShVyTTV71Dzz0UmXgnsU2O8/7ocCk+sWexQISMsHUA968014MQ5CWtBSJ/H35yFdTSa04ajjI6/EzhKwVvUNGmIaglKVzTg3LCXvVXyP3HqxVNHfMndNwKImNiZekjnfYKcWHH9d0LS0o7trX9Xve0WWgp9uGQQuRYElHhNTpDWfZBIFpLfLbEAIB3PLzxD0tR71mb0+TyJq8C/H8BdwZhUXGrBcdjVYAlyJ86CnCo81uRdQZU5FoQEc6WSqH1aLuW+ySYiVij68b1puhMwbVKvJB8WW2URkuPPBhZ/2scJzeUMVm5VhAYd/bZ8Qhf1svTn3kviIrUVWl7KcFPxUuUiR+C6tSbnksMmFWs2o+BMZMKDCfe+1jJyB9MF575qe5Ev7ju2BdMJsdX57dAdxwAzKxE9xi2yGOK22eGVRdZRkI27wtojN5LaDrytIVsj0Pw+KU0/vSW1PhBcWJVkWIGrrA4C/icY/hdK30y6t4bQrMTFr4NxYOJrvVfYHKeM=
file:
- bin/toolheim_windows.exe
- bin/toolheim_linux
- bin/toolheim_osx
on:
repo: f0086/toolheim

20
pdf-exporter/README.md Normal file
View file

@ -0,0 +1,20 @@
# Toolheim
A simple tool to generate warband roasters out of .mordheim definition
files.
## Building
Open a terminal
```
$ GOOS=windows GOARCH=386 go build . # windows binary
$ GOOS=linux GOARCH=amd64 go build . # linux binary
$ GOOS=darwin GOARCH=arm64 go build . # OSX binary
```
## Using the tool
```
$ ./toolheim --help
$ ./toolheim -warband <yourfilename>.mordheim.yml
```

5
pdf-exporter/build.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
GOOS=windows GOARCH=386 go build -o bin/toolheim_windows.exe .
GOOS=linux GOARCH=amd64 go build -o bin/toolheim_linux .
GOOS=darwin GOARCH=arm64 go build -o bin/toolheim_osx .

View file

@ -0,0 +1,39 @@
warband: My sample warband (Marienburg)
campaign: 0
gc: 300
shards: 5
campaign: 25
equipment: Chaos artefact
objective: My campaign objective
heros:
- hero: The leader (pit king) [13XP]
stats: M8, WS4, BS4, S4, T5, W2, I4, A2, Ld9, Sv4
weapons: Axe, Axe
armour: Helmet, Heavy armor, Lucky charm
rules: Leader, Pit fighter
warbandaddition: 25
skilllists: Strength, Shooting, Combat, Speed, Special
- hero: Troll slayer (hired sword) [12XP]
stats: M3, WS4, BS2, S4, T4, W1, I2, A1, Ld9, Sv-
weapons: Hand weapon, Dagger
rules: Hates orks, ...
hiredsword: true
skilllists: Strength, Special
henchmen:
- group: Odd (1 Troll) [0XP]
stats: M6, WS3, BS0, S5, T4, W3, I2, A3, Ld3, Sv-
weapons: Big club
armor: Heavy armor
large: true
rules: Stupid, Regeneration, Fearful
- group: Sample henchmen (4 Gor) [1XP]
stats: M5, WS2, BS3, S3, T3, W1, I3, A1, Ld5, Sv-
weapons: Dagger, Dagger
notes:
Zusammenhängender Text
der auch auf mehrere Zeilen verteilt werden kann. Und der auch automatisch umgebrochen wird.

View file

@ -0,0 +1,478 @@
package exporter
import (
"strconv"
//"fmt"
"github.com/f0086/toolheim/parser"
"github.com/jung-kurt/gofpdf"
)
var marker_sign = "X"
var text_color_r = 170
var text_color_g = 0
var text_color_b = 0
var startY = 0
var offsetY = 0
func MakeHeroPage(warband parser.Warband, pdf *gofpdf.Fpdf, newPage bool) {
if !newPage {
// add a new page if required
if startY > 297-60 {
pdf.AddPage()
startY = 0
offsetY = 0
}
} else {
pdf.AddPage()
startY = 0
offsetY = 0
}
shiftY := 44
for i, hero := range warband.Heros {
if i > 0 {
offsetY = offsetY + shiftY
}
// handle multipage henchmen lists
if offsetY > 297-60 {
pdf.AddPage()
offsetY = 0
}
// Background
pdf.SetXY(5, float64(offsetY+5))
pdf.Image("images/hero.png", 5, 0, 1499*0.133, 295*0.133, true, "", 0, "")
// Name
pdf.SetFont("Arial", "B", 12)
pdf.SetXY(18, float64(offsetY+4))
pdf.Write(11, hero.Name)
// Type
pdf.SetFont("Arial", "", 12)
pdf.SetXY(18, float64(offsetY+10))
pdf.Write(11, hero.Type)
// Stats
pdf.SetFillColor(255, 0, 0)
pdf.SetFont("Arial", "", 13)
pdf.SetFontUnitSize(5)
pdf.SetXY(6, float64(offsetY+24))
if len(hero.Stats.Movement) > 1 {
pdf.SetX(3)
}
pdf.Write(11, hero.Stats.Movement)
pdf.SetX(13)
pdf.Write(11, strconv.Itoa(hero.Stats.WeaponSkill))
pdf.SetX(20)
pdf.Write(11, strconv.Itoa(hero.Stats.BallisticSkill))
pdf.SetX(27)
pdf.Write(11, strconv.Itoa(hero.Stats.Strength))
pdf.SetX(33)
pdf.Write(11, strconv.Itoa(hero.Stats.Toughness))
pdf.SetX(40)
pdf.Write(11, strconv.Itoa(hero.Stats.Wounds))
pdf.SetX(46)
pdf.Write(11, strconv.Itoa(hero.Stats.Initiative))
pdf.SetX(53)
pdf.Write(11, strconv.Itoa(hero.Stats.Attacks))
pdf.SetX(59.5)
pdf.Write(11, strconv.Itoa(hero.Stats.Leadership))
pdf.SetX(66.0)
pdf.Write(11, hero.Stats.Save)
// Skill lists
if hero.BSkillLists.Combat == true {
pdf.SetFont("Arial", "B", 10)
pdf.SetXY(7.25, float64(offsetY+21))
pdf.Write(0, marker_sign)
}
if hero.BSkillLists.Shooting == true {
pdf.SetFont("Arial", "B", 10)
pdf.SetXY(17.75, float64(offsetY+21))
pdf.Write(0, marker_sign)
}
if hero.BSkillLists.Academic == true {
pdf.SetFont("Arial", "B", 10)
pdf.SetXY(28.72, float64(offsetY+21))
pdf.Write(0, marker_sign)
}
if hero.BSkillLists.Strength == true {
pdf.SetFont("Arial", "B", 10)
pdf.SetXY(40.5, float64(offsetY+21))
pdf.Write(0, marker_sign)
}
if hero.BSkillLists.Speed == true {
pdf.SetFont("Arial", "B", 10)
pdf.SetXY(51.5, float64(offsetY+21))
pdf.Write(0, marker_sign)
}
if hero.BSkillLists.Special == true {
pdf.SetFont("Arial", "B", 10)
pdf.SetXY(60.7, float64(offsetY+21))
pdf.Write(0, marker_sign)
}
// Weapons
if hero.Weapons != nil {
for w, weapon := range hero.Weapons.List {
if w == 0 {
pdf.SetFont("Arial", "B", 10)
} else {
pdf.SetFont("Arial", "", 10)
}
pdf.SetXY(138, float64(offsetY+7+(w*5)))
pdf.Write(11, weapon)
}
}
// Armour
pdf.SetFont("Arial", "", 10)
if hero.Armour != nil {
for j, armour := range hero.Armour.List {
pdf.SetXY(168, float64(offsetY+3+(j*5)))
pdf.Write(11, armour)
}
}
ox := 0
oy := 0
if hero.Rules != nil {
for j, rule := range hero.Rules.List {
pdf.SetXY(float64(75+ox), float64(offsetY+6+(j*5)+oy))
pdf.Write(11, rule)
if j == 3 {
// start right of the first line after 4th line
ox = 30
oy = -20
}
}
}
if hero.HiredSword {
// show hired sword marker
pdf.SetXY(0, float64(offsetY)+38.5)
pdf.Image("images/hiredsword_marker.png", 6, 0, 421*0.053, 97*0.053, true, "", 0, "")
}
// XP
pdf.SetFont("Arial", "", 20)
pdf.SetXY(185, float64(offsetY+28))
pdf.Write(20, strconv.Itoa(hero.Experience))
y := 0.0
reduce_x := 0
for x := 1; x <= hero.Experience; x++ {
pdf.SetFont("Arial", "B", 10)
xx := x
if reduce_x > 0 {
xx = xx - reduce_x*30
}
pdf.SetXY(float64(73+((float64(xx)-1.0)*3.43)), float64(offsetY)+float64(y)*15.0+34.0)
pdf.Write(0, marker_sign)
if x == 30 || x == 60 {
y = y + 0.22
reduce_x = reduce_x + 1
}
}
}
offsetY = offsetY + shiftY
}
func MakeHenchmenPage(warband parser.Warband, pdf *gofpdf.Fpdf, newPage bool) {
if !newPage {
// add a new page if required
if startY > 297-60 {
pdf.AddPage()
startY = 0
offsetY = 0
}
} else {
pdf.AddPage()
startY = 0
offsetY = 0
}
shiftY := 34
for i, henchmen := range warband.HenchmenGroups {
if i > 0 {
offsetY = offsetY + shiftY
}
// handle multipage henchmen lists
if offsetY > 297-60 {
pdf.AddPage()
offsetY = 0
}
// Background
pdf.SetX(5)
pdf.SetY(float64(offsetY + 5))
pdf.Image("images/henchmen.png", 5, 0, 1499*0.133, 218*0.133, true, "", 0, "")
pdf.SetFont("Arial", "B", 12)
// Name
pdf.SetY(float64(offsetY + 4))
pdf.SetX(18)
pdf.Write(11, henchmen.Name)
// Type
pdf.SetFont("Arial", "", 12)
pdf.SetY(float64(offsetY + 9))
pdf.SetX(18)
pdf.Write(11, henchmen.Type)
// Number
pdf.SetFont("Arial", "B", 12)
pdf.SetY(float64(offsetY + 9))
pdf.SetX(64)
pdf.Write(11, strconv.Itoa(henchmen.Number))
// Stats
pdf.SetFillColor(255, 0, 0)
pdf.SetFont("Arial", "", 12)
pdf.SetFontUnitSize(5)
pdf.SetY(float64(offsetY + 18))
pdf.SetX(6)
if len(henchmen.Stats.Movement) > 1 {
pdf.SetX(3)
}
pdf.Write(11, henchmen.Stats.Movement)
pdf.SetX(13)
pdf.Write(11, strconv.Itoa(henchmen.Stats.WeaponSkill))
pdf.SetX(20)
pdf.Write(11, strconv.Itoa(henchmen.Stats.BallisticSkill))
pdf.SetX(27)
pdf.Write(11, strconv.Itoa(henchmen.Stats.Strength))
pdf.SetX(33)
pdf.Write(11, strconv.Itoa(henchmen.Stats.Toughness))
pdf.SetX(40)
pdf.Write(11, strconv.Itoa(henchmen.Stats.Wounds))
pdf.SetX(46)
pdf.Write(11, strconv.Itoa(henchmen.Stats.Initiative))
pdf.SetX(53)
pdf.Write(11, strconv.Itoa(henchmen.Stats.Attacks))
pdf.SetX(59.5)
pdf.Write(11, strconv.Itoa(henchmen.Stats.Leadership))
pdf.SetX(66.0)
pdf.Write(11, henchmen.Stats.Save)
// Weapons
if henchmen.Weapons != nil {
for w, weapon := range henchmen.Weapons.List {
if w == 0 {
pdf.SetFont("Arial", "B", 10)
} else {
pdf.SetFont("Arial", "", 10)
}
pdf.SetXY(138, float64(offsetY+7+(w*5)))
pdf.Write(11, weapon)
}
}
// Armour
pdf.SetFont("Arial", "", 10)
if henchmen.Armour != nil {
for j, armour := range henchmen.Armour.List {
pdf.SetXY(170, float64(offsetY+3+(j*5)))
pdf.Write(11, armour)
}
}
// Rules
if henchmen.Rules != nil {
for j, rule := range henchmen.Rules.List {
pdf.SetXY(75, float64(offsetY+7+(j*5)))
pdf.Write(11, rule)
}
}
// XP
pdf.SetFont("Arial", "", 13)
pdf.SetXY(190, float64(offsetY+21))
pdf.Write(20, strconv.Itoa(henchmen.Experience))
for x := 1; x <= henchmen.Experience; x++ {
pdf.SetFont("Arial", "B", 12)
pdf.SetXY(float64(137+((float64(x)-1.0)*3.45)), float64(offsetY)+30.5)
pdf.Write(0, marker_sign)
}
}
}
func MakeStatisticPage(warband parser.Warband, pdf *gofpdf.Fpdf) {
// Statistic page
pdf.AddPage()
startY = 23
offsetY = 0
// First page warband heading
pdf.SetFont("Arial", "B", 28)
pdf.SetXY(5, 5)
pdf.Write(11, warband.Warband.Name)
pdf.SetFont("Arial", "B", 17)
pdf.SetXY(5, 13)
pdf.Write(11, warband.Warband.Race)
offsetY = 23
// Warband status
pdf.SetX(5)
pdf.SetY(float64(offsetY) + 5)
pdf.Image("images/wb_stats.png", 5, 0, 1499*0.133, 218*0.133, true, "", 0, "")
// Equipment
pdf.SetFont("Arial", "", 10)
oX := 0
oY := 0
if warband.Equipment != nil {
for j, e := range warband.Equipment.List {
pdf.SetXY(123+float64(oX), float64(offsetY+oY+6+(j*5)))
pdf.Write(11, e)
if j == 4 {
oX = 40
oY = -25
}
}
}
pdf.SetFont("Arial", "B", 10)
pdf.SetXY(55, float64(offsetY)+32.0)
pdf.Write(0, strconv.Itoa(warband.Rating))
pdf.SetFont("Arial", "", 10)
pdf.SetXY(72.5, float64(offsetY)+32.0)
pdf.SetTextColor(0, 0, 0)
pdf.Write(0, "Routtest: ")
pdf.SetFont("Arial", "", 10)
pdf.SetTextColor(text_color_r, text_color_g, text_color_b)
pdf.SetXY(95, float64(offsetY)+32.0)
pdf.Write(0, strconv.Itoa(warband.Routtest))
pdf.SetFont("Arial", "", 10)
pdf.SetXY(55, float64(offsetY)+11.25)
pdf.Write(0, strconv.Itoa(warband.Hero_sum_xp))
pdf.SetXY(60, float64(offsetY)+11.25)
pdf.Write(0, "(+"+strconv.Itoa(warband.WarbandAddition_sum)+")")
pdf.SetFont("Arial", "", 10)
pdf.SetXY(55, float64(offsetY)+14.75)
pdf.Write(0, strconv.Itoa(warband.Henchmen_sum_xp))
pdf.SetFont("Arial", "B", 10)
pdf.SetXY(22.05, float64(offsetY)+18.0)
pdf.Write(0, strconv.Itoa(warband.Hero_cnt+warband.Henchmen_cnt+warband.Hiredsword_cnt))
pdf.SetFont("Arial", "", 10)
pdf.SetXY(55.0, float64(offsetY)+18.0)
pdf.Write(0, strconv.Itoa((warband.Hero_cnt+warband.Henchmen_cnt+warband.Hiredsword_cnt)*5))
pdf.SetFont("Arial", "B", 10)
pdf.SetXY(32.05, float64(offsetY)+21.25)
pdf.Write(0, strconv.Itoa(warband.Large_cnt))
pdf.SetFont("Arial", "", 10)
pdf.SetXY(55.0, float64(offsetY)+21.25)
pdf.Write(0, strconv.Itoa((warband.Large_cnt)*20))
pdf.SetFont("Arial", "B", 10)
pdf.SetXY(27.05, float64(offsetY)+24.5)
pdf.Write(0, "( "+strconv.Itoa(warband.Hiredsword_cnt)+" )")
pdf.SetFont("Arial", "", 10)
pdf.SetXY(55.0, float64(offsetY)+24.5)
pdf.Write(0, strconv.Itoa(warband.Hiredsword_sum_xp))
pdf.SetFont("Arial", "B", 10)
pdf.SetXY(95, float64(offsetY)+11.25)
pdf.Write(0, strconv.Itoa(warband.GoldCrowns))
pdf.SetFont("Arial", "B", 10)
pdf.SetXY(95, float64(offsetY)+17.75)
pdf.Write(0, strconv.Itoa(warband.Shards))
// Campaign info block
offsetY = offsetY + 40
pdf.SetXY(5, float64(offsetY))
pdf.Image("images/campaign.png", 5, 0, 1499*0.133, 218*0.133, true, "", 0, "")
pdf.SetFont("Arial", "B", 10)
pdf.SetXY(22, float64(offsetY)+6.25)
pdf.Write(0, warband.Objective)
pdf.SetFont("Arial", "", 10)
pdf.SetXY(147, float64(offsetY)+20.0)
pdf.Write(0, strconv.Itoa(warband.CampaignPoints))
row := 0
for x := 1; x <= warband.CampaignPoints; x++ {
pdf.SetFont("Arial", "B", 8)
xx := x - (row * 20)
pdf.SetXY(float64(130.75+((float64(xx)-1.0)*3.30)), float64(offsetY)+float64(24.4)+float64((float64(row)*float64(2.5))))
pdf.Write(0, marker_sign)
if x == 20 {
row = row + 1
}
}
// Notes block
offsetY = offsetY + 35
pdf.SetXY(5, float64(offsetY))
pdf.Image("images/notes.png", 5, 0, 1499*0.133, 218*0.33, true, "", 0, "")
pdf.SetFont("Arial", "", 12)
lines := pdf.SplitLines([]byte(warband.Notes), 195)
for i := 0; i < len(lines); i++ {
pdf.SetXY(7.0, float64(offsetY+8+i*8))
pdf.Write(0, string(lines[i]))
}
// the space after
offsetY = offsetY + 70
/*
pdf.SetFont("Arial", "B", 13)
pdf.SetXY(20, float64(offsetY+21))
pdf.Write(20, strconv.Itoa(hero_cnt))
pdf.SetFont("Arial", "B", 13)
pdf.SetXY(20, float64(offsetY+21))
pdf.Write(20, strconv.Itoa(len(warband.HenchmenGroups)))
pdf.SetFont("Arial", "B", 13)
pdf.SetXY(20, float64(offsetY+21))
pdf.Write(20, strconv.Itoa(henchmen_cnt))
offsetY = offsetY + 20
pdf.SetFont("Arial", "B", 13)
pdf.SetXY(20, float64(offsetY+21))
pdf.Write(20, strconv.Itoa(hero_cnt+henchmen_cnt))
*/
}
func MakePDF(warband parser.Warband, multiPage bool) {
pdf := gofpdf.New("P", "mm", "A4", "")
pdf.SetTextColor(text_color_r, text_color_g, text_color_b)
MakeStatisticPage(warband, pdf)
MakeHeroPage(warband, pdf, multiPage)
MakeHenchmenPage(warband, pdf, multiPage)
// TODO: Make output name variable or use name of the input file
err := pdf.OutputFileAndClose("warband-roaster.pdf")
if err != nil {
panic(err)
}
}

9
pdf-exporter/go.mod Normal file
View file

@ -0,0 +1,9 @@
module github.com/f0086/toolheim
go 1.12
require (
github.com/ghodss/yaml v1.0.0
github.com/jung-kurt/gofpdf v1.0.1
gopkg.in/yaml.v2 v2.2.2 // indirect
)

7
pdf-exporter/go.sum Normal file
View file

@ -0,0 +1,7 @@
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/jung-kurt/gofpdf v1.0.1 h1:edqVJAH0OvJmAAUup0lfOSM3VpPxQKtGvq3tu0MEknk=
github.com/jung-kurt/gofpdf v1.0.1/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

24
pdf-exporter/main.go Normal file
View file

@ -0,0 +1,24 @@
package main
import (
"flag"
"io/ioutil"
"github.com/f0086/toolheim/exporter"
"github.com/f0086/toolheim/parser"
)
var warbandFile = flag.String("warband", "", ".mordheim warband definition file to work with")
var multiPage = flag.Bool("multipage", false, ".flag to generate multipage PDF")
func main() {
flag.Parse()
yamlContent, err := ioutil.ReadFile(*warbandFile)
if err != nil {
panic(err)
}
warband := parser.ParseWarband(yamlContent)
exporter.MakePDF(warband, *multiPage)
}

View file

@ -0,0 +1,234 @@
package parser
import (
"math"
"regexp"
"strconv"
"strings"
//"fmt"
//"github.com/davecgh/go-spew/spew"
"github.com/ghodss/yaml"
)
type Warband struct {
Warband *WarbandName `json:"warband"`
Rating int `json:"rating"`
CampaignPoints int `json:"campaign"`
GoldCrowns int `json:"gc"`
Shards int `json:"shards"`
Equipment *ItemList `json:"equipment"`
Heros []*Hero `json:"heros"`
HenchmenGroups []*HenchmenGroup `json:"henchmen"`
Notes string `json:"notes"`
Objective string `json:"objective"`
Henchmen_sum_xp int
Henchmen_cnt int
Hero_sum_xp int
Hero_cnt int
Hiredsword_sum_xp int
Hiredsword_cnt int
Large_cnt int
Routtest int
WarbandAddition_sum int
}
type WarbandName struct {
Name string
Race string
}
type ItemList struct {
List []string
}
type Hero struct {
Header string `json:"hero"`
Name string
Type string
Experience int
WarbandAddition int `json:"warbandaddition,omitempty"`
Stats *Stats `json:"stats,omitempty"`
Large bool `json:"large"`
HiredSword bool `json:"hiredsword"`
Weapons *ItemList `json:"weapons,omitempty"`
Armour *ItemList `json:"armour,omitempty"`
Rules *ItemList `json:"rules,omitempty"`
SkillLists *ItemList `json:"skilllists,omitempty"`
BSkillLists Skilllist
}
type HenchmenGroup struct {
Header string `json:"group"`
Name string
Number int
Type string
Experience int
Large bool `json:"large"`
Stats *Stats `json:"stats"`
Weapons *ItemList `json:"weapons"`
Armour *ItemList `json:"armour"`
Rules *ItemList `json:"rules"`
}
type Weapons struct {
MainHand string
OffHand string
}
type Stats struct {
Movement string
WeaponSkill int
BallisticSkill int
Strength int
Toughness int
Wounds int
Initiative int
Attacks int
Leadership int
Save string
}
type Skilllist struct {
Strength bool
Academic bool
Combat bool
Shooting bool
Speed bool
Special bool
}
func (stats *Stats) UnmarshalJSON(b []byte) error {
regex := regexp.MustCompile(`"\s*M([0-9]+[dD]*[6]*)\s*,\s*WS([0-9]+)\s*,\s*BS([0-9]+)\s*,\s*S([0-9]+)\s*,\s*T([0-9]+)\s*,\s*W([0-9]+)\s*,\s*I([0-9]+)\s*,\s*A([0-9]+)\s*,\s*Ld([0-9]+)\s*,\s*Sv([0-9\-]+)\s*"`)
matches := regex.FindStringSubmatch(string(b))
stats.Movement = matches[1]
stats.WeaponSkill, _ = strconv.Atoi(matches[2])
stats.BallisticSkill, _ = strconv.Atoi(matches[3])
stats.Strength, _ = strconv.Atoi(matches[4])
stats.Toughness, _ = strconv.Atoi(matches[5])
stats.Wounds, _ = strconv.Atoi(matches[6])
stats.Initiative, _ = strconv.Atoi(matches[7])
stats.Attacks, _ = strconv.Atoi(matches[8])
stats.Leadership, _ = strconv.Atoi(matches[9])
stats.Save = matches[10]
return nil
}
func (warband *WarbandName) UnmarshalJSON(b []byte) error {
regex := regexp.MustCompile(`"([^\(]+)\(([^\)]+)\)`)
matches := regex.FindStringSubmatch(string(b))
warband.Name = strings.TrimSpace(matches[1])
warband.Race = strings.TrimSpace(matches[2])
return nil
}
func (itemList *ItemList) UnmarshalJSON(b []byte) error {
items := strings.Split(string(b[1:len(b)-1]), ",")
for _, item := range items {
itemList.List = append(itemList.List, strings.TrimSpace(item))
}
return nil
}
func (hands *Weapons) UnmarshalJSON(b []byte) error {
items := strings.Split(string(b[1:len(b)-1]), ",")
hands.MainHand = strings.TrimSpace(items[0])
if len(items) > 1 {
hands.OffHand = strings.TrimSpace(items[1])
}
return nil
}
func ParseWarband(warbandDefinition []byte) Warband {
var warband Warband
err := yaml.Unmarshal(warbandDefinition, &warband)
if err != nil {
panic(err)
}
for _, h := range warband.Heros {
regex := regexp.MustCompile(`([^\(]+)\(([^\)]+)\)\s*\[([0-9]+)XP\]\s*`)
matches := regex.FindStringSubmatch(string(h.Header))
h.Name = strings.TrimSpace(matches[1])
h.Type = strings.TrimSpace(matches[2])
h.Experience, _ = strconv.Atoi(strings.TrimSpace(matches[3]))
if h.WarbandAddition > 0 {
warband.Rating = warband.Rating + h.WarbandAddition
warband.WarbandAddition_sum = warband.WarbandAddition_sum + h.WarbandAddition
}
if !h.Large && !h.HiredSword {
warband.Rating = warband.Rating + h.Experience + 5
warband.Hero_sum_xp = warband.Hero_sum_xp + h.Experience
warband.Hero_cnt = warband.Hero_cnt + 1
} else if h.Large {
warband.Rating = warband.Rating + h.Experience + 20
warband.Hero_sum_xp = warband.Hero_sum_xp + h.Experience
warband.Large_cnt = warband.Large_cnt + 1
} else if h.HiredSword {
warband.Rating = warband.Rating + h.Experience + 5
warband.Hiredsword_sum_xp = warband.Hiredsword_sum_xp + h.Experience
warband.Hiredsword_cnt = warband.Hiredsword_cnt + 1
} // TODO it is not possible that a large hired sword can be added
// hier text Skill listen-Name zu boolschen Wert umwandeln
h.BSkillLists.Speed = false
h.BSkillLists.Shooting = false
h.BSkillLists.Special = false
h.BSkillLists.Combat = false
h.BSkillLists.Academic = false
h.BSkillLists.Strength = false
for _, s := range h.SkillLists.List {
if strings.EqualFold(s, "Speed") {
h.BSkillLists.Speed = true
}
if strings.EqualFold(s, "Shooting") {
h.BSkillLists.Shooting = true
}
if strings.EqualFold(s, "Special") {
h.BSkillLists.Special = true
}
if strings.EqualFold(s, "Combat") {
h.BSkillLists.Combat = true
}
if strings.EqualFold(s, "Academic") {
h.BSkillLists.Academic = true
}
if strings.EqualFold(s, "Strength") {
h.BSkillLists.Strength = true
}
}
}
for _, hg := range warband.HenchmenGroups {
regex := regexp.MustCompile(`([^\(]+)\(([0-9]+)x?\s+([^\)]+)\)\s*\[([0-9]+)XP\]\s*`)
matches := regex.FindStringSubmatch(string(hg.Header))
hg.Name = strings.TrimSpace(matches[1])
hg.Number, _ = strconv.Atoi(strings.TrimSpace(matches[2]))
hg.Type = strings.TrimSpace(matches[3])
hg.Experience, _ = strconv.Atoi(strings.TrimSpace(matches[4]))
if !hg.Large {
warband.Henchmen_sum_xp = warband.Henchmen_sum_xp + (hg.Experience * hg.Number)
warband.Henchmen_cnt = warband.Henchmen_cnt + hg.Number
warband.Rating = warband.Rating + (hg.Experience+5)*hg.Number
} else {
warband.Henchmen_sum_xp = warband.Henchmen_sum_xp + (hg.Experience * hg.Number)
warband.Large_cnt = warband.Large_cnt + 1
warband.Rating = warband.Rating + (hg.Experience+20)*hg.Number
}
}
warband.Routtest = int(math.RoundToEven(float64(warband.Hero_cnt+warband.Henchmen_cnt+warband.Large_cnt+warband.Hiredsword_cnt) / 4.0))
if float64(warband.Hero_cnt+warband.Henchmen_cnt+warband.Large_cnt+warband.Hiredsword_cnt)/4.0 > float64(warband.Routtest) {
warband.Routtest = warband.Routtest + 1
}
//spew.Dump(warband)
return warband
}