Changes
Page history
Update some of the class diagram
authored
Apr 20, 2021
by
kgerg2
Show whitespace changes
Inline
Side-by-side
Class-Diagram.md
View page @
1130d8a5
...
...
@@ -8,23 +8,37 @@ header
Do not use in production.
endheader
package Model.
Comm
on {
abstract class
Action
{
package Model.
Inspecti
on {
abstract class
Command
{
+ GetName() : string
+ Act(object...) : object {abstract}
+ CanExecute() : bool
+ Execute(object...) : object
+ GetSignature() : ActionSignature {abstract}
}
class
Action
Signature {
+ Args: I
Enumerable
<Type>
class
Command.
Signature {
+ Args: I
Collection
<Type>
+ ReturnType: Type
}
abstract class Property {
+ GetName() : string
+ IsReadOnly() : bool
+ IsEditable() : bool
}
interface IInspectable {
+ GetName() : string
+ GetProperties() : IEnumerable<InspectionElement>
+ GetCommands() : IEnumerable<Command>
}
abstract class InspectionElement {
+ GetName() : string
}
}
package Model.Common {
/'class ModelObjectHandle {
+ IsValid() : bool
}'/
...
...
@@ -33,16 +47,15 @@ package Model.Common {
+ IsVisible() : bool
+ GetPosition() : Vector2
+ GetModelObjectHandle() : ModelObjectHandle
+ GetState() : int
}
interface I
Tickable
{
+
Tick()
interface I
DisplayableBuilding
{
+
StateChanged : EventHandler<BuildingStateChangeEventArgs>
}
IDisplayableBuilding --|> IDisplayable
interface IInspectable {
+ GetProperties() : IEnumerable<Property>
+ GetActions() : IEnumerable<Action>
interface ITickable {
+ Tick()
}
interface IBuilder {
...
...
@@ -71,6 +84,7 @@ package Model.Common {
+ AddPerson(Visitor)
+ AddPerson(MaintenanceStaff)
+ AddPerson(CleaningStaff)
+ RemovePerson(Person)
+ Tick() : TickResult
}
Simulation --|> IBuilder
...
...
@@ -101,11 +115,13 @@ package Model.Common {
+ GetPavements() : Pavement[]
+ GetVisitableBuildings() : VisitableBuilding[]
+ GetStaffBuildings() : StaffBuilding[]
+ GetProperties() : IEnumerable<
Property
> {override}
+ Get
Action
s() : IEnumerable<
Action
> {override}
+ GetProperties() : IEnumerable<
InspectionElement
> {override}
+ Get
Command
s() : IEnumerable<
Command
> {override}
+ ModifyBalance(int)
+ AddBuilding(Building)
+ SetEntryFee(int)
+ CountAcceptedVisitor()
+ CountRefusedVisitor()
+ Tick() {override}
}
Park --|> ITickable
...
...
@@ -122,6 +138,7 @@ package Model.Common {
+ SetVisible(bool)
}
WorldEntity --|> IDisplayable
WorldEntity --|> IInspectable
class MaintenanceDispatcher <<static>> {
- {static} maintainers : MaintenanceStaff[]
...
...
@@ -239,10 +256,12 @@ package Model.People {
- nextVertexHandle : VertexHandle
# Person(Vector2, VertexHandle, float, string)
+ Tick() {override}
+ GetProperties() : IEnumerable<
Property
> {override}
+ Get
Action
s() : IEnumerable<
Action
> {override}
+ GetProperties() : IEnumerable<
InspectionElement
> {override}
+ Get
Command
s() : IEnumerable<
Command
> {override}
+ GetDestination()
+ SetDestination(MapObject)
# Arrived(MapObject)
# ExitPark()
- StepPerson()
- CalculateNextStep()
}
...
...
@@ -258,16 +277,19 @@ package Model.People {
- satiety : int
- money : int
- inQueue : bool
- stepsSinceLastMeal : int
+ Visitor(Vector2, VertexHandle, float, string, int, int, int)
- ChooseDestination()
+ DeliverEffects(VisitorEffect)
+ GameEnded(Vector2)
+ ThrowsGarbage() : bool
+ Tick() {override}
+ GetProperties() : IEnumerable<
Property
> {override}
+ GetProperties() : IEnumerable<
InspectionElement
> {override}
+ ModifyMood(int)
+ ModifySatiety(int)
+ ModifyMoney(int)
+ SetInQueue(bool)
# Arrived(MapObject) {override}
- ChooseDestination()
}
Visitor --|> Person
...
...
@@ -276,7 +298,7 @@ package Model.People {
- idle : bool
# Staff(Vector2, VertexHandle, float, string)
+ Tick() {override}
+ GetProperties() : IEnumerable<
Property
> {override}
+ GetProperties() : IEnumerable<
InspectionElement
> {override}
+ IsIdle() : bool
+ SetDestination(MapObject) {override}
}
...
...
@@ -284,15 +306,13 @@ package Model.People {
class CleaningStaff {
+ CleaningStaff(Vector2, VertexHandle, float, string)
+ Tick() {override}
+ GetProperties() : IEnumerable<Property> {override}
+ GetName() : string {override}
}
CleaningStaff --|> Staff
class MaintenanceStaff {
+ MaintenanceStaff(Vector2, VertexHandle, float, string)
+ Tick() {override}
+ GetProperties() : IEnumerable<Property> {override}
+ GetName() : string {override}
}
MaintenanceStaff --|> Staff
MaintenanceDispatcher *--- "-maintainers\n*\n" MaintenanceStaff
...
...
@@ -302,8 +322,10 @@ package Model.People {
package Model.Landscape {
package Blueprints {
abstract class ObjectBlueprint {
+ Name : string
+ Size: Vec2i
+ ConstructionCost : int
+ navigableCells : List<NavigableCell>
+ GetSize() : Vec2i {override}
+ CanPlace(Map, MapPosition) : bool {override}
...
...
@@ -313,18 +335,23 @@ package Model.Landscape {
abstract class BuildingBlueprint {
+ MaintenanceCost: int
+ ConstructionTime: int
+ RepairTime : int
+ ExpectedLifeSpan : int
+ GetNavigableCells() : IEnumerable<NavigableCell> {override}
}
BuildingBlueprint --|> ObjectBlueprint
class PavementBlueprint {
+ GarbageCanPrice : int
+ Place(Map, MapObjectPosition) : MapObject {override}
}
PavementBlueprint --|> ObjectBlueprint
class QueuePavementBlueprint {
- capacity : int
+ Capacity : int
+ Place(Map, MapObjectPosition) : MapObject {override}
}
QueuePavementBlueprint --|> PavementBlueprint
...
...
@@ -335,22 +362,21 @@ package Model.Landscape {
}
StaffBuildingBlueprint --|> BuildingBlueprint
class Cleaning
Lady
BuildingBlueprint {
class CleaningBuildingBlueprint {
}
Cleaning
Lady
BuildingBlueprint --|> StaffBuildingBlueprint
CleaningBuildingBlueprint --|> StaffBuildingBlueprint
class Maintenance
Guy
BuildingBlueprint {
class MaintenanceBuildingBlueprint {
}
Maintenance
Guy
BuildingBlueprint --|> StaffBuildingBlueprint
MaintenanceBuildingBlueprint --|> StaffBuildingBlueprint
class VisitableBuildingBlueprint {
+ Capacity: int
+ QueueCapacity : int
+ EntryFee: int
+ MaintenanceCostPerVisitor: int
+ ConstructionTime: int
+ ConstructionCost: int
+ MaintenanceCostPerRide: int
+ MinVisitorCountToStart: int
+ TimePerRound: int
+ EffectOnVisitor : VisitorEffect
...
...
@@ -377,26 +403,41 @@ package Model.Landscape {
Building *-- "1" BuildingState
class StaffBuilding {
+ SpawnStaff() {abstract}
}
StaffBuilding --|> Building
class Cleaning
Lady
Building {
class CleaningBuilding {
+ SpawnStaff() {override}
}
CleaningLadyBuilding --|> StaffBuilding
class MaintenanceGuyBuilding {
CleaningBuilding --|> StaffBuilding
class MaintenanceBuilding {
+ SpawnStaff() {override}
}
Maintenance
Guy
Building --|> StaffBuilding
MaintenanceBuilding --|> StaffBuilding
class VisitableBuilding {
- EntryFee: int
- MinVisitorCountToStart: int
- entryFee: int
- queueCapacity : int
- inQueueCount : int
- minVisitorCountToStart : int
- rideCapacity : int
- onRideCount : int
- effectOnMood : int
- effectOnSatiety : int
- rideDuration : int
- remainingRideDuration : int
- maintenanceCostPerTick : int
- maintenanceCostPerRide : int
- queue : Queue<Visitor>
- onRide : List<Visitor>
- exitPosition : Vector2
+ Enter(Person) : Vector2? {override}
+ Exit(Person) {override}
+ GetEntryFee() : int
+ CanEatHere() : bool
}
VisitableBuilding --|> Building
...
...
@@ -462,8 +503,8 @@ interface Model.IBuilder {
}
interface Model.IInspectable {
+ GetProperties() : IEnumerable<
Property
>
+ Get
Action
s() : IEnumerable<
Action
>
+ GetProperties() : IEnumerable<
InspectionElement
>
+ Get
Command
s() : IEnumerable<
Command
>
}
interface Model.IDisplayable {
...
...
...
...