Doxygen Index¶
-
namespace
TrafficJam
¶ -
class
Helper
¶
-
class
TrafficTracer
¶ Public Functions
-
TrafficTracer
()¶
-
void
InitializeSimulation
(int situationId, int framesBeforeVehicle, int heavyTrafficPercentage)¶
-
void
ShowResetWindow
(MainWindow ownerWindow, bool simulationRunning)¶
-
void
Reset
(bool softReset, bool fromResetButton)¶
Property
-
property
TrafficJam::TileLength
-
property
TrafficJam::TileResourceManager
-
property
TrafficJam::Monitor
-
property
TrafficJam::StartupWindow
-
property
TrafficJam::MainWindow
-
property
TrafficJam::Map
-
property
TrafficJam::Controller
-
property
TrafficJam::VehicleFactory
-
property
TrafficJam::Seed
-
property
TrafficJam::HeavyTrafficPercentage
-
property
TrafficJam::FramesBeforeVehicle
-
-
namespace
Environment
¶ -
class
Map
: public Panel¶ Public Functions
-
Map
(TrafficTracer trafficTracer, int mapId)¶
-
Road
GetTile
(PointF point)¶
-
List<Road>
CalculateRoute
(EntryPoint entryPoint)¶
-
void
DrawNextFrame
(Bitmap nextFrame)¶
-
List<EntryPoint>
GetAvailableEntryPoints
()¶
-
void
UpdateEntryPointInflow
(int entryPointId, int framesBeforeVehicle)¶
Property
-
property
TrafficJam::Environment::EntryPointsCount
-
property
TrafficJam::Environment::TrafficTracer
Protected Functions
-
override void OnMouseClick(MouseEventArgs e)
-
override void OnMouseMove(MouseEventArgs e)
Private Functions
-
void
Map_Paint
(object sender, PaintEventArgs e)¶
-
Road
GetTile
(Point point)¶
-
Grid
CalculateGrid
()¶
-
void
SelectMap
(int mapId)¶
-
void
CreateEntryPoints
(int mapId)¶
-
void
StoreEntryPoints
(List<Road> entryPoints)¶
-
void
SelectRoadMap1
(Dictionary<(int, int), Road> dict)¶
-
void
SelectRoadMap2
(Dictionary<(int, int), Road> dict)¶
-
void
SelectRoadMap3
(Dictionary<(int, int), Road> dict)¶
-
Bitmap
DrawRoads
(Dictionary<(int, int), Road> roadTiles)¶
-
int
SelectRandomDestination
(int entryPointIndex, int exitPointIndex)¶
Private Members
-
readonly TrafficTracer _trafficTracer
-
const int
HorizontalTiles
= 8¶
-
const int
VerticalTiles
= 6¶
-
readonly Size _tileSize
-
readonly Dictionary<(int X, int Y), Road> _roadTiles = new Dictionary<(int X, int Y), Road>( HorizontalTiles * VerticalTiles )
-
readonly List<EntryPoint> _entryPoints = new List<EntryPoint>( )
-
Grid
_grid
¶
-
Road
_selectedTile
¶
-
Bitmap
_nextFrame
¶
-
int
-
-
namespace
Roads
¶ -
class
CurvedRoad0
: public Road¶ Public Functions
-
CurvedRoad0(Map map, (int X, int Y) position)
-
override bool ToolAllowed(Tool tool)
-
override bool DirectionAllowed(AnimationDirection direction)
-
override string ToString()
-
-
class
CurvedRoad180
: public Road¶ Public Functions
-
CurvedRoad180(Map map, (int X, int Y) position)
-
override bool ToolAllowed(Tool tool)
-
override bool DirectionAllowed(AnimationDirection direction)
-
override string ToString()
-
-
class
CurvedRoad270
: public Road¶ Public Functions
-
CurvedRoad270(Map map, (int X, int Y) position)
-
override bool ToolAllowed(Tool tool)
-
override bool DirectionAllowed(AnimationDirection direction)
-
override string ToString()
-
-
class
CurvedRoad90
: public Road¶ Public Functions
-
CurvedRoad90(Map map, (int X, int Y) position)
-
override bool ToolAllowed(Tool tool)
-
override bool DirectionAllowed(AnimationDirection direction)
-
override string ToString()
-
-
class
EntryPoint
¶ -
Property
-
property
TrafficJam::Environment::Roads::FramesBeforeVehicle
-
property
TrafficJam::Environment::Roads::Road
-
property
-
class
Grass
: public Road¶ Public Functions
-
Grass(Map map, (int X, int Y) position)
-
override bool ToolAllowed(Tool tool)
-
override bool DirectionAllowed(AnimationDirection direction)
-
-
class
HorizontalRoad
: public Road¶ Public Functions
-
HorizontalRoad(Map map, (int X, int Y) position)
-
override bool ToolAllowed(Tool tool)
-
override bool DirectionAllowed(AnimationDirection direction)
-
-
class
Road
¶ Subclassed by CurvedRoad0, CurvedRoad180, CurvedRoad270, CurvedRoad90, Grass, HorizontalRoad, Junction, VerticalRoad
Public Functions
-
abstract bool ToolAllowed(Tool tool)= 0
-
abstract bool DirectionAllowed(AnimationDirection direction)= 0
-
bool
IsEntryPoint
()¶
-
void
CreateEntryPoint
(int framesBeforeVehicle)¶
Public Members
-
int
X
¶
Property
-
property
TrafficJam::Environment::Roads::Position
-
property
TrafficJam::Environment::Roads::Texture
-
property
TrafficJam::Environment::Roads::Location
-
property
TrafficJam::Environment::Roads::Tools
-
property
TrafficJam::Environment::Roads::HasTool
-
property
TrafficJam::Environment::Roads::EntryPoint
Protected Functions
-
Road(Map map, (int X, int Y) position, string textureName)
Private Members
-
readonly Point _location
-
readonly Image _texture
-
EntryPoint
_entryPoint
¶
-
List<Tool>
_tools
¶
-
-
class
VerticalRoad
: public Road¶ Public Functions
-
VerticalRoad(Map map, (int X, int Y) position)
-
override bool ToolAllowed(Tool tool)
-
override bool DirectionAllowed(AnimationDirection direction)
-
-
namespace
Junctions
¶ -
class
Intersection
: public Junction¶ Public Functions
-
Intersection(Map map, (int X, int Y) position)
-
override bool ToolAllowed(Tool tool)
-
override bool DirectionAllowed(AnimationDirection direction)
-
-
class
Junction
: public Road¶ Subclassed by Intersection, Junction0, Junction180, Junction270, Junction90
Public Functions
-
void
Dequeue
(AnimationDirection direction)¶
-
bool
QueuesEmpty
(AnimationDirection myDirection)¶
-
Point
GetStoppingPoint
(AnimationDirection myDirection)¶
Event
-
event
TrafficJam::Environment::Roads::Junctions::VehicleEnqueued
-
event
TrafficJam::Environment::Roads::Junctions::VehicleDequeued
Protected Functions
-
Junction(Map map, (int X, int Y) position, string textureName, AnimationDirection queueDirections)
-
virtual void
OnVehicleEnqueued
(VehicleEnqueuedEventArgs e)¶
-
virtual void
OnVehicleDequeued
(VehicleEnqueuedEventArgs e)¶
Private Functions
-
void
InitializeQueues
(AnimationDirection directions)¶
-
void
-
class
Junction0
: public Junction¶ Public Functions
-
Junction0(Map map, (int X, int Y) position)
-
override bool ToolAllowed(Tool tool)
-
override bool DirectionAllowed(AnimationDirection direction)
-
override string ToString()
-
-
class
Junction180
: public Junction¶ Public Functions
-
Junction180(Map map, (int X, int Y) position)
-
override bool ToolAllowed(Tool tool)
-
override bool DirectionAllowed(AnimationDirection direction)
-
override string ToString()
-
-
class
-
class
-
class
-
namespace
Events
¶ -
class
SimulationResetEventArgs
: public EventArgs¶ -
Property
-
property
TrafficJam::Events::SoftReset
-
property
-
class
VehicleEnqueuedEventArgs
: public EventArgs¶ Public Functions
-
VehicleEnqueuedEventArgs
()¶
-
VehicleEnqueuedEventArgs
(AnimationDirection direction)¶
Property
-
property
TrafficJam::Events::QueueDirection
-
-
class
VehicleStateEventArgs
: public EventArgs¶ Public Functions
Property
-
property
TrafficJam::Events::Vehicle
-
property
TrafficJam::Events::OldState
-
property
TrafficJam::Events::NewState
Private Members
-
readonly Vehicle _vehicle
-
readonly VehicleState _oldState
-
readonly VehicleState _newState
-
property
-
class
-
namespace
Exceptions
¶ Public Functions
-
class
InvalidDirectionException
: public Exception¶ Public Functions
-
InvalidDirectionException
(Type roadType, AnimationDirection direction)¶
-
InvalidDirectionException
(AnimationDirection direction)¶
Property
-
property
TrafficJam::Exceptions::RoadType
-
property
TrafficJam::Exceptions::Direction
-
-
class
VehicleCreationFailedException
: public Exception¶ Public Functions
-
VehicleCreationFailedException
(string message, InvalidDirectionException innerException)¶
-
-
namespace
Forms
¶ -
-
class
EntryPointsPanel
: public Panel¶ Public Functions
-
EntryPointsPanel
(MainWindow mainWindow)¶
Private Members
-
readonly MainWindow _mainWindow
-
-
class
EntryPointsSub
: public Panel¶ Public Functions
-
EntryPointsSub
(EntryPointsPanel entryPointsPanel, int y)¶
Private Members
-
readonly EntryPointsPanel _entryPointsPanel
-
readonly Font _trebuchetSmall = new Font( "Trebuchet MS", 8f )
-
readonly Font _trebuchetLarge = new Font( "Trebuchet MS", 11f )
-
-
class
MainWindow
: public Form, public IObserver<SimulationInfo>¶ Public Functions
-
MainWindow
(TrafficTracer trafficTracer)¶
-
void
OnNext
(SimulationInfo simInfo)¶
-
void
OnError
(Exception error)¶
-
void
OnCompleted
()¶
Property
-
property
TrafficJam::Forms::TrafficTracer
-
property
TrafficJam::Forms::ToolsPanel
-
property
TrafficJam::Forms::TrafficFlowPanel
-
property
TrafficJam::Forms::EntryPointsPanel
Protected Functions
-
override void OnFormClosed(FormClosedEventArgs e)
-
override void Dispose(bool disposing)
Private Functions
-
void
CreatePanelBars
()¶
-
void
BorderSizeMenuButtons
(object sender)¶
-
void
ChangeButtonMenu
(Button btn)¶
-
void
BorderSizeTopButtons
(object sender)¶
-
void
ChangeButtonMainWindow
(Button btn)¶
-
void
StartSimulationMain_Click
(object sender, EventArgs e)¶
-
void
PauseSimulation_Click
(object sender, EventArgs e)¶
-
void
StepSimulation_Click
(object sender, EventArgs e)¶
-
void
ResetSimulation_Click
(object sender, EventArgs e)¶
-
void
ChangeMenuHeader
(object sender)¶
-
void
ToolsMain_Click
(object sender, EventArgs e)¶
-
void
TrafficFlowMain_Click
(object sender, EventArgs e)¶
-
void
EntryPointsMain_Click
(object sender, EventArgs e)¶
-
void
ShowPanel
(Button sender)¶
-
void
InitializeComponent
()¶
Private Members
-
readonly TrafficTracer _trafficTracer
-
readonly ToolsPanel _toolsPanel
-
readonly TrafficFlowPanel _trafficFlowPanel
-
readonly EntryPointsPanel _entryPointsPanel
-
bool
_simulationStarted
¶
-
System.ComponentModel.IContainer components = null
-
System.Windows.Forms.Button stepSimulation
-
System.Windows.Forms.Button entryPointsMain
-
System.Windows.Forms.Button trafficFlowMain
-
System.Windows.Forms.Button toolsMain
-
System.Windows.Forms.Button resetSimulation
-
System.Windows.Forms.Button pauseSimulation
-
System.Windows.Forms.Button startSimulationMain
-
System.Windows.Forms.Label menuHeader
-
-
class
ResetWindow
: public Form¶ Public Functions
-
ResetWindow
(TrafficTracer trafficTracer, bool simulationRunning)¶
Protected Functions
-
override void Dispose(bool disposing)
Private Functions
-
void
newSituation_Click
(object sender, EventArgs e)¶
-
void
sameSituation_Click
(object sender, EventArgs e)¶
-
void
InitializeComponent
()
Private Members
-
readonly TrafficTracer _trafficTracer
-
readonly bool _simulationRunning
-
System.ComponentModel.IContainer components = null
-
System.Windows.Forms.Label label1
-
System.Windows.Forms.Button newSituation
-
System.Windows.Forms.Button sameSituation
-
-
class
StartupWindow
: public Form¶ Public Functions
-
StartupWindow
(TrafficTracer trafficTracer)¶
Protected Functions
-
override void Dispose(bool disposing)
Private Functions
-
void
ChangeHeader
()¶
-
void
ChangeBorderSize
()¶
-
void
ChangeButton
(Button btn)¶
-
void
MoveSelectionBars
()¶
-
void
situation1_Click
(object sender, EventArgs e)¶
-
void
situation2_Click
(object sender, EventArgs e)¶
-
void
situation3_Click
(object sender, EventArgs e)¶
-
void
startSimulationStartup_Click
(object sender, EventArgs e)¶
-
void
UpdateWindow
()¶
-
void
InitializeComponent
()
Private Members
-
readonly TrafficTracer _trafficTracer
-
readonly ResourceManager _resourceManager = new ResourceManager( "TrafficJam.Properties.RoadTiles", Assembly.GetExecutingAssembly( ) )
-
Button
_selectedButton
¶
-
readonly PictureBox _mapPreview
-
string
_headerInformation
¶
-
const string
Situation1Info
= "This is a map that functions as example of a realistic traffic situation."¶
-
Image
_situation1
¶
-
const string
Situation2Info
= "This is a map that has many intersections and junctions close together, to simulate a traffic situation that's prone to creating gridlock."¶
-
Image
_situation2
¶
-
const string
Situation3Info
= "This map shows a part of the centre of Utrecht. the area in question is the area around Janskerkhof, the Voorstraat and the Lange Jansstraat."¶
-
Image
_situation3
¶
-
int
_situationId
= 1¶
-
System.ComponentModel.IContainer components = null
-
System.Windows.Forms.Label situationInfo
-
System.Windows.Forms.Label situationHeader
-
System.Windows.Forms.Button startSimulationStartup
-
System.Windows.Forms.Label speed100
-
System.Windows.Forms.Label speed80
-
System.Windows.Forms.Label speed60
-
System.Windows.Forms.Label speed40
-
System.Windows.Forms.Label speed20
-
System.Windows.Forms.Label speedHeader
-
System.Windows.Forms.Label manyHeavyTraffic
-
System.Windows.Forms.Label averageHeavyTraffic
-
System.Windows.Forms.Label fewHeavyTraffic
-
System.Windows.Forms.Label heavyTrafficHeader
-
System.Windows.Forms.TrackBar speedBar
-
System.Windows.Forms.TrackBar heavyTrafficBar
-
System.Windows.Forms.Label highTraffic
-
System.Windows.Forms.Label averageTraffic
-
System.Windows.Forms.Label lowTraffic
-
System.Windows.Forms.TrackBar trafficBar
-
System.Windows.Forms.Label trafficHeader
-
System.Windows.Forms.Button situation3
-
System.Windows.Forms.Button situation2
-
System.Windows.Forms.Button situation1
-
System.Windows.Forms.Panel firstSelectedBar
-
System.Windows.Forms.Panel secondSelectedBar
-
-
class
ToolsPanel
: public Panel¶ Public Functions
-
ToolsPanel
(MainWindow mainWindow)¶
Property
-
property
TrafficJam::Forms::CurrentTool
Private Functions
-
void
BorderSizeToolMenu
()¶
-
void
CrossRoad_Click
(object sender, EventArgs e)¶
-
void
RoadBlock_Click
(object sender, EventArgs e)¶
-
void
SpeedBump_Click
(object sender, EventArgs e)¶
-
void
SpeedSign_Click
(object sender, EventArgs e)¶
-
void
TrafficLight_Click
(object sender, EventArgs e)¶
-
void
throughputMeter_Click
(object sender, EventArgs e)¶
Private Members
-
readonly MainWindow _mainWindow
-
Button
_selectedToolButton
¶
-
readonly Button _crossRoad = new Button( )
-
readonly Button _roadBlock = new Button( )
-
readonly Button _speedBump = new Button( )
-
readonly Button _speedSign = new Button( )
-
readonly Button _trafficLight = new Button( )
-
readonly Button _throughputMeter = new Button( )
Private Static Functions
-
static void
ChangeButton
(ButtonBase btn)¶
-
-
class
TrafficFlowPanel
: public Panel¶ Public Functions
-
TrafficFlowPanel
(MainWindow mainWindow)¶
Private Members
-
readonly MainWindow _mainWindow
-
readonly Font _trebuchetSmall = new Font( "Trebuchet MS", 8f )
-
readonly Font _trebuchetLarge = new Font( "Trebuchet MS", 11f )
-
-
class
-
namespace
Properties
¶ -
class
RoadTiles
¶ Property
-
property
TrafficJam::Properties::ResourceManager
-
property
TrafficJam::Properties::Culture
-
property
TrafficJam::Properties::Car0
-
property
TrafficJam::Properties::CurvedRoad
-
property
TrafficJam::Properties::Grass
-
property
TrafficJam::Properties::HorizontalRoad
-
property
TrafficJam::Properties::Intersection
-
property
TrafficJam::Properties::Junction
-
property
TrafficJam::Properties::Map1
-
property
TrafficJam::Properties::Map2
-
property
TrafficJam::Properties::Map3
-
property
TrafficJam::Properties::VerticalRoad
Private Functions
-
internal
RoadTiles
()¶
Private Static Attributes
-
global::System.Resources.ResourceManager resourceMan
-
global::System.Globalization.CultureInfo resourceCulture
-
property
-
class
-
namespace
Simulation
¶ -
-
class
EventStore
¶ Public Functions
-
template<>
voidSubscribe
<T>(T subscriber)¶
-
template<>
voidUnSubscribe
<T>(T subscriber)¶
Event
-
event
TrafficJam::Simulation::SimulationStarted
-
event
TrafficJam::Simulation::SimulationPaused
-
event
TrafficJam::Simulation::SimulationReset
-
template<>
-
class
SimulationController
: public IObserver<SimulationInfo>¶ Public Functions
-
SimulationController
(TrafficTracer trafficTracer)¶
-
void
OnNext
(SimulationInfo simInfo)
-
void
OnError
(Exception error)
-
void
OnCompleted
()
-
void
StartSimulation
()¶
-
void
Step
()¶
Property
-
property
TrafficJam::Simulation::State
-
property
TrafficJam::Simulation::Continue
-
property
TrafficJam::Simulation::TrafficTracer
Event
-
event
TrafficJam::Simulation::SimulationStarted
-
event
TrafficJam::Simulation::SimulationPaused
-
event
TrafficJam::Simulation::SimulationReset
Protected Functions
-
virtual void
OnSimulationStarted
()
-
virtual void
OnSimulationPaused
()
-
virtual void
OnSimulationReset
()
Private Functions
-
void
SetupBackgroundWorker
()¶
-
void
DoWork
(object sender, DoWorkEventArgs e)¶
-
void
RunWorkerCompleted
(object sender, RunWorkerCompletedEventArgs e)¶
-
Bitmap
CreateNextFrame
()¶
-
void
UpdateVehicles
()¶
-
void
GenerateVehicles
()¶
-
void
AddVehicleManager
()¶
Private Members
-
readonly TrafficTracer _trafficTracer
-
readonly List<VehicleManager> _vehicleManagers
-
readonly Dictionary<string, RoadTrain> _roadTrains
-
VehicleManager
_availableManager
¶
-
bool
_continue
¶
-
Bitmap
_nextFrame
-
BackgroundWorker
_backgroundWorker
¶
-
-
class
SimulationInfo
¶ Public Functions
-
SimulationInfo
(SimulationState previousState, SimulationState currentState)¶
-
SimulationInfo
(SimulationState previousState, SimulationState currentState, bool softReset)¶
Property
-
property
TrafficJam::Simulation::PreviousState
-
property
TrafficJam::Simulation::CurrentState
-
property
TrafficJam::Simulation::SoftReset
-
-
class
SimulationMonitor
: public IObservable<SimulationInfo>¶ Public Functions
-
SimulationMonitor
()¶
-
void
SetController
(SimulationController controller)¶
-
IDisposable
Subscribe
(IObserver<SimulationInfo> observer)¶
-
void
StartSimulation
()
-
void
PauseSimulation
()¶
-
void
ResetSimulation
()¶
Private Functions
-
void
NotifyObservers
(SimulationInfo simInfo)¶
Private Members
-
readonly List<IObserver<SimulationInfo> > _observers
-
SimulationController
_controller
¶
-
class
Unsubscriber
: public IDisposable¶ Public Functions
-
Unsubscriber
(List<IObserver<SimulationInfo>> observers, IObserver<SimulationInfo> observer)¶
-
void
Dispose
()¶
Private Members
-
readonly List<IObserver<SimulationInfo> > _observers
-
readonly IObserver<SimulationInfo> _observer
-
-
-
class
-
namespace
Tools
¶
-
namespace
Vehicles
¶ Enums
-
class
Bus
: public Vehicle¶ Public Functions
-
Bus
(VehicleManager manager, EntryPoint entryPoint, int colorId)¶
Property
-
property
TrafficJam::Vehicles::MaxSpeed
-
-
class
Car
: public Vehicle¶ Public Functions
-
Car
(VehicleManager manager, EntryPoint entryPoint, int colorId)¶
Property
-
property
TrafficJam::Vehicles::MaxSpeed
-
-
class
RoadTrain
¶ -
Public Static Functions
-
static string
CreateId
(Vector2 direction, PointF position)¶
-
static string
-
class
Route
¶ Public Functions
-
Route
(List<Road> roads)¶
-
Road
GetRoad
(int index)¶
-
ReadOnlyCollection<Road>
GetRoads
()¶
-
AnimationDirection
GetDirection
(int index)¶
-
ReadOnlyCollection<AnimationDirection>
GetDirections
()¶
-
void
AddDirection
(AnimationDirection direction)¶
Private Members
-
readonly List<Road> _roads
-
readonly List<AnimationDirection> _directions
-
-
class
Truck
: public Vehicle¶ Public Functions
-
Truck
(VehicleManager manager, EntryPoint entryPoint, int colorId)¶
Property
-
property
TrafficJam::Vehicles::MaxSpeed
-
-
class
Vehicle
¶ -
Public Functions
-
void
Update
(Graphics graphics)¶
-
void
JunctionEnqueued
(object sender, VehicleEnqueuedEventArgs e)¶
-
void
JunctionDequeued
(object sender, VehicleEnqueuedEventArgs e)¶
Property
-
property
TrafficJam::Vehicles::MaxSpeed
-
property
TrafficJam::Vehicles::Subscribed
-
property
TrafficJam::Vehicles::Direction
-
property
TrafficJam::Vehicles::Position
Protected Functions
-
Vehicle
(VehicleManager manager, EntryPoint entryPoint, int colorId)¶
Private Functions
-
void
Move
()¶
-
void
Draw
(Graphics graphics)¶
-
void
CalcCurrentSpeed
()¶
-
float
CalcDeceleration
(Point stoppingPoint)¶
-
float
CalcPixelSpeed
(float speed)¶
-
Vector2
GetDirection
()¶
-
Road
GetRoad
(PointF currentLocation)¶
-
PointF
MoveLocation
(PointF source, PointF target, float pixelSpeed)¶
-
void
ShiftIndex
()¶
-
void
ChangeState
(VehicleState newState)¶
-
void
ResetJunctionData
()¶
-
Image
SetTexture
(TrafficTracer trafficTracer, int colorId)¶
Private Members
-
readonly VehicleManager _manager
-
readonly Route _route
-
readonly PointF [] _pathPoints
-
readonly Image _texture
-
VehicleState
_state
¶
-
float
_speed
¶
-
int
_index
¶
-
bool
_finalDirection
¶
-
bool
_discard
¶
-
Road
_currentRoad
¶
-
int
_routeIndex
¶
-
Junction
_nextJunction
¶
-
bool
_nextJunctionHandled
¶
-
float
_deceleration
¶
-
void
-
class
VehicleFactory
¶ Public Functions
-
VehicleFactory
(TrafficTracer trafficTracer)¶
-
Vehicle
Create
(VehicleManager manager, EntryPoint entryPoint)¶
Private Functions
-
int
GetVehicleCreationId
()¶
Private Members
-
readonly TrafficTracer _trafficTracer
-
readonly Random _random
-
const int
BusPercentage
= 20¶
-
-
class
VehicleManager
¶ Public Functions
-
VehicleManager
(SimulationController controller)¶
-
void
AddVehicle
(EntryPoint entryPoint)¶
-
void
MoveVehicles
(Bitmap nextFrame)¶
Property
-
property
TrafficJam::Vehicles::Controller
-
property
TrafficJam::Vehicles::Full
-
-
namespace
Animation
¶ Enums
-
class
AnimationDirectionExtensions
¶ Public Static Functions
-
static AnimationDirection MergeDirections(this AnimationDirection entranceDirection, AnimationDirection exitDirection)
-
static bool IsHorizontal(this AnimationDirection direction)
-
static bool IsVertical(this AnimationDirection direction)
-
static bool IsCurve(this AnimationDirection direction)
-
-
class
AnimationPathHelper
¶ -
Public Static Functions
-
static Point
GetStartingPoint
(Road road, AnimationDirection direction)¶
Private Functions
-
void
CalculateAnimationPath
(List<Road> route)¶
-
AnimationDirection
GetEntryPointDirection
(List<Road> pathSection)¶
-
AnimationDirection
GetExitPointDirection
(List<Road> pathSection)¶
-
AnimationDirection
GetDirection
(List<Road> pathSection)¶
-
AnimationDirection
GetEntranceSide
(Road entryPoint)¶
-
AnimationDirection
GetExitSide
(Road exitPoint)¶
-
AnimationDirection
GetExitDirection
(Road road1, Road road2)¶
-
void
AddAnimationPathPoints
(Road road, AnimationDirection direction)¶
-
void
AddHorizontalLine
(Road road, AnimationDirection direction)¶
-
void
AddVerticalLine
(Road road, AnimationDirection direction)¶
-
void
AddArc
(Road road, AnimationDirection direction)¶
-
Rectangle
CreateRectangle
(Point source, Point destination)¶
Private Members
-
const int
TileLength
= 150¶
-
const int
SmallOffset
= 50¶
-
const int
LargeOffset
= 100¶
-
readonly Route _route
-
readonly List<Road> _roads
-
readonly Road _exitPoint
-
readonly GraphicsPath _animationPath
Private Static Attributes
-
readonly IDictionary GetOppositeDirection= new Dictionary<AnimationDirection, AnimationDirection> { {AnimationDirection.TopOut, AnimationDirection.TopIn}, {AnimationDirection.RightOut, AnimationDirection.RightIn}, {AnimationDirection.BottomOut, AnimationDirection.BottomIn}, {AnimationDirection.LeftOut, AnimationDirection.LeftIn} }
-
static Point
-
class
-
class
-
class