Changes
Page history
Update Class Diagram
authored
Feb 28, 2021
by
Pőcze Barnabás
Show whitespace changes
Inline
Side-by-side
Class-Diagram.md
View page @
c08a73ac
**Model**
**Model**
```
plantuml
```
plantuml
@startuml
Model
@startuml
skinparam classAttributeIconSize 0
skinparam classAttributeIconSize 0
package Model.Common {
package Model.Common {
...
@@ -24,6 +24,69 @@ package Model.Common {
...
@@ -24,6 +24,69 @@ package Model.Common {
}
}
}
}
package Model.Nav {
class NavigationGraph {
+ AddVertex() : VertexHandle
+ AddEdge(VertexHandle, VertexHandle)
+ PlanRoute(VertexHandle, VertexHandle) : RouteHandle
}
class VertexHandle {
}
class RouteHandle {
}
}
package Model.Map {
abstract class MapObject {
+ Enter(Person) : Vector2? {abstract}
+ Exit(Person) {abstract}
}
class Cell {
}
Cell "1" *-- MapObject
Cell "{0,1}" *-- VertexHandle
enum Orientation {
NORTH
EAST
SOUTH
WEST
}
class Placement {
+ Pos : Vector2
}
Placement "1" *-- Orientation
class Map {
+ Map(Vector2)
+ CanBuild(IMapObjectBlueprint) : bool
+ Build(IMapObjectBlueprint)
}
Map "*" *-- Cell
Map "1" *-- NavigationGraph
class NavigableCell {
+ Pos : Vector2
+ OpenDirections: IEnumerable<Orientation>
}
interface IMapObjectBlueprint {
+ GetSize() : Vector2
+ GetNavigableCells() : IEnumerable<NavigableCell>
+ CanPlace(Map, Placement) : bool
+ Place(Map, Placement) : MapObject
}
}
Singleton <|-- Simulation
Singleton <|-- Simulation
...
@@ -143,6 +206,85 @@ class MaintenanceDispatcher {
...
@@ -143,6 +206,85 @@ class MaintenanceDispatcher {
MaintenanceDispatcher *-- "-maintainers\n*" MaintenanceGuy
MaintenanceDispatcher *-- "-maintainers\n*" MaintenanceGuy
Simulation "1" *- Map
WorldEntity <|-- MapObject
package Model.Landscape {
package Blueprints {
abstract class ObjectBlueprint {
+ Size: Vector2
+ ConstructionCost : int
+ GetSize() : Vector2 {override}
+ CanPlace(Map, Placement) : bool {override}
}
ObjectBlueprint --|> IMapObjectBlueprint
abstract class BuildingBlueprint {
+ MaintenanceCost: int
+ ConstructionTime: int
+ GetNavigableCells() : IEnumerable<NavigableCell> {override}
}
BuildingBlueprint --|> ObjectBlueprint
class PavementBlueprint {
+ Place(Map, Placement) : MapObject {override}
}
PavementBlueprint --|> ObjectBlueprint
class StaffBuildingBlueprint {
+ Place(Map, Placement) : MapObject {override}
}
StaffBuildingBlueprint --|> BuildingBlueprint
class VisitableBuildingBlueprint {
+ Capacity: int
+ EntryFee: int
+ MaintenanceCostPerVisitor: int
+ ConstructionTime: int
+ ConstructionCost: int
+ MinVisitorCountToStart: int
+ TimePerRound: int
+ Place(Map, Placement) : MapObject {override}
}
VisitableBuildingBlueprint --|> BuildingBlueprint
}
enum BuildingState {
WORKING
WAITING
UNDER_CONSTRUCTION
}
abstract class Building {
- Blueprint: BuildingBlueprint
}
Building --|> MapObject
Building --|> ITickable
Building "1" *-- BuildingState
class StaffBuilding {
}
StaffBuilding --|> Building
class VisitableBuilding {
- Capacity: int
- EntryFee: int
- MaintenanceCostPerVisitor: int
- MinVisitorCountToStart: int
- TimePerRound: int
+ Enter(Person) : Vector2? {override}
+ Exit(Person) {override}
}
VisitableBuilding --|> Building
class Pavement {
class Pavement {
- garbageCount : int
- garbageCount : int
- hasGarbageCan : bool
- hasGarbageCan : bool
...
@@ -151,6 +293,7 @@ class Pavement {
...
@@ -151,6 +293,7 @@ class Pavement {
+ Enter(Person) : Vector2? {override}
+ Enter(Person) : Vector2? {override}
+ Exit(Person) {override}
+ Exit(Person) {override}
}
}
Pavement --|> MapObject
class QueuePavement {
class QueuePavement {
- IsAllowedToLeave(Person) : bool
- IsAllowedToLeave(Person) : bool
...
@@ -158,22 +301,9 @@ class QueuePavement {
...
@@ -158,22 +301,9 @@ class QueuePavement {
+ Enter(Person) : Vector2? {override}
+ Enter(Person) : Vector2? {override}
+ Exit(Person) {override}
+ Exit(Person) {override}
}
}
QueuePavement --|> Pavement
Simulation "1" *- Map
WorldEntity <|-- MapObject
abstract class MapObject {
+ Enter(Person) : Vector2? {abstract}
+ Exit(Person) {abstract}
}
}
MapObject <|-- Building
MapObject <|-- Pavement
Building <|-- Entrance
Building <|-- StaffBuilding
Pavement <|-- QueuePavement
Map "*" *-- MapObject
Map "1" *-- NavigationGraph
@enduml
@enduml
```
```
...
...
...
...