Update Class Diagram authored by Pőcze Barnabás's avatar Pőcze Barnabás
...@@ -159,15 +159,20 @@ package Model.Map { ...@@ -159,15 +159,20 @@ package Model.Map {
WEST WEST
} }
class Placement { class MapPosition {
+ Position : Vector2 + Coords : Vec2i
+ Orientation : Orientation + Orientation : Orientation
} }
class MapObjectPosition {
+ MapPosition : MapPosition
+ WorldPosition : Vector2
}
class Map { class Map {
+ Map(Vector2) + Map(Vec2i, float)
+ CanBuild(IMapObjectBlueprint, Placement) : bool + CanBuild(IMapObjectBlueprint, MapPosition) : bool
+ Build(IMapObjectBlueprint, Placement): (IDisplayable, IInspectable) + Build(IMapObjectBlueprint, MapPosition): (IDisplayable, IInspectable)
} }
Map *- "*" Cell Map *- "*" Cell
Map o-- "1" NavigationGraph Map o-- "1" NavigationGraph
...@@ -175,15 +180,15 @@ package Model.Map { ...@@ -175,15 +180,15 @@ package Model.Map {
IBuilder <|-- Map IBuilder <|-- Map
class NavigableCell { class NavigableCell {
+ Pos : Vector2 + Pos : Vec2i
+ OpenDirections: IEnumerable<Orientation> + OpenDirections: IEnumerable<Orientation>
} }
interface IMapObjectBlueprint { interface IMapObjectBlueprint {
+ GetSize() : Vector2 + GetSize() : Vec2i
+ GetNavigableCells() : IEnumerable<NavigableCell> + GetNavigableCells() : IEnumerable<NavigableCell>
+ CanPlace(Map, Placement) : bool + CanPlace(Map, MapPosition) : bool
+ Place(Map, Placement) : MapObject + Place(Map, MapObjectPosition) : MapObject
} }
} }
...@@ -263,11 +268,11 @@ package Model.People { ...@@ -263,11 +268,11 @@ package Model.People {
package Model.Landscape { package Model.Landscape {
package Blueprints { package Blueprints {
abstract class ObjectBlueprint { abstract class ObjectBlueprint {
+ Size: Vector2 + Size: Vec2i
+ ConstructionCost : int + ConstructionCost : int
+ GetSize() : Vector2 {override} + GetSize() : Vec2i {override}
+ CanPlace(Map, Placement) : bool {override} + CanPlace(Map, MapPosition) : bool {override}
} }
ObjectBlueprint --|> IMapObjectBlueprint ObjectBlueprint --|> IMapObjectBlueprint
...@@ -280,19 +285,19 @@ package Model.Landscape { ...@@ -280,19 +285,19 @@ package Model.Landscape {
BuildingBlueprint --|> ObjectBlueprint BuildingBlueprint --|> ObjectBlueprint
class PavementBlueprint { class PavementBlueprint {
+ Place(Map, Placement) : MapObject {override} + Place(Map, MapObjectPosition) : MapObject {override}
} }
PavementBlueprint --|> ObjectBlueprint PavementBlueprint --|> ObjectBlueprint
class QueuePavementBlueprint { class QueuePavementBlueprint {
- capacity : int - capacity : int
+ Place(Map, Placement) : MapObject {override} + Place(Map, MapObjectPosition) : MapObject {override}
} }
QueuePavementBlueprint --|> PavementBlueprint QueuePavementBlueprint --|> PavementBlueprint
class StaffBuildingBlueprint { class StaffBuildingBlueprint {
+ SpawnedStaffCount: int + SpawnedStaffCount: int
+ Place(Map, Placement) : MapObject {override} + Place(Map, MapObjectPosition) : MapObject {override}
} }
StaffBuildingBlueprint --|> BuildingBlueprint StaffBuildingBlueprint --|> BuildingBlueprint
...@@ -317,7 +322,7 @@ package Model.Landscape { ...@@ -317,7 +322,7 @@ package Model.Landscape {
+ EffectOnVisitor : VisitorEffect + EffectOnVisitor : VisitorEffect
+ RepairCost: int + RepairCost: int
+ Place(Map, Placement) : MapObject {override} + Place(Map, MapObjectPosition) : MapObject {override}
} }
VisitableBuildingBlueprint --|> BuildingBlueprint VisitableBuildingBlueprint --|> BuildingBlueprint
} }
... ...
......