update class diagram authored by Pőcze Barnabás's avatar Pőcze Barnabás
...@@ -9,48 +9,57 @@ Do not use in production. ...@@ -9,48 +9,57 @@ Do not use in production.
endheader endheader
package Model.Inspection { package Model.Inspection {
abstract class Command { abstract class InspectionElement {
+ GetName() : string + Name : string
+ CanExecute() : bool + IsVisible : bool
# InspectionElement(name : string, visible : bool)
+ ClearWeakEventHandlers()
}
class Command : InspectionElement {
+ CommandSignature : Signature
+ CanExecute : bool
+ Execute(object...) : object + Execute(object...) : object
+ GetSignature() : ActionSignature {abstract}
} }
class Command.Signature { class Command.Signature {
+ Args: ICollection<Type> + Arguments: ICollection<Type>
+ ReturnType: Type + ReturnType: Type
} }
abstract class Property { class Property<T> {
+ GetName() : string + Value : T
+ IsEditable() : bool + IsEditable : bool
+ Edit(newValue : T) : bool
+ Flush()
+ Property(name : string, value : T, editable : bool, validate : Predicate<T>, visible : bool)
+ ClearWeakEventHandlers() {override}
+ RegisterWeakChangedEventHandler(eventHandler : PropertyChanged<T>)
} }
interface IInspectable { interface IInspectable {
+ GetName() : string + Name : string
+ GetProperties() : IEnumerable<InspectionElement> + GetProperties() : IEnumerable<InspectionElement>
+ GetCommands() : IEnumerable<Command> + GetCommands() : IEnumerable<Command>
} }
abstract class InspectionElement {
+ GetName() : string
}
} }
package Model.Common { package Model.Common {
/'class ModelObjectHandle { class ModelObjectHandle {
+ IsValid() : bool + OnDeleted : EventHandler
}'/ + Delete(args : EventArgs)
}
interface IDisplayable { interface IDisplayable {
+ IsVisible() : bool + Visible : bool
+ GetPosition() : Vector2 + Position : Vector2
+ GetModelObjectHandle() : ModelObjectHandle + Handle : ModelObjectHandle
} }
interface IDisplayableBuilding { interface IDisplayableBuilding {
+ StateChanged : EventHandler<BuildingStateChangeEventArgs> + IsUnderConstruction : Property<bool>
+ NeedsRepair : Property<bool>
} }
IDisplayableBuilding --|> IDisplayable IDisplayableBuilding --|> IDisplayable
...@@ -59,8 +68,8 @@ package Model.Common { ...@@ -59,8 +68,8 @@ package Model.Common {
} }
interface IBuilder { interface IBuilder {
+ CanBuild(IMapObjectBlueprint, Placement) : bool + CanBuild(IMapObjectBlueprint, MapPlacement) : bool
+ Build(IMapObjectBlueprint, Placement) : (IDisplayable, IInspectable) + Build(IMapObjectBlueprint, MapPlacement) : (IDisplayable, IInspectable)
} }
...@@ -153,23 +162,29 @@ package Model.Common { ...@@ -153,23 +162,29 @@ package Model.Common {
package Model.Map { package Model.Map {
package Nav { package Nav {
class NavigationGraph { class NavigationGraph {
+ VertexCount : int
+ NavigationGraph(data : object)
+ AddVertex() : VertexHandle + AddVertex() : VertexHandle
+ AddEdge(VertexHandle, VertexHandle) + AddEdge(VertexHandle, VertexHandle)
+ PlanRoute(VertexHandle, VertexHandle) : RouteHandle + PlanRoute(VertexHandle, VertexHandle) : RouteHandle
+ GetNextOnRoute(RouteHandle) : VertexHandle + GetNextOnRoute(VertexHandle, VertexHandle) : VertexHandle
} }
class VertexHandle { class VertexHandle {
+ {static} INVALID : VertexHandle + {static} INVALID : VertexHandle
+ VertexHandle(int) + VertexHandle(int)
+ GetID() : int + ID : int
+ Valid : bool
} }
class RouteHandle { class RouteHandle {
+ {static} INVALID : RouteHandle - navgraph : NavigationGraph
+ At : VertexHandle - at : VertexHandle
+ To : VertexHandle - to : VertexHandle
+ RouteHandle(VertexHandle, VertexHandle) - next : VertexHandle
+ RouteHandle(NavigationGraph, VertexHandle, VertexHandle)
+ GetNext() : VertexHandle
+ CommitStep() : VertexHandle
} }
} }
...@@ -177,13 +192,19 @@ package Model.Map { ...@@ -177,13 +192,19 @@ package Model.Map {
+ Vertices : ICollection<VertexHandle> + Vertices : ICollection<VertexHandle>
# position : MapObjectPosition # position : MapObjectPosition
# MapObject(MapObjectPosition) # MapObject(MapObjectPosition)
+ Enter(Person) : Vector2? {abstract} + Enter(Person) : EnterResult {virtual}
+ Exit(Person) {abstract} + Exit(Person) {virtual}
} }
MapObject --|> WorldEntity MapObject --|> WorldEntity
class Cell { enum MapObject.EnterResult {
SUCCESS
AGAIN
FAIL
}
class Cell {
+ OpenDirections : IEnumerable<Orientation>
} }
Cell o- "1" MapObject Cell o- "1" MapObject
Cell o-- "{0,1}" VertexHandle Cell o-- "{0,1}" VertexHandle
...@@ -195,6 +216,10 @@ package Model.Map { ...@@ -195,6 +216,10 @@ package Model.Map {
WEST WEST
} }
class OrientationExtensions {
+ {static} rotate(direction : Orientation, by : Orientation) : Orientation
}
class MapPosition { class MapPosition {
+ Coords : Vec2i + Coords : Vec2i
+ Orientation : Orientation + Orientation : Orientation
...@@ -216,12 +241,17 @@ package Model.Map { ...@@ -216,12 +241,17 @@ package Model.Map {
+ GetNavigationGraph() : NavigationGraph + GetNavigationGraph() : NavigationGraph
+ GetScale() : float + GetScale() : float
+ {method} [Vertexhandle] : MapObject + {method} [Vertexhandle] : MapObject
- {method} [Vec2i] : Cell
- ConnectNavigableCells(MapObject, Vec2i, MapPosition, IEnumerable<NavigableCell>) - ConnectNavigableCells(MapObject, Vec2i, MapPosition, IEnumerable<NavigableCell>)
- IsInside(int, int) : bool - IsInside(int, int) : bool
- IsInside(Vec2i) : bool - IsInside(Vec2i) : bool
- GetNeighbor(Vec2i, Orientation) : Vec2i + IsNavigable(pos : Vec2i) : bool
- MapPosition(Vec2i, Orientation, Vec2i) : Vec2i - {static} GetNeighborPos(Vec2i, Orientation) : Vec2i
- AdjustSize(Vec2i, Orientation) : Vec2i - {static} GetAdjustedMapPosition(Vec2i, Orientation, Vec2i) : Vec2i
- {static} GetConnectableDirection(Orientation) : Orientation
- {static} AdjustSize(Vec2i, Orientation) : Vec2i
+ {static} InnerToWorldPosition(IMapObjectBlueprint, MapPosition, Vec2i) : Vec2i
+ GetNeighbors(Vec2i) : IEnumerable<Vec2i>
} }
Map *- "*" Cell Map *- "*" Cell
Map o-- "1" NavigationGraph Map o-- "1" NavigationGraph
... ...
......