Compare commits

...

33 Commits

Author SHA1 Message Date
jim 1b2c1ae038 Merge branch 'master' into jimFirstDesign 6 years ago
jim f7ab517d04 Removed Custom Code Style 6 years ago
jim 90b5290192 Ability has now a constructor 6 years ago
Felix Stupp 1d230f0872 Added class Ability 6 years ago
Felix Stupp 1ba0ffb763 Fixed Rename of Aspects in Regulations 6 years ago
Felix Stupp 7ee325d760 Added Interface HasRequirement 6 years ago
jim 13a6f32cea Requirement add classes 6 years ago
jim 78572930d3 skills into abilities 6 years ago
jim 18b29010fb Aspect: add opposite 6 years ago
jim 3465f1852b requriments dellete and new 6 years ago
Felix Stupp 5a0d937158 Removed usless commit by jimknopf 6 years ago
jim 86d8e33fb3 usless commentar 6 years ago
Felix Stupp e17861d9a6 Defined default code style for IntelliJ 6 years ago
Felix Stupp eb7a3a50bb Fixed imports for Aspect 6 years ago
Felix Stupp cddde8f42b Reworked Requirements (WIP) 6 years ago
Felix Stupp 3bf0b0c5f9 Added empty description 6 years ago
Felix Stupp d3d614c940 Moved classes for descriptions to certain package 6 years ago
Felix Stupp 0899364a6e Fixed name of package de.banananetwork.dsa.requirements 6 years ago
Felix Stupp a7ff66428a Added AP Costs to Aspect 6 years ago
Felix Stupp 13afcc067d Fixed package of Aspect 6 years ago
Felix Stupp d1d3f331fd Introduced RequirementSet 6 years ago
Felix Stupp f4c8cf1181 Fixed: Fully renamed class Modification to Aspect 6 years ago
Felix Stupp 046818619f Renamed Modification to Aspect 6 years ago
Felix Stupp 03d85f470b Added comment for money to Character 6 years ago
Felix Stupp c8870ac1bf Added MaxAP to Character 6 years ago
Felix Stupp 5c8d21a152 Added package-info to de.banananetwork.dsa.skills 6 years ago
Felix Stupp 6438935f36 Converted CurrencySet from Java to Kotlin 6 years ago
Felix Stupp 2973716c78 Implemented CurrencySet 6 years ago
Felix Stupp 764d8dcd74 Added getMultiplier to Currency 6 years ago
Felix Stupp c5be34bab5 Updated base structure 6 years ago
Felix Stupp 9273ffd554 Renamed CoinType to Currency 6 years ago
Felix Stupp c7df84d90d Introduced first package structure 6 years ago
Felix Stupp 6c4fef6cc1 Introduced CoinType for transfer between different currencies 6 years ago

@ -0,0 +1,22 @@
package de.banananetwork.dsa;
import de.banananetwork.dsa.currencies.Currency;
import de.banananetwork.dsa.aspects.Aspect;
import de.banananetwork.dsa.professions.Profession;
import de.banananetwork.dsa.species.Species;
import java.util.List;
public class Regulations {
List<Currency> currencies;
List<Aspect> aspects;
List<Profession> professions;
List<Species> species;
// TODO Zauber
// TODO Liturgen
// TODO Artefakte
// TODO Ausrüstung
// TODO Waffen
}

@ -0,0 +1,36 @@
package de.banananetwork.dsa.abilities;
import de.banananetwork.dsa.descriptions.Descriptiable;
import de.banananetwork.dsa.descriptions.Description;
import de.banananetwork.dsa.requirements.AdventurePointsPriceLabeled;
import de.banananetwork.dsa.requirements.HasRequirement;
import de.banananetwork.dsa.requirements.Requirement;
public class Ability implements Descriptiable, AdventurePointsPriceLabeled, HasRequirement {
private final Description description;
private final int apCosts;
private final Requirement requirement;
public Ability(Description description, int apCosts, Requirement requirement) {
this.description = description;
this.apCosts = apCosts;
this.requirement = requirement;
}
@Override
public Description getDescription() {
return description;
}
@Override
public int getRequiredAdventurePoints() {
return apCosts;
}
@Override
public Requirement getRequirement() {
return requirement;
}
}

@ -0,0 +1 @@
package de.banananetwork.dsa.abilities;

@ -0,0 +1,29 @@
package de.banananetwork.dsa.aspects;
import de.banananetwork.dsa.descriptions.Descriptiable;
import de.banananetwork.dsa.descriptions.Description;
import de.banananetwork.dsa.requirements.AdventurePointsPriceLabeled;
public class Aspect implements Descriptiable, AdventurePointsPriceLabeled {
private final Kind kind;
private final Description description;
private final int apCost;
private final Aspect opposite;
@Override
public Description getDescription() {
return description;
}
@Override
public int getRequiredAdventurePoints() {
return apCost;
}
public enum Kind {
ADVANTAGE, DISADVANTAGE
}
}

@ -0,0 +1,4 @@
/**
* Enthält alles, was mit Aspekten (gemeint sind die Vor- und Nachteile) von Charakteren zu tun hat.
*/
package de.banananetwork.dsa.aspects;

@ -0,0 +1,31 @@
package de.banananetwork.dsa.characters;
import de.banananetwork.dsa.Regulations;
import de.banananetwork.dsa.aspects.Aspect;
import de.banananetwork.dsa.cultures.Culture;
import de.banananetwork.dsa.professions.Profession;
import de.banananetwork.dsa.species.Species;
import java.util.List;
public class Character {
Regulations regulations;
String name;
Species species;
Culture culture;
Profession profession;
List<Aspect> modifications;
// TODO Skills
// TODO Zauber
// TODO Liturgen
// TODO Ausrüstung
// TODO Waffen
// Modifizierter, aktueller Wert
int money;
int maxAp;
}

@ -0,0 +1 @@
package de.banananetwork.dsa.characters;

@ -0,0 +1,5 @@
package de.banananetwork.dsa.cultures;
public class Culture {
}

@ -0,0 +1 @@
package de.banananetwork.dsa.cultures;

@ -0,0 +1,38 @@
package de.banananetwork.dsa.currencies;
public enum Currency {
// TODO Transfer from constant values to variable ones
// TODO Add some other currencies (https://de.wiki-aventurica.de/wiki/Aventurische_W%C3%A4hrungen)
MITTELREICH_KREUZER(1), // Base Value
MITTELREICH_NICKEL(2),
MITTELREICH_HELLER(10),
MITTELREICH_SILBERTALER(MITTELREICH_HELLER, 10),
MITTELREICH_DUKATEN(MITTELREICH_SILBERTALER, 10);
private final int multiplier;
Currency(int multiplier) {
this.multiplier = multiplier;
}
Currency(Currency reference, int multiplier) {
this.multiplier = reference.multiplier * multiplier;
}
public int transferTo(int baseValue) {
return baseValue / multiplier;
}
public double transferToExact(int baseValue) {
return (double) baseValue / multiplier;
}
public int transferFrom(int coinValue) {
return coinValue * multiplier;
}
public int getMultiplier() {
return multiplier;
}
}

@ -0,0 +1,37 @@
package de.banananetwork.dsa.currencies
import java.util.*
import kotlin.collections.ArrayList
class CurrencySet private constructor(private val currencies: Array<Currency>) {
fun transferToSet(baseValue: Int): Map<Currency, Int> {
var modBaseValue = baseValue
val values = EnumMap<Currency, Int>(Currency::class.java)
for (currency in currencies) {
val value = currency.transferTo(modBaseValue)
values[currency] = value
modBaseValue -= currency.transferFrom(value)
}
if (modBaseValue != 0)
throw RuntimeException() // TODO Change to ValueNotRepresentableException
return values
}
class Builder {
private val currencies = ArrayList<Currency>()
fun add(currency: Currency): Builder {
currencies.add(currency)
return this
}
fun create(): CurrencySet {
currencies.sortBy { it.multiplier }
return CurrencySet(currencies.toTypedArray())
}
}
}

@ -0,0 +1 @@
package de.banananetwork.dsa.currencies;

@ -0,0 +1,7 @@
package de.banananetwork.dsa.descriptions;
public interface Descriptiable {
Description getDescription();
}

@ -0,0 +1,23 @@
package de.banananetwork.dsa.descriptions;
public class Description {
public static final Description EMPTY = new Description(null, null);
private final String title;
private final String description;
public Description(String title, String description) {
this.title = title;
this.description = description;
}
public String getTitle() {
return title;
}
public String getDescription() {
return description;
}
}

@ -0,0 +1 @@
package de.banananetwork.dsa.descriptions;

@ -0,0 +1,5 @@
package de.banananetwork.dsa.professions;
public class Profession {
}

@ -0,0 +1 @@
package de.banananetwork.dsa.professions;

@ -0,0 +1,7 @@
package de.banananetwork.dsa.requirements;
public interface AdventurePointsPriceLabeled {
int getRequiredAdventurePoints();
}

@ -0,0 +1,8 @@
package de.banananetwork.dsa.requirements;
public class AspectRequirement implements Requirement {
@Override
public boolean checkCorrect() {
return false;
}
}

@ -0,0 +1,8 @@
package de.banananetwork.dsa.requirements;
public class CombatValueRequirement implements Requirement {
@Override
public boolean checkCorrect() {
return false;
}
}

@ -0,0 +1,13 @@
package de.banananetwork.dsa.requirements;
import java.util.Objects;
public interface HasRequirement { //TODO Rename
Requirement getRequirement();
default boolean hasRequirement() {
return !Objects.isNull(getRequirement());
}
}

@ -0,0 +1,8 @@
package de.banananetwork.dsa.requirements;
public class OptionalRequirements implements Requirement {
@Override
public boolean checkCorrect() {
return false;
}
}

@ -0,0 +1,8 @@
package de.banananetwork.dsa.requirements;
public class RequiredRequirement implements Requirement {
@Override
public boolean checkCorrect() {
return false;
}
}

@ -0,0 +1,5 @@
package de.banananetwork.dsa.requirements;
public interface Requirement {
boolean checkCorrect();
}

@ -0,0 +1,8 @@
package de.banananetwork.dsa.requirements;
public class StatRequirement implements Requirement {
@Override
public boolean checkCorrect() {
return false;
}
}

@ -0,0 +1,8 @@
package de.banananetwork.dsa.requirements;
public class TalentRequirement implements Requirement {
@Override
public boolean checkCorrect() {
return false;
}
}

@ -0,0 +1 @@
package de.banananetwork.dsa.requirements;

@ -0,0 +1,5 @@
package de.banananetwork.dsa.species;
public class Species {
}

@ -0,0 +1 @@
package de.banananetwork.dsa.species;
Loading…
Cancel
Save