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 */
41INLINE void ButtonEventList::
42 add_event(ButtonEvent event) {
43 _events.push_back(event);
44}
45
46/**
47 * Returns the number of events in the list.
48 */
49INLINE int ButtonEventList::
50 get_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 */
59INLINE const ButtonEvent &ButtonEventList::
60 get_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 */
71INLINE void ButtonEventList::
72 clear() {
73 _events.clear();
74}
ButtonEventList
Records a set of button events that happened recently.
Definition buttonEventList.h:33
ButtonEventList::get_num_events
get_num_events
Returns the number of events in the list.
Definition buttonEventList.h:50
ButtonEventList::add_event
void add_event(ButtonEvent event)
Adds a new event to the end of the list.
Definition buttonEventList.I:42
ButtonEventList::get_event
get_event
Returns the nth event in the list.
Definition buttonEventList.h:50
ButtonEventList::clear
void clear()
Empties all the events from the list.
Definition buttonEventList.I:72
ButtonEvent
Records a button event of some kind.
Definition buttonEvent.h:49