1 //------------------------------------------------------------------------------
2 // File : SkyController.hpp
3 //------------------------------------------------------------------------------
4 // SkyWorks : Copyright 2002 Mark J. Harris and
5 // The University of North Carolina at Chapel Hill
6 //------------------------------------------------------------------------------
7 // Permission to use, copy, modify, distribute and sell this software and its
8 // documentation for any purpose is hereby granted without fee, provided that
9 // the above copyright notice appear in all copies and that both that copyright
10 // notice and this permission notice appear in supporting documentation.
11 // Binaries may be compiled with this software without any royalties or
14 // The author(s) and The University of North Carolina at Chapel Hill make no
15 // representations about the suitability of this software for any purpose.
16 // It is provided "as is" without express or
19 * @file SkyController.hpp
21 * Abstract base class for game object controllers.
23 #ifndef __SKYCONTROLLER_HPP__
24 #define __SKYCONTROLLER_HPP__
26 #include "SkyUtil.hpp"
29 //------------------------------------------------------------------------------
31 * @class SkyController
32 * @brief A class that defines an interface for translating general control input into game object control.
34 * This class abstracts game object control from specific control input, such
35 * as via user interface devices or via artificial intelligence. Subclasses of
36 * this class implement the method GetControlState() so that objects controlled
37 * by an instance of a SkyController can query the control state that determines
38 * their actions. The object need not know whether it is controlled by a human
39 * or the computer since either controller provides it the same interface.
43 template <typename ControlStateType>
50 virtual ~SkyController() {}
52 //! Fills out the control state structure passed in with the current state of controls.
53 virtual SKYRESULT GetControlState(ControlStateType &controlState) = 0;
56 #endif //__SKYCONTROLLER_HPP__