Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 3d949d5271
Fetching contributors…

Cannot retrieve contributors at this time

62 lines (39 sloc) 1.797 kB
/* Emulator is a class like a controller(engine) manage all the logic */
#ifndef __EleEmu__emulator__
#define __EleEmu__emulator__
#include <QWidget>
#include <QPushButton>
#include <vector>
#include <string>
#include "floor.h"
#include "elevator.h"
class Emulator : public QWidget
{
Q_OBJECT
public:
Emulator(QWidget *parent = 0);
static int dual; /* dual: Time consumed with the whole duration */
static int nElevator; /* Total number of all elevators */
static int UNIT_TIME; /* Unit time is set to time consumed by moving elevator up or down a floor */
static vector<Elevator*> elevators; /* All the elevators functioning */
static double lambda; /* Poiss process parameter lambda */
static Floor floors[30]; /* Floors */
static int nFloor; /* Total number of all floors */
static string elevatorType;
static list<Order*> orders;
private slots:
void startEmulationSlots(); /* Slot bundle with start push button */
private:
void startEmulator(); /* Start Emulation, if it is already emulated, pause the process */
bool START; /* Wether game has started, equals false if paused */
QPushButton *start; /* Start button, placed at right buttom */
void Born();
void Control();
void Move();
void Update();
protected: /* Below is QWidget API */
void timerEvent(QTimerEvent*);
void paintEvent(QPaintEvent*);
void keyPressEvent(QKeyEvent*);
};
#endif /* defined(__EleEmu__emulator__) */
Jump to Line
Something went wrong with that request. Please try again.