Compare commits

...

38 Commits

Author SHA1 Message Date
Felix Stupp f81fecc3f5 Added first structure documentation in german 3 years ago
Felix Stupp 808f4da553 Fixed method "checkCorrect" of Interface Requirement 3 years ago
Felix Stupp fde26235d2 Merge branch 'master' into zockerFirstDesign 3 years ago
Felix Stupp 86bed613fa Added interface for serializing (WIP; maybe removed later) 3 years ago
Felix Stupp 2520078473 Description: Added empty "toJSON" method 3 years ago
Felix Stupp 4aa655a13f Added Line Separator Configuration to Code Style 3 years ago
Felix Stupp 3f2b94c2cf Configured CodeStyle for IntelliJ 3 years ago
Felix Stupp 26e1bba46f Added constructor to Ability 3 years ago
Felix Stupp 1d230f0872 Added class Ability 3 years ago
Felix Stupp 1ba0ffb763 Fixed Rename of Aspects in Regulations 3 years ago
Felix Stupp 7ee325d760 Added Interface HasRequirement 3 years ago
jim 13a6f32cea Requirement add classes 3 years ago
jim 78572930d3 skills into abilities 3 years ago
jim 18b29010fb Aspect: add opposite 3 years ago
jim 3465f1852b requriments dellete and new 3 years ago
Felix Stupp 5a0d937158 Removed usless commit by jimknopf 3 years ago
jim 86d8e33fb3 usless commentar 3 years ago
Felix Stupp e17861d9a6 Defined default code style for IntelliJ 3 years ago
Felix Stupp eb7a3a50bb Fixed imports for Aspect 3 years ago
Felix Stupp cddde8f42b Reworked Requirements (WIP) 3 years ago
Felix Stupp 3bf0b0c5f9 Added empty description 3 years ago
Felix Stupp d3d614c940 Moved classes for descriptions to certain package 3 years ago
Felix Stupp 0899364a6e Fixed name of package de.banananetwork.dsa.requirements 3 years ago
Felix Stupp a7ff66428a Added AP Costs to Aspect 3 years ago
Felix Stupp 13afcc067d Fixed package of Aspect 3 years ago
Felix Stupp d1d3f331fd Introduced RequirementSet 3 years ago
Felix Stupp f4c8cf1181 Fixed: Fully renamed class Modification to Aspect 3 years ago
Felix Stupp 046818619f Renamed Modification to Aspect 3 years ago
Felix Stupp 03d85f470b Added comment for money to Character 3 years ago
Felix Stupp c8870ac1bf Added MaxAP to Character 3 years ago
Felix Stupp 5c8d21a152 Added package-info to de.banananetwork.dsa.skills 3 years ago
Felix Stupp 6438935f36 Converted CurrencySet from Java to Kotlin 3 years ago
Felix Stupp 2973716c78 Implemented CurrencySet 3 years ago
Felix Stupp 764d8dcd74 Added getMultiplier to Currency 3 years ago
Felix Stupp c5be34bab5 Updated base structure 3 years ago
Felix Stupp 9273ffd554 Renamed CoinType to Currency 3 years ago
Felix Stupp c7df84d90d Introduced first package structure 3 years ago
Felix Stupp 6c4fef6cc1 Introduced CoinType for transfer between different currencies 3 years ago
  1. 179
      Struktur.de.txt
  2. 22
      src/de/banananetwork/dsa/Regulations.java
  3. 35
      src/de/banananetwork/dsa/abilities/Ability.java
  4. 1
      src/de/banananetwork/dsa/abilities/package-info.java
  5. 29
      src/de/banananetwork/dsa/aspects/Aspect.java
  6. 4
      src/de/banananetwork/dsa/aspects/package-info.java
  7. 31
      src/de/banananetwork/dsa/characters/Character.java
  8. 1
      src/de/banananetwork/dsa/characters/package-info.java
  9. 5
      src/de/banananetwork/dsa/cultures/Culture.java
  10. 1
      src/de/banananetwork/dsa/cultures/package-info.java
  11. 38
      src/de/banananetwork/dsa/currencies/Currency.java
  12. 37
      src/de/banananetwork/dsa/currencies/CurrencySet.kt
  13. 1
      src/de/banananetwork/dsa/currencies/package-info.java
  14. 7
      src/de/banananetwork/dsa/descriptions/Descriptiable.java
  15. 27
      src/de/banananetwork/dsa/descriptions/Description.java
  16. 1
      src/de/banananetwork/dsa/descriptions/package-info.java
  17. 5
      src/de/banananetwork/dsa/professions/Profession.java
  18. 1
      src/de/banananetwork/dsa/professions/package-info.java
  19. 7
      src/de/banananetwork/dsa/requirements/AdventurePointsPriceLabeled.java
  20. 8
      src/de/banananetwork/dsa/requirements/AspectRequirement.java
  21. 8
      src/de/banananetwork/dsa/requirements/CombatValueRequirement.java
  22. 13
      src/de/banananetwork/dsa/requirements/HasRequirement.java
  23. 8
      src/de/banananetwork/dsa/requirements/OptionalRequirements.java
  24. 8
      src/de/banananetwork/dsa/requirements/RequiredRequirement.java
  25. 5
      src/de/banananetwork/dsa/requirements/Requirement.java
  26. 8
      src/de/banananetwork/dsa/requirements/StatRequirement.java
  27. 8
      src/de/banananetwork/dsa/requirements/TalentRequirement.java
  28. 1
      src/de/banananetwork/dsa/requirements/package-info.java
  29. 5
      src/de/banananetwork/dsa/species/Species.java
  30. 1
      src/de/banananetwork/dsa/species/package-info.java
  31. 7
      src/de/banananetwork/serialize/Serializable.java
  32. 59
      src/de/banananetwork/serialize/SerializedData.java

179
Struktur.de.txt

@ -0,0 +1,179 @@
// Name und Beschreibung als Oberklasse/Interface herausziehen
// TODO AP Kosten
// TODO Custom Vor-/Nachteile (Angst vor ...)
// TODO Profession Sortierung
// TODO Kristina Regelwerk Profession Talent AP Berechnung
// TODO Zauber Spezialfertigkeit
---
Sonderfertigkeiten
- Allgemein
- Schicksalspunkte
- Kampf
- Magische
- Karmale
---
Regelwerk:
- Name
- Erscheinungsdatum
- Erfahrungsgrad //TODO Klasse
- Maximum Eigenschaft
- Maximum Fertigkeit
- Maximum Kampftechnik
- Maximum Eigenschaftspunkte
- Maximum Zahl Zauber / Liturgien
- davon maximal Fremdzauber (bezogen auf )
- Sonstiges:
- Vor-/Nachteile Begrenzung (AP, getrennt)
- Talentwert Obergrenze (bei uns 10)
- Kampftechnik Basiswert
- Liste Sozialstatus
- Liste Eigenschaften
- Liste Basiswerte (abgeleitet)
- Liste Zusatzwerte (bspw. Schicksalspunkte)
- Liste aller Spezies
- Liste aller Kulturen
- Liste aller Professionen
- Liste aller Vor- / Nachteile
- Liste aller Sonderfertigkeitsarten
- Liste aller Sonderfertigkeiten
- Liste aller Ausrüstungsgegenstände
- Liste aller Talentkategorien
- Liste aller Talente
- Liste aller Kampftechniken
---
Charakter:
- Name des Charakters
- Abenteuerpunkte gesamt
//TODO Andere Eigenschaften ergänzen
- Sozialstatus
- Spezies
- Kultur
- Profession
- Werte der Eigenschaften
- Liste von Vor-/Nachteilen (Zusatzobjekt mit Stufe, kann ignoriert werden beim Speichern, dann Objectreferenz direkt)
- Liste von Sonderfertigkeiten (siehe Stufensystem)
- Liste von Kampfsonderfertigkeiten (siehe Stufensystem)
- Liste der Talentwerte (Zusatzobjekt mit Anzahl und Referenz)
- Liste von Ausrüstungsgegenstände (Zusatzobjekt mit Anzahl und Referenz)
---
Anforderung ist jeweils spezialisiert für Vor-/Nachteil, Sonderfertigkeiten.
---
Effekt ist jeweils spezialisiert für was es effektiert.
NoneEffekt:
EigenschaftEffekt:
EigenschaftGrenzeEffekt: //TODO kompliziert
BasiswertEffekt:
TelentEffekt:
- spezifisch / nicht spezifisch
TalentObergrenzeEffekt:
KampftechnikEffekt:
ZusatzwertEffekt:
//TODO ...
---
Spezies:
- Name (ID)
- Effekte (Objects)
- Übliche Kulturen (Referenz)
// Enum: untypisch, typisch, empfohlen, dringend erforderlich (oder Int-Level)
- Zwingende Vor-/Nachteile
- Übliche Vor-/Nachteile (Referenz) (Wichtigkeit von 2 bis -2)
- Augen und Haarfarbe (auf Würfel aufgeteilt)
- Größe und Gewicht (Grundwert + Würfel)
- Gewicht (Größe + Grundwert + Würfel (speziell pro Würfelwert, +/-))
---
Kulturen: // Keine AP-Kosten an sich
- Name (ID)
- Effekte (Objects)
- Automatische Sonderfertigkeiten (Sprache/Schrift) (Kosten werden zusätzlich berechnet)
- Sozialstatus
- Übliche Professionen
- Bewertete Vor-/Nachteile (siehe Spezies)
- Bewertete Talente
- Namensvorschläge
- Kulturpaket (Set an Talentwertminima, optional)
---
Profession:
- Name (ID)
- Oberprofession (Referenz)
- Sprach/Schrift AP Maximum
- Automatische Talente (Effekt)
---
Vor- und Nachteil:
- Name (ID)
- Beschreibung
- Maximale Stufe (> 0, meist 1)
- Liste der Anforderungen (sub object)
- Effekt(e)
---
// Vergleiche mit Vor- und Nachteile
Sonderfertigkeit:
- Name (ID)
- Sonderfertigkeitsart
---
Zauber:
- Name (ID)
- Beschreibung
- Würfelschema
---
// Later
Liturgie:
---
// Later
Rituale:
---
Talent:
- Name (ID)
- Kategorie
- Würfelschema
---
Ausrüstungsgegenstand:
- Name (ID)

22
src/de/banananetwork/dsa/Regulations.java

@ -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
}

35
src/de/banananetwork/dsa/abilities/Ability.java

@ -0,0 +1,35 @@
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;
}
}

1
src/de/banananetwork/dsa/abilities/package-info.java

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

29
src/de/banananetwork/dsa/aspects/Aspect.java

@ -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
}
}

4
src/de/banananetwork/dsa/aspects/package-info.java

@ -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;

31
src/de/banananetwork/dsa/characters/Character.java

@ -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;
}

1
src/de/banananetwork/dsa/characters/package-info.java

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

5
src/de/banananetwork/dsa/cultures/Culture.java

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

1
src/de/banananetwork/dsa/cultures/package-info.java

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

38
src/de/banananetwork/dsa/currencies/Currency.java

@ -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;
}
}

37
src/de/banananetwork/dsa/currencies/CurrencySet.kt

@ -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())
}
}
}

1
src/de/banananetwork/dsa/currencies/package-info.java

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

7
src/de/banananetwork/dsa/descriptions/Descriptiable.java

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

27
src/de/banananetwork/dsa/descriptions/Description.java

@ -0,0 +1,27 @@
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;
}
public String toJSON() {
}
}

1
src/de/banananetwork/dsa/descriptions/package-info.java

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

5
src/de/banananetwork/dsa/professions/Profession.java

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

1
src/de/banananetwork/dsa/professions/package-info.java

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

7
src/de/banananetwork/dsa/requirements/AdventurePointsPriceLabeled.java

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

8
src/de/banananetwork/dsa/requirements/AspectRequirement.java

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

8
src/de/banananetwork/dsa/requirements/CombatValueRequirement.java

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

13
src/de/banananetwork/dsa/requirements/HasRequirement.java

@ -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());
}
}

8
src/de/banananetwork/dsa/requirements/OptionalRequirements.java

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

8
src/de/banananetwork/dsa/requirements/RequiredRequirement.java

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

5
src/de/banananetwork/dsa/requirements/Requirement.java

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

8
src/de/banananetwork/dsa/requirements/StatRequirement.java

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

8
src/de/banananetwork/dsa/requirements/TalentRequirement.java

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

1
src/de/banananetwork/dsa/requirements/package-info.java

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

5
src/de/banananetwork/dsa/species/Species.java

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

1
src/de/banananetwork/dsa/species/package-info.java

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

7
src/de/banananetwork/serialize/Serializable.java

@ -0,0 +1,7 @@
package de.banananetwork.serialize;
public interface Serializable {
SerializedData serialize();
}

59
src/de/banananetwork/serialize/SerializedData.java

@ -0,0 +1,59 @@
package de.banananetwork.serialize;
public interface SerializedData implements Serializable {
@Override
default SerializedData serialize() {
return this;
}
void put(String key, int value);
void put(String key, String value);
default void put(String key, Serializable value) {
put(key, value.serialize());
}
void put(String key, SerializedData value);
void put(String key, int[] values);
void put(String key, String[] values);
default put(String key, Serializable[] values) {
put(key, Arrays.stream(values).map(Serializable::serialize).toArray(SerializedData[]::new));
}
void put(String key, SerializedData[] values);
boolean exists(String key);
Type getType(String key);
boolean isType(String key, Type type);
String[] getKeys();
int getInt(String key);
String getString(String key);
SerializedData getData(String key);
int[] getIntArray(String key);
String[] getStringArray(String key);
SerializedData[] getDataArray(String key);
public enum Type {
INT,
INT_ARRAY,
STRING,
STRING_ARRAY,
SERIALIZED_DATA,
SERIALIZED_DATA_ARRAY;
}
}
Loading…
Cancel
Save