Line data Source code
1 : /* Copyright (C) 2010 Wildfire Games.
2 : * This file is part of 0 A.D.
3 : *
4 : * 0 A.D. is free software: you can redistribute it and/or modify
5 : * it under the terms of the GNU General Public License as published by
6 : * the Free Software Foundation, either version 2 of the License, or
7 : * (at your option) any later version.
8 : *
9 : * 0 A.D. is distributed in the hope that it will be useful,
10 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 : * GNU General Public License for more details.
13 : *
14 : * You should have received a copy of the GNU General Public License
15 : * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16 : */
17 :
18 : #ifndef INCLUDED_ICMPPROJECTILEMANAGER
19 : #define INCLUDED_ICMPPROJECTILEMANAGER
20 :
21 : #include "simulation2/system/Interface.h"
22 :
23 : #include "maths/Fixed.h"
24 : #include "maths/FixedVector3D.h"
25 :
26 : /**
27 : * Projectile manager. This deals with the rendering and the graphical motion of projectiles.
28 : * (The gameplay effects of projectiles are not handled here - the simulation code does that
29 : * with timers, this just does the visual aspects, because it's simpler to keep the parts separated.)
30 : */
31 6 : class ICmpProjectileManager : public IComponent
32 : {
33 : public:
34 :
35 : /**
36 : * Launch a projectile from entity @p source to point @p target.
37 : * @param source source entity; the projectile will determined from the "projectile" prop in its actor
38 : * @param target target point
39 : * @param speed horizontal speed in m/s
40 : * @param gravity gravitational acceleration in m/s^2 (determines the height of the ballistic curve)
41 : * @param actorName name of the flying projectile actor
42 : * @param impactActorName name of the animation actor played when the projectile hits the target or the ground
43 : * @param impactAnimationLifetime animation lenth
44 : * @return id of the created projectile
45 : */
46 : virtual uint32_t LaunchProjectileAtPoint(const CFixedVector3D& launchPoint, const CFixedVector3D& target, fixed speed, fixed gravity, const std::wstring& actorName, const std::wstring& impactActorName, fixed impactAnimationLifetime) = 0;
47 :
48 : /**
49 : * Removes a projectile, used when the projectile has hit a target
50 : * @param id of the projectile to remove
51 : */
52 : virtual void RemoveProjectile(uint32_t id) = 0;
53 :
54 116 : DECLARE_INTERFACE_TYPE(ProjectileManager)
55 : };
56 :
57 : #endif // INCLUDED_ICMPPROJECTILEMANAGER
|