#pragma once #include class CNetwork : public CDialog { DECLARE_DYNAMIC(CNetwork) CRect m_rect; CRect m_rc_track; CPoint Points[POINT_COUNT]; BYTE PointTypes[POINT_COUNT]; int m_offset; int m_PointCount; int m_MaxLength; BOOL Resized; BOOL bRunning; std::vector RailPoints; std::vector Objects; std::vector Stations; std::vector Trains; HANDLE* NetEvents; int Speed; BOOL GetPoint(size_t Loc, CPoint & pt); CStation* GetStation(size_t loc); public: void CalcPoints(CPaintDC*); public: CNetwork(CWnd* pParent = NULL); // standard constructor virtual ~CNetwork(); // Dialog Data enum { IDD = IDD_NETWORK }; void Resize(); BOOL Create(int offset, CWnd* parent); size_t Add(TObject*); int GetSpeed(); void SetSpeed(int); void Start(); void Stop(); void Go(); void Terminate(); DWORD TimeAtStation(CStation*S); CStation* GetNextStation(CStation*); BOOL IsRunning(); protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP() public: virtual BOOL OnInitDialog(); afx_msg void OnPaint(); afx_msg void OnWindowPosChanged(WINDOWPOS* lpwndpos); protected: virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); }; extern CNetwork* theNetwork;