Panda3D
Loading...
Searching...
No Matches
buttonEventList.I
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file buttonEventList.I
10 * @author drose
11 * @date 2002-03-12
12 */
13
14/**
15 *
16 */
17INLINE ButtonEventList::
18ButtonEventList() {
19}
20
21/**
22 *
23 */
24INLINE ButtonEventList::
25ButtonEventList(const ButtonEventList &copy) :
26 _events(copy._events)
27{
28}
29
30/**
31 *
32 */
33INLINE void ButtonEventList::
34operator = (const ButtonEventList &copy) {
35 _events = copy._events;
36}
37
38/**
39 * Adds a new event to the end of the list.
40 */
43 _events.push_back(event);
44}
45
46/**
47 * Returns the number of events in the list.
48 */
49INLINE int ButtonEventList::
50get_num_events() const {
51 return _events.size();
52}
53
54/**
55 * Returns the nth event in the list. This does not remove the event from the
56 * list; the only way to remove events is to empty the whole list with
57 * clear().
58 */
60get_event(int n) const {
61#ifndef NDEBUG
62 static ButtonEvent empty_event;
63 nassertr(n >= 0 && n < (int)_events.size(), empty_event);
64#endif // NDEBUG
65 return _events[n];
66}
67
68/**
69 * Empties all the events from the list.
70 */
72clear() {
73 _events.clear();
74}
Records a set of button events that happened recently.
get_num_events
Returns the number of events in the list.
void add_event(ButtonEvent event)
Adds a new event to the end of the list.
get_event
Returns the nth event in the list.
void clear()
Empties all the events from the list.
Records a button event of some kind.
Definition buttonEvent.h:49