Added Model.People package to Class Diagram authored by Kovács Gergely Zsolt's avatar Kovács Gergely Zsolt
...@@ -19,9 +19,56 @@ package Model.Common { ...@@ -19,9 +19,56 @@ package Model.Common {
} }
class Singleton { class Singleton {
- {static} instance : Singleton - {static} instance : T
- Singleton() - Singleton()
+ {static} GetInstance() : Singleton + {static} GetInstance() : T
}
Singleton <|-- Simulation
class Simulation {
- people : Person[]
- Simulation()
}
Simulation --> Park
Singleton <|-- Park
IInspectable <|-- Park
class Park {
- balance : int
- entryFee : int
- buildings : Building[]
- Park()
+ GetBalance() : int
+ GetEntryFee() : int
+ GetBuildings() : Building[]
+ ModifyBalance(int)
+ AddBuilding(Building)
+ SetEntryFee(int)
}
IDisplayable <|-- WorldEntity
class WorldEntity {
- position : Vector2
- visible : bool
# WorldEntity(Vector2)
+ GetPosition() : Vector2
+ GetVisible() : bool
+ SetPosition(Vector2)
+ SetVisible(bool)
}
Singleton <|-- MaintenanceDispatcher
Simulation ---> MaintenanceDispatcher
class MaintenanceDispatcher {
- maintainers : MaintenanceGuy[]
- MaintenanceDispatcher()
+ {static} GameBroken(Building)
} }
} }
...@@ -42,6 +89,7 @@ package Model.Nav { ...@@ -42,6 +89,7 @@ package Model.Nav {
} }
package Model.Map { package Model.Map {
WorldEntity <|-- MapObject
abstract class MapObject { abstract class MapObject {
+ Enter(Person) : Vector2? {abstract} + Enter(Person) : Vector2? {abstract}
...@@ -49,7 +97,7 @@ package Model.Map { ...@@ -49,7 +97,7 @@ package Model.Map {
} }
class Cell { class Cell {
} }
Cell "1" *-- MapObject Cell "1" *-- MapObject
Cell "{0,1}" *-- VertexHandle Cell "{0,1}" *-- VertexHandle
...@@ -64,7 +112,10 @@ package Model.Map { ...@@ -64,7 +112,10 @@ package Model.Map {
class Placement { class Placement {
+ Pos : Vector2 + Pos : Vector2
} }
Placement "1" *-- Orientation Placement "1" *-- Orientation
Simulation "1" *- Map
class Map { class Map {
+ Map(Vector2) + Map(Vector2)
...@@ -89,135 +140,85 @@ package Model.Map { ...@@ -89,135 +140,85 @@ package Model.Map {
} }
Singleton <|-- Simulation package Model.People {
Simulation *-- "-people\n*" Person
class Simulation { IInspectable <|--- Person
- people : Person[] ITickable <|--- Person
- Simulation() WorldEntity <|-- Person
}
class Person {
- destination : MapObject
Simulation --> Park - nextPosition : Vector2
Singleton <|-- Park - speed : float {readonly}
IInspectable <|-- Park - pavement : Pavement
- routeHandle : RouteHandle
class Park { - name : string
- balance : int # Person(Vector2, float)
- entryFee : int + Tick() {override}
- buildings : Building[] + GetProperties() {override}
- Park() + GetDestination()
+ GetBalance() : int + SetDestination(MapObject)
+ GetEntryFee() : int }
+ GetBuildings() : Building[]
+ ModifyBalance(int)
+ AddBuilding(Building)
+ SetEntryFee(int)
}
IDisplayable <|-- WorldEntity
class WorldEntity {
- position : Vector2
- visible : bool
# WorldEntity(Vector2)
+ GetPosition() : Vector2
+ GetVisible() : bool
+ SetPosition(Vector2)
+ SetVisible(bool)
}
Simulation *-- "-people\n*" Person
IInspectable <|--- Person
ITickable <|--- Person
WorldEntity <|-- Person
class Person {
- destination : MapObject
- nextPosition : Vector2
- speed : float {readonly}
- pavement : Pavement
- routeHandle : RouteHandle
# Person(Vector2, float)
+ Tick() {override}
+ GetProperties() {override}
+ GetDestination()
+ SetDestination(MapObject)
}
Person <|-- Visitor
class Visitor {
- mood : int
- satiety : int
- money : int
- inQueue : bool
+ Visitor(Vector2, float, int, int, int)
- ChooseDestination()
+ DeliverEffects(int, int, int)
+ GameEnded(Vector2)
+ Tick() {override}
+ GetProperties() {override}
+ ModifyMood(int)
+ ModifySatiety(int)
+ ModifyMoney(int)
+ SetInQueue(bool)
}
Person <|-- Staff
class Staff { Person <|-- Visitor
- idle : bool
# Staff(Vector2, float) class Visitor {
+ Tick() {override} - mood : int
+ GetProperties() {override} - satiety : int
+ IsIdle() : bool - money : int
+ SetDestination(MapObject) {override} - inQueue : bool
} + Visitor(Vector2, float, int, int, int)
- ChooseDestination()
+ DeliverEffects(int, int, int)
+ GameEnded(Vector2)
+ Tick() {override}
+ GetProperties() {override}
+ ModifyMood(int)
+ ModifySatiety(int)
+ ModifyMoney(int)
+ SetInQueue(bool)
}
Staff <|-- CleaningLady Person <|-- Staff
class CleaningLady { class Staff {
+ CleaningLady(Vector2, float) - idle : bool
+ Tick() {override} # Staff(Vector2, float)
+ GetProperties() {override} + Tick() {override}
} + GetProperties() {override}
+ IsIdle() : bool
+ SetDestination(MapObject) {override}
}
Staff <|-- MaintenanceGuy Staff <|-- CleaningLady
class MaintenanceGuy { class CleaningLady {
+ MaintenanceGuy(Vector2, float) + CleaningLady(Vector2, float)
+ Tick() {override} + Tick() {override}
+ GetProperties() {override} + GetProperties() {override}
} }
Singleton <|-- MaintenanceDispatcher Staff <|-- MaintenanceGuy
Simulation ---> MaintenanceDispatcher MaintenanceDispatcher *-- "-maintainers\n*" MaintenanceGuy
class MaintenanceDispatcher { class MaintenanceGuy {
- maintainers : MaintenanceGuy[] + MaintenanceGuy(Vector2, float)
- MaintenanceDispatcher() + Tick() {override}
+ {static} GameBroken(Building) + GetProperties() {override}
}
} }
MaintenanceDispatcher *-- "-maintainers\n*" MaintenanceGuy
Simulation "1" *- Map
WorldEntity <|-- MapObject
package Model.Landscape { package Model.Landscape {
package Blueprints { package Blueprints {
abstract class ObjectBlueprint { abstract class ObjectBlueprint {
+ Size: Vector2 + Size: Vector2
+ ConstructionCost : int + ConstructionCost : int
+ GetSize() : Vector2 {override} + GetSize() : Vector2 {override}
+ CanPlace(Map, Placement) : bool {override} + CanPlace(Map, Placement) : bool {override}
} }
...@@ -226,7 +227,7 @@ package Model.Landscape { ...@@ -226,7 +227,7 @@ package Model.Landscape {
abstract class BuildingBlueprint { abstract class BuildingBlueprint {
+ MaintenanceCost: int + MaintenanceCost: int
+ ConstructionTime: int + ConstructionTime: int
+ GetNavigableCells() : IEnumerable<NavigableCell> {override} + GetNavigableCells() : IEnumerable<NavigableCell> {override}
} }
BuildingBlueprint --|> ObjectBlueprint BuildingBlueprint --|> ObjectBlueprint
...@@ -249,7 +250,7 @@ package Model.Landscape { ...@@ -249,7 +250,7 @@ package Model.Landscape {
+ ConstructionCost: int + ConstructionCost: int
+ MinVisitorCountToStart: int + MinVisitorCountToStart: int
+ TimePerRound: int + TimePerRound: int
+ Place(Map, Placement) : MapObject {override} + Place(Map, Placement) : MapObject {override}
} }
VisitableBuildingBlueprint --|> BuildingBlueprint VisitableBuildingBlueprint --|> BuildingBlueprint
...@@ -279,7 +280,7 @@ package Model.Landscape { ...@@ -279,7 +280,7 @@ package Model.Landscape {
- MaintenanceCostPerVisitor: int - MaintenanceCostPerVisitor: int
- MinVisitorCountToStart: int - MinVisitorCountToStart: int
- TimePerRound: int - TimePerRound: int
+ Enter(Person) : Vector2? {override} + Enter(Person) : Vector2? {override}
+ Exit(Person) {override} + Exit(Person) {override}
} }
...@@ -290,7 +291,7 @@ package Model.Landscape { ...@@ -290,7 +291,7 @@ package Model.Landscape {
- garbageCount : int - garbageCount : int
- hasGarbageCan : bool - hasGarbageCan : bool
+ GetGarbage() : int + GetGarbage() : int
+ Enter(Person) : Vector2? {override} + Enter(Person) : Vector2? {override}
+ Exit(Person) {override} + Exit(Person) {override}
} }
... ...
......