Skyscraper 2.0
person.h
Go to the documentation of this file.
1/*
2 Scalable Building Simulator - Person Object
3 The Skyscraper Project - Version 2.0
4 Copyright (C)2004-2024 Ryan Thoryk
5 https://www.skyscrapersim.net
6 https://sourceforge.net/projects/skyscraper/
7 Contact - ryan@skyscrapersim.net
8
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22*/
23
24#ifndef _SBS_PERSON_H
25#define _SBS_PERSON_H
26
27namespace SBS {
28
29class SBSIMPEXP Person : public Object
30{
31public:
32
33 RandomGen *rnd_time, *rnd_dest;
34
35 //functions
36 Person(Object *parent, const std::string &name, int floor, bool service_access = false);
37 ~Person();
38 void GotoFloor(int floor);
39 void Loop();
40 void ProcessRoute();
41 void Report(const std::string &message);
42 bool ReportError(const std::string &message);
43 int GetRandomFloor();
44 bool IsRouteActive() { return !route.empty(); }
45 bool IsRandomActivityEnabled();
46 void EnableRandomActivity(bool value);
47 void SetFloor(int value);
48 int GetFloor() { return current_floor; }
49 int GetDestinationFloor() { return dest_floor; }
50 void SetServiceAccess(bool value) { service_access = value; }
51 bool GetServiceAccess() { return service_access; }
52 void Stop();
53 std::string GetStatus();
54
55private:
56
66
70 std::vector<RouteEntry> route;
71
72 class Timer; //internal timer class
73
74 //random call timer object
76
77 int RandomProbability; //probability ratio of random activity, starting with 1 - higher is less frequent
78 Real RandomFrequency; //speed in seconds to make each random action
79};
80
81}
82
83#endif
Real RandomFrequency
Definition person.h:78
int GetFloor()
Definition person.h:48
int current_floor
Definition person.h:67
Timer * random_timer
Definition person.h:75
bool IsRouteActive()
Definition person.h:44
int RandomProbability
Definition person.h:77
int dest_floor
Definition person.h:68
int GetDestinationFloor()
Definition person.h:49
RandomGen * rnd_dest
Definition person.h:33
bool service_access
Definition person.h:69
std::vector< RouteEntry > route
Definition person.h:70
void SetServiceAccess(bool value)
Definition person.h:50
bool GetServiceAccess()
Definition person.h:51
Ogre::Real Real
Definition globals.h:57
#define SBSIMPEXP
Definition globals.h:53
ElevatorRoute * elevator_route
Definition person.h:59
CallStation * callstation
Definition person.h:60