Free Electron
Cannon.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __intelligence_Cannon_h__
8 #define __intelligence_Cannon_h__
9 namespace fe
10 {
11 namespace ext
12 {
13 
14 /**************************************************************************//**
15  @brief Cannon RecordView
16 
17  @ingroup intelligence
18 *//***************************************************************************/
19 class FE_DL_EXPORT Cannon: public Targeter, public Periodic
20 {
21  public:
22  Functor<F32> launchSpeed;
23  Functor<String> launchSong;
24  Functor<String> projectile;
25 
26  Cannon(void) { setName("Cannon"); }
27 virtual void addFunctors(void)
28  {
31 
32  add(launchSpeed, FE_SPEC("ai:launchSpeed",
33  "Muzzle velocity"));
34  add(launchSong, FE_SPEC("ai:launchSong",
35  "sound for each shot"));
36  add(projectile, FE_SPEC("ai:projectile",
37  "Layout name of bullet"));
38  }
39 virtual void initializeRecord(void)
40  {
43 
44  identifier()="cannon";
45  periodMS()=1000;
46  launchSpeed()=1.0f;
47  }
48 };
49 
50 } /* namespace ext */
51 } /* namespace fe */
52 
53 #endif /* __intelligence_Cannon_h__ */
kernel
Definition: namespace.dox:3
Bound accessor in a RecordView.
Definition: RecordView.h:147
Periodic RecordView.
Definition: Periodic.h:19
virtual void initializeRecord(void)
Called at instantiation to initialize attributes.
Definition: Cannon.h:39
virtual void addFunctors(void)
Called at instantiation to add functors.
Definition: Targeter.h:26
virtual void initializeRecord(void)
Called at instantiation to initialize attributes.
Definition: Targeter.h:35
virtual void initializeRecord(void)
Called at instantiation to initialize attributes.
Definition: Periodic.h:36
Targeter RecordView.
Definition: Targeter.h:19
Cannon RecordView.
Definition: Cannon.h:19
virtual void addFunctors(void)
Called at instantiation to add functors.
Definition: Cannon.h:27
virtual void addFunctors(void)
Called at instantiation to add functors.
Definition: Periodic.h:27