summaryrefslogtreecommitdiffstats
path: root/game/code/ai/automaticdoor.h
blob: ab5b87442a09bb254d649665b2b3f11e6ac40aae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//===========================================================================
// Copyright (C) 2002 Radical Entertainment Ltd.  All rights reserved.
//
// Component:   AutomaticDoor
//
// Description: AutomaticDoor is an AnimSwitch (See actionbuttonhandler) where, 
//              upon entering the associated trigger volume, the animation will
//              play forward until the end. On exiting the trigger volume, the 
//              animation will play in the reverse direction
//
// Authors:     Michael Riegger
//
//===========================================================================

// Recompilation protection flag.
#ifndef AUTOMATIC_H
#define AUTOMATIC_H


//===========================================================================
// Nested Includes
//===========================================================================

#include <ai/actionbuttonhandler.h>


//===========================================================================
// Forward References
//===========================================================================


//===========================================================================
// Constants, Typedefs, and Macro Definitions (needed by external clients)
//===========================================================================



//===========================================================================
// Interface Definitions
//===========================================================================

//===========================================================================
//
// Description: 
//      Behaves like a sliding door would
//
// Constraints:
//
//===========================================================================

namespace ActionButton
{

class AutomaticDoor : public AnimSwitch
{
    public:
        AutomaticDoor( ActionEventLocator* pActionEventLocator );
        virtual ~AutomaticDoor();

        static ButtonHandler* NewAction( ActionEventLocator* pActionEventLocator )
        {
            return new AutomaticDoor( pActionEventLocator );  
        }  

    protected:

        virtual void OnEnter( Character* pCharacter );
        virtual void OnExit( Character* pCharacter );
        virtual bool OnButtonPressed( Character* pCharacter, Sequencer* pSeq )  { return false; }

    protected:
        // Number of characters currently residing in the trigger volume
        int mCharacterCount;

    private:
        // These methods defined as private and not implemented ensure that
        // clients will not be able to use them.  For example, we will
        // disallow AutomaticDoor from being copied and assigned.
        AutomaticDoor( const AutomaticDoor& );
        AutomaticDoor& operator=( const AutomaticDoor& );

};

};
#endif