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