Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
LoopedAnimationController.h
1/* Renegade Scripts.dll
2 Copyright 2013 Tiberian Technologies
3
4 This file is part of the Renegade scripts.dll
5 The Renegade scripts.dll is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2, or (at your option) any later
8 version. See the file COPYING for more details.
9 In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence.
10 Only the source code to the module(s) containing the licenced code has to be released.
11*/
12#pragma once
13
14#include "scripts.h"
15
30class LoopedAnimationController : public GameObjObserverClass
31{
32public:
38 LoopedAnimationController ( GameObject* pObj );
39
42
43
55 void PlayAnimation ( const char* animation, int startFrame, int endFrame, int nRepetitions = 0 );
56
58 void StopAnimation();
59
60
61protected:
62 // These are observer events we actually use
63 virtual void Attach ( GameObject* pObj );
64 virtual void Detach ( GameObject* pObj );
65 virtual void Animation_Complete ( GameObject *pObj, const char *animation_name );
66
67
68 // These are observer events we don't use but have to provide an implementation for to compile
69 virtual void Created(GameObject* pObj) {};
70 virtual void Destroyed(GameObject* pObj) {};
71 virtual void Killed(GameObject* pObj,GameObject* pKiller) {};
72 virtual void Damaged(GameObject* pObj,GameObject* pDamager,float amount) {};
73 virtual void Custom(GameObject* pObj,int type,int param,GameObject* pSender) {};
74 virtual void Sound_Heard(GameObject* pObj,const CombatSound & sound) {};
75 virtual void Enemy_Seen(GameObject* pObj,GameObject* pEnemy) {};
76 virtual void Action_Complete(GameObject* pObj,int action_id,ActionCompleteReason complete_reason) {};
77 virtual void Timer_Expired(GameObject* pObj,int number) {};
78 virtual void Poked(GameObject* pObj,GameObject* pPoker) {};
79 virtual void Entered(GameObject* pObj,GameObject* pEnterer) {};
80 virtual void Exited(GameObject* pObj,GameObject* pExiter) {};
81
82
83 // We also need to provide an implementation for Get_Name to compile
84 virtual const char* Get_Name() { return "LoopedAnimationController"; }
85
86
87
88private:
90 int m_objID;
91
94 char* m_animationName;
95
97 int m_startFrame;
98
100 int m_endFrame;
101
104 int m_nRepetitions;
105};
Controller for looped animations using a subset of frames.
Definition LoopedAnimationController.h:31
~LoopedAnimationController()
Definition LoopedAnimationController.cpp:31
void StopAnimation()
Definition LoopedAnimationController.cpp:72
LoopedAnimationController(GameObject *pObj)
Definition LoopedAnimationController.cpp:20
void PlayAnimation(const char *animation, int startFrame, int endFrame, int nRepetitions=0)
Definition LoopedAnimationController.cpp:44