AutomaticBazooka Class Reference

#include <auto_bazooka.h>

Inheritance diagram for AutomaticBazooka:

Inheritance graph
[legend]
Collaboration diagram for AutomaticBazooka:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AutomaticBazooka ()
void Draw ()
bool IsReady () const
virtual void ChooseTarget (Point2i mouse_pos)
AutomaticBazookaConfigcfg ()

Protected Member Functions

void Refresh ()
void p_Select ()
void p_Deselect ()
void DrawTarget ()
WeaponProjectileGetProjectileInstance ()

Private Attributes

AutomaticBazooka::target_t m_target

Classes

struct  target_t

Detailed Description

Definition at line 54 of file auto_bazooka.h.


Constructor & Destructor Documentation

AutomaticBazooka::AutomaticBazooka (  ) 

Definition at line 150 of file auto_bazooka.cpp.

00150                                    :
00151   WeaponLauncher(WEAPON_AUTOMATIC_BAZOOKA, "automatic_bazooka",new AutomaticBazookaConfig() )
00152 {
00153   m_name = _("Automatic Bazooka");
00154   mouse_character_selection = false;
00155   m_allow_change_timeout = true;
00156   m_target.selected = false;
00157   m_target.image = resource_manager.LoadImage( weapons_res_profile, "baz_cible");
00158   ReloadLauncher();
00159 }

Here is the call graph for this function:


Member Function Documentation

AutomaticBazookaConfig & AutomaticBazooka::cfg (  ) 

Reimplemented from WeaponLauncher.

Definition at line 232 of file auto_bazooka.cpp.

00232                                               {
00233     return static_cast<AutomaticBazookaConfig &>(*extra_params);
00234 }

Here is the caller graph for this function:

void AutomaticBazooka::ChooseTarget ( Point2i  mouse_pos  )  [virtual]

Reimplemented from Weapon.

Definition at line 201 of file auto_bazooka.cpp.

00202 {
00203   if (m_target.selected) {
00204     // need to clear the old target
00205     world.ToRedrawOnMap(Rectanglei(m_target.pos.x-m_target.image.GetWidth()/2,
00206                         m_target.pos.y-m_target.image.GetHeight()/2,
00207                         m_target.image.GetWidth(),
00208                         m_target.image.GetHeight()));
00209   }
00210 
00211   m_target.pos = mouse_pos;
00212   m_target.selected = true;
00213 
00214   if(!ActiveTeam().IsLocal())
00215     camera.SetXYabs(mouse_pos - camera.GetSize()/2);
00216   DrawTarget();
00217   static_cast<RPG *>(projectile)->SetTarget(m_target.pos.x, m_target.pos.y);
00218 }

Here is the call graph for this function:

void AutomaticBazooka::Draw (  )  [virtual]

Reimplemented from WeaponLauncher.

Definition at line 167 of file auto_bazooka.cpp.

00168 {
00169   WeaponLauncher::Draw();
00170   DrawTarget();
00171 }

Here is the call graph for this function:

void AutomaticBazooka::DrawTarget (  )  [protected]

Definition at line 220 of file auto_bazooka.cpp.

00221 {
00222   if( !m_target.selected ) return;
00223 
00224   AppWormux::GetInstance()->video.window.Blit(m_target.image, m_target.pos - m_target.image.GetSize()/2 - camera.GetPosition());
00225 }

Here is the call graph for this function:

Here is the caller graph for this function:

WeaponProjectile * AutomaticBazooka::GetProjectileInstance (  )  [protected, virtual]

Implements WeaponLauncher.

Definition at line 161 of file auto_bazooka.cpp.

00162 {
00163   return dynamic_cast<WeaponProjectile *>
00164       (new RPG(cfg(),dynamic_cast<WeaponLauncher *>(this)));
00165 }

Here is the call graph for this function:

bool AutomaticBazooka::IsReady (  )  const [virtual]

Reimplemented from Weapon.

Definition at line 227 of file auto_bazooka.cpp.

00228 {
00229   return (EnoughAmmo() && m_target.selected);
00230 }

Here is the call graph for this function:

void AutomaticBazooka::p_Deselect (  )  [protected, virtual]

Reimplemented from WeaponLauncher.

Definition at line 187 of file auto_bazooka.cpp.

00188 {
00189   WeaponLauncher::p_Deselect();
00190   if (m_target.selected) {
00191     // need to clear the old target
00192     world.ToRedrawOnMap(Rectanglei(m_target.pos.x-m_target.image.GetWidth()/2,
00193                         m_target.pos.y-m_target.image.GetHeight()/2,
00194                         m_target.image.GetWidth(),
00195                         m_target.image.GetHeight()));
00196   }
00197 
00198   Mouse::GetInstance()->SetPointer(Mouse::POINTER_SELECT);
00199 }

Here is the call graph for this function:

void AutomaticBazooka::p_Select (  )  [protected, virtual]

Reimplemented from WeaponLauncher.

Definition at line 179 of file auto_bazooka.cpp.

00180 {
00181   WeaponLauncher::p_Select();
00182   m_target.selected = false;
00183 
00184   Mouse::GetInstance()->SetPointer(Mouse::POINTER_AIM);
00185 }

Here is the call graph for this function:

void AutomaticBazooka::Refresh (  )  [protected, virtual]

Reimplemented from WeaponLauncher.

Definition at line 173 of file auto_bazooka.cpp.

00174 {
00175   DrawTarget();
00176   WeaponLauncher::Refresh();
00177 }

Here is the call graph for this function:


Member Data Documentation

struct AutomaticBazooka::target_t AutomaticBazooka::m_target [private]


The documentation for this class was generated from the following files:
Generated on Mon Jan 1 13:34:56 2007 for Wormux by  doxygen 1.4.7