#+TITLE: Model

** Definition Class Diagram
#+BEGIN_SRC plantuml :file example.svg

class User {
  -String id
  -String name
  +String name()
}
User <|-- SpecificUser

#+END_SRC

#+RESULTS:
[[file:example.svg]]

** Definition Raumschiff
#+BEGIN_SRC plantuml :file ERDiagram.png
title ER Diagram des Datenmdodels
left to right direction
skinparam shadowing false

enum Role

class SpaceShip {
  - int money
  - int energie
  - int health
  - String id
  - String name
}


class Reactor {
  - String id
  - String Type
  - int availibePower
  - int speed
}


class Shop {
  - int priceEnergie
  - Map<Weapon, int> weapons
  - Map<Crew, int> crew
  - Map<Shield, int> shiels
  - Map<Reactor, int> reactors
}

class Shield {
   - String id
   - int strength
}

interface Section {
  - bool working
  - String id
  - String name
  - float oxygen
  - coordinates(float x, float y, float z)
  - int powerRequired
  - List<Enum> role
}

class medBay
class Bridge
class Teleporter


class Weapon {
  - int requiredEnergie
  - String id
  - String name
  - int shieldDammage
  - int fleshDammage
  - int hullDammage
}

class Laser
class Missile
class Bomb
class Ion
class Beam


class Crew {
  - String name
  - int health
  - int stammina
  - Role role

}


interface Player {
   - String username
   - String id
   - Coordinates (float x, float y, float z)
}

class AI

class Human {
   - String username
   - String password
}

class Universe {
   - String id
   - String name
}

class Galaxy {
   - String id
   - String name
}

class System {
   - String id
   - String name
}

class Planet {
   - float temp
   - float oxygen
}

interface Stop {
   - String id
   - String name
   - Coordinates ort
}

class Task {
  - String name
}


Universe }o-- Galaxy: has
Galaxy }o-- System: has
System }o-left- Stop: has

Stop <|.. Planet
Stop <|.. Shop

Shop }o-- Task

SpaceShip }o-- Stop : is at

Player }|-left- SpaceShip: pilots
Player <|.. AI
Player <|.. Human

SpaceShip }|-- Section: made of
SpaceShip ||-- Reactor: requires
SpaceShip }o-- Shield: deffend with
SpaceShip }o-- Weapon: attacks with


Section }o-- medBay: provides healing
Section }o-- Bridge
Section }o-- Teleporter: manipulate Spacetime

Crew }o-- Section: is in

Weapon <|.. Laser
Weapon <|.. Missile
Weapon <|.. Bomb
Weapon <|.. Ion
Weapon <|.. Beam
#+END_SRC

#+RESULTS:
[[file:ERDiagram.png]]


* Class Diagramm

#+BEGIN_SRC plantuml :file classDiagram.png
class SpaceShip {
  - String id
  - String name
  - JSONString attack(Weapon w, Spaceship s, Section t)
}

class Core {
  - int powerRequired
  - String id
  - increaseLoad()
  - boolean reduceLoad()
}

class Reactor {
  - String id
  - String Type
  - int generatedPower
  - int speed
  - boolean boost(float percent)
}


class FTLDrive {
  - Int Speed
  - void Engage(System s)
}


class Shield {
   - String id
   - int strength
}

class Section {
  - String id
  - String name
  - List<Thruster> thrusters
  - List<Weapon> weapons
  - Shield shield
  - int hullIntegrity
  - float oxygeb
}

class medBay {
  - void heal(int hp)
}
class Bridge
class Teleporter

class Thrusters {
  - String id
  - int speed
  - float spaceEfficeny
  - float orbitEfficency
}

class Weapon {
  - String id
  - String name
  - int shieldDammage
  - int fleshDammage
  - int hullDammage
}

class Laser
class Missile
class Bomb
class Ion
class Beam


class Crew {
  - String name
  - int health
  - int stammina
  - int money
  - Coordinates move(float x, float, y, float z)
  - String chat(String query)
}



interface Player {
   - String username
   - String id
   - JSONString commandShip(PUT state)
}

class AI

class Human

class Universe {
   - String id
   - String name
}

class Galaxy {
   - String id
   - String name
}

class System {
   - String id
   - String name
}

class Planet {
   - String name
   - String id
   - float temp
   - float oxygen
}


Universe }o-- Galaxy: has
Galaxy }o-- System: has
System }o-- Planet: has
SpaceShip ||-right- Planet : home port

Player }|-- SpaceShip: pilots
Player <|.up. AI
Player <|.up. Human

SpaceShip }|-- Subsystems: affected by
SpaceShip }|-- Section: made of
SpaceShip ||-- Core: requires

Core }|-- Thrusters: move in systems
Core }o-- FTLDrive: move between systems
Core ||-- Reactor: powered by

Section }o-- Weapon: attacks with
Section }o-- Shield: deffend with
Section }o-- medBay: provides healing
Section }o-- Bridge
Section }o-- Teleporter: manipulate Spacetime

Crew }o-- Section: is in

Weapon <|.. Laser
Weapon <|.. Missile
Weapon <|.. Bomb
Weapon <|.. Ion
Weapon <|.. Beam

#+END_SRC

#+RESULTS:
[[file:classDiagram.png]]


file raumschiff.png
hip {
d
ame



rRequired
d
Load()
reduceLoad()


r {
d
ype
ratedPower
d
boost(float percent)



ve {
d
age(System s)



tems {
d
ame
ax
urrent


 {
id
ength


n {
d
ame
uster> thrusters
pon> weapons
hield
Integrity
ygeb


 {
l(int hp)


rter

ers {
d
d
aceEfficeny
bitEfficency


 {
d
ame
ldDammage
hDammage
Dammage



e






ame
th
mina
y
tes move(float x, float, y, float z)
hat(String query)




ayer {
username
id
ing commandShip(PUT state)






se {
id
name


 {
id
name


 {
id
name


 {
name
id
emp
xygen



- Galaxy: has
System: has
Docks: has
-right- Planet : home port

anet
ck


SpaceShip: pilots
. AI
. Human

-- Subsystems: affected by
-- Section: made of
-- Core: requires

rusters: move in systems
LDrive: move between systems
actor: powered by

 Weapon: attacks with
 Shield: deffend with
 medBay: provides healing
 Bridge
 Teleporter: manipulate Spacetime

ction: is in

Laser
Missile
Bomb
Ion
Beam




chiff.png]]
