Compare commits
33 Commits
master
...
jimFirstDe
@ -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…
Reference in New Issue