//===========================================================================// // File: emitter.cpp // // Project: BattleTech Brick: Mech weapons // // Contents: Emitter -- the energy-weapon (beam) base // //---------------------------------------------------------------------------// // Copyright (C) 1995, Virtual World Entertainment, Inc. // // All Rights reserved worldwide // // This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL // //===========================================================================// #include #pragma hdrstop #if !defined(EMITTER_HPP) # include #endif #if !defined(MECH_HPP) # include #endif Derivation Emitter::ClassDerivations( MechWeapon::ClassDerivations, "Emitter" ); // //############################################################################# // Attribute Support. Emitter publishes the beam charge level (ChargeLevel): // the HUD weapon-charge gauge binds to it, and -- load-bearing -- GaussRifle's // AttributeIndex chains THIS index (GAUSS.CPP), and PPC::DefaultData binds it // via the inherited PPC::AttributeIndex. It MUST be a real defined index // chained to Subsystem::AttributeIndex, not the bare base (a declared-but- // undefined Emitter::AttributeIndex leaves activeAttributeIndex NULL and // faults the first GetAttributePointer on any PPC/Gauss). //############################################################################# // const Emitter::IndexEntry Emitter::AttributePointers[]= { ATTRIBUTE_ENTRY(Emitter, ChargeLevel, chargeLevel) }; Emitter::AttributeIndexSet Emitter::AttributeIndex( ELEMENTS(Emitter::AttributePointers), Emitter::AttributePointers, Subsystem::AttributeIndex ); Emitter::SharedData Emitter::DefaultData( Emitter::ClassDerivations, Subsystem::MessageHandlers, Emitter::AttributeIndex, Subsystem::StateCount ); Emitter::Emitter( Mech *owner, int subsystem_ID, SubsystemResource *subsystem_resource, SharedData &shared_data ): MechWeapon(owner, subsystem_ID, subsystem_resource, shared_data) { Check(owner); Check_Pointer(subsystem_resource); chargeLevel = 0.0f; dischargeTime = subsystem_resource->dischargeTime; Check_Fpu(); } Emitter::~Emitter() { } Logical Emitter::TestClass(Mech &) { return True; } Logical Emitter::TestInstance() const { return IsDerivedFrom(ClassDerivations); } // //############################################################################# // FireWeapon The energy-beam discharge. Not yet reconstructed (the fire path // is exercised in combat, past the current ctor frontier). //############################################################################# // void Emitter::FireWeapon() { Fail("Emitter::FireWeapon -- emitter.cpp not yet reconstructed"); } // //############################################################################# // CreateStreamedSubsystem Model-load-time construction. Not yet reconstructed. //############################################################################# // int Emitter::CreateStreamedSubsystem( ResourceFile *, NotationFile *, const char *, const char *, SubsystemResource *, NotationFile *, const ResourceDirectories *, int ) { Fail("Emitter::CreateStreamedSubsystem -- emitter.cpp not yet reconstructed"); return 0; }