Compare commits

...

33 Commits

Author SHA1 Message Date
  jim 1b2c1ae038 Merge branch 'master' into jimFirstDesign 2 years ago
  jim f7ab517d04 Removed Custom Code Style 2 years ago
  jim 90b5290192 Ability has now a constructor 2 years ago
  Felix Stupp 1d230f0872 Added class Ability 2 years ago
  Felix Stupp 1ba0ffb763 Fixed Rename of Aspects in Regulations 2 years ago
  Felix Stupp 7ee325d760 Added Interface HasRequirement 2 years ago
  jim 13a6f32cea Requirement add classes 2 years ago
  jim 78572930d3 skills into abilities 2 years ago
  jim 18b29010fb Aspect: add opposite 2 years ago
  jim 3465f1852b requriments dellete and new 2 years ago
  Felix Stupp 5a0d937158 Removed usless commit by jimknopf 2 years ago
  jim 86d8e33fb3 usless commentar 2 years ago
  Felix Stupp e17861d9a6 Defined default code style for IntelliJ 2 years ago
  Felix Stupp eb7a3a50bb Fixed imports for Aspect 2 years ago
  Felix Stupp cddde8f42b Reworked Requirements (WIP) 2 years ago
  Felix Stupp 3bf0b0c5f9 Added empty description 2 years ago
  Felix Stupp d3d614c940 Moved classes for descriptions to certain package 2 years ago
  Felix Stupp 0899364a6e Fixed name of package de.banananetwork.dsa.requirements 2 years ago
  Felix Stupp a7ff66428a Added AP Costs to Aspect 2 years ago
  Felix Stupp 13afcc067d Fixed package of Aspect 2 years ago
  Felix Stupp d1d3f331fd Introduced RequirementSet 2 years ago
  Felix Stupp f4c8cf1181 Fixed: Fully renamed class Modification to Aspect 2 years ago
  Felix Stupp 046818619f Renamed Modification to Aspect 2 years ago
  Felix Stupp 03d85f470b Added comment for money to Character 2 years ago
  Felix Stupp c8870ac1bf Added MaxAP to Character 2 years ago
  Felix Stupp 5c8d21a152 Added package-info to de.banananetwork.dsa.skills 2 years ago
  Felix Stupp 6438935f36 Converted CurrencySet from Java to Kotlin 2 years ago
  Felix Stupp 2973716c78 Implemented CurrencySet 2 years ago
  Felix Stupp 764d8dcd74 Added getMultiplier to Currency 2 years ago
  Felix Stupp c5be34bab5 Updated base structure 2 years ago
  Felix Stupp 9273ffd554 Renamed CoinType to Currency 2 years ago
  Felix Stupp c7df84d90d Introduced first package structure 2 years ago
  Felix Stupp 6c4fef6cc1 Introduced CoinType for transfer between different currencies 2 years ago
29 changed files with 323 additions and 0 deletions
Split View
  1. +22
    -0
      src/de/banananetwork/dsa/Regulations.java
  2. +36
    -0
      src/de/banananetwork/dsa/abilities/Ability.java
  3. +1
    -0
      src/de/banananetwork/dsa/abilities/package-info.java
  4. +29
    -0
      src/de/banananetwork/dsa/aspects/Aspect.java
  5. +4
    -0
      src/de/banananetwork/dsa/aspects/package-info.java
  6. +31
    -0
      src/de/banananetwork/dsa/characters/Character.java
  7. +1
    -0
      src/de/banananetwork/dsa/characters/package-info.java
  8. +5
    -0
      src/de/banananetwork/dsa/cultures/Culture.java
  9. +1
    -0
      src/de/banananetwork/dsa/cultures/package-info.java
  10. +38
    -0
      src/de/banananetwork/dsa/currencies/Currency.java
  11. +37
    -0
      src/de/banananetwork/dsa/currencies/CurrencySet.kt
  12. +1
    -0
      src/de/banananetwork/dsa/currencies/package-info.java
  13. +7
    -0
      src/de/banananetwork/dsa/descriptions/Descriptiable.java
  14. +23
    -0
      src/de/banananetwork/dsa/descriptions/Description.java
  15. +1
    -0
      src/de/banananetwork/dsa/descriptions/package-info.java
  16. +5
    -0
      src/de/banananetwork/dsa/professions/Profession.java
  17. +1
    -0
      src/de/banananetwork/dsa/professions/package-info.java
  18. +7
    -0
      src/de/banananetwork/dsa/requirements/AdventurePointsPriceLabeled.java
  19. +8
    -0
      src/de/banananetwork/dsa/requirements/AspectRequirement.java
  20. +8
    -0
      src/de/banananetwork/dsa/requirements/CombatValueRequirement.java
  21. +13
    -0
      src/de/banananetwork/dsa/requirements/HasRequirement.java
  22. +8
    -0
      src/de/banananetwork/dsa/requirements/OptionalRequirements.java
  23. +8
    -0
      src/de/banananetwork/dsa/requirements/RequiredRequirement.java
  24. +5
    -0
      src/de/banananetwork/dsa/requirements/Requirement.java
  25. +8
    -0
      src/de/banananetwork/dsa/requirements/StatRequirement.java
  26. +8
    -0
      src/de/banananetwork/dsa/requirements/TalentRequirement.java
  27. +1
    -0
      src/de/banananetwork/dsa/requirements/package-info.java
  28. +5
    -0
      src/de/banananetwork/dsa/species/Species.java
  29. +1
    -0
      src/de/banananetwork/dsa/species/package-info.java

+ 22
- 0
src/de/banananetwork/dsa/Regulations.java View File

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

}

+ 36
- 0
src/de/banananetwork/dsa/abilities/Ability.java View File

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

+ 1
- 0
src/de/banananetwork/dsa/abilities/package-info.java View File

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

+ 29
- 0
src/de/banananetwork/dsa/aspects/Aspect.java View File

@@ -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
- 0
src/de/banananetwork/dsa/aspects/package-info.java View File

@@ -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
- 0
src/de/banananetwork/dsa/characters/Character.java View File

@@ -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
- 0
src/de/banananetwork/dsa/characters/package-info.java View File

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

+ 5
- 0
src/de/banananetwork/dsa/cultures/Culture.java View File

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

public class Culture {

}

+ 1
- 0
src/de/banananetwork/dsa/cultures/package-info.java View File

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

+ 38
- 0
src/de/banananetwork/dsa/currencies/Currency.java View File

@@ -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
- 0
src/de/banananetwork/dsa/currencies/CurrencySet.kt View File

@@ -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
- 0
src/de/banananetwork/dsa/currencies/package-info.java View File

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

+ 7
- 0
src/de/banananetwork/dsa/descriptions/Descriptiable.java View File

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

public interface Descriptiable {

Description getDescription();

}

+ 23
- 0
src/de/banananetwork/dsa/descriptions/Description.java View File

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

}

+ 1
- 0
src/de/banananetwork/dsa/descriptions/package-info.java View File

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

+ 5
- 0
src/de/banananetwork/dsa/professions/Profession.java View File

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

public class Profession {

}

+ 1
- 0
src/de/banananetwork/dsa/professions/package-info.java View File

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

+ 7
- 0
src/de/banananetwork/dsa/requirements/AdventurePointsPriceLabeled.java View File

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

public interface AdventurePointsPriceLabeled {

int getRequiredAdventurePoints();

}

+ 8
- 0
src/de/banananetwork/dsa/requirements/AspectRequirement.java View File

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

public class AspectRequirement implements Requirement {
@Override
public boolean checkCorrect() {
return false;
}
}

+ 8
- 0
src/de/banananetwork/dsa/requirements/CombatValueRequirement.java View File

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

public class CombatValueRequirement implements Requirement {
@Override
public boolean checkCorrect() {
return false;
}
}

+ 13
- 0
src/de/banananetwork/dsa/requirements/HasRequirement.java View File

@@ -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
- 0
src/de/banananetwork/dsa/requirements/OptionalRequirements.java View File

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

public class OptionalRequirements implements Requirement {
@Override
public boolean checkCorrect() {
return false;
}
}

+ 8
- 0
src/de/banananetwork/dsa/requirements/RequiredRequirement.java View File

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

public class RequiredRequirement implements Requirement {
@Override
public boolean checkCorrect() {
return false;
}
}

+ 5
- 0
src/de/banananetwork/dsa/requirements/Requirement.java View File

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

public interface Requirement {
boolean checkCorrect();
}

+ 8
- 0
src/de/banananetwork/dsa/requirements/StatRequirement.java View File

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

public class StatRequirement implements Requirement {
@Override
public boolean checkCorrect() {
return false;
}
}

+ 8
- 0
src/de/banananetwork/dsa/requirements/TalentRequirement.java View File

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

public class TalentRequirement implements Requirement {
@Override
public boolean checkCorrect() {
return false;
}
}

+ 1
- 0
src/de/banananetwork/dsa/requirements/package-info.java View File

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

+ 5
- 0
src/de/banananetwork/dsa/species/Species.java View File

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

public class Species {

}

+ 1
- 0
src/de/banananetwork/dsa/species/package-info.java View File

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

Loading…
Cancel
Save