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