Emitter : MechWeapon -- energy-weapon (beam) base. Both surviving weapon leaves (PPC.CPP, GAUSS.CPP/GaussRifle) derive from it and now compile against the real base. Ctor chains MechWeapon + inits chargeLevel/dischargeTime; statics/dtor/test real; FireWeapon (beam discharge) + CreateStreamedSubsystem staged. BT: 33 ok. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
101 lines
2.5 KiB
C++
101 lines
2.5 KiB
C++
//===========================================================================//
|
|
// 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 <bt.hpp>
|
|
#pragma hdrstop
|
|
|
|
#if !defined(EMITTER_HPP)
|
|
# include <emitter.hpp>
|
|
#endif
|
|
|
|
#if !defined(MECH_HPP)
|
|
# include <mech.hpp>
|
|
#endif
|
|
|
|
Derivation
|
|
Emitter::ClassDerivations(
|
|
MechWeapon::ClassDerivations,
|
|
"Emitter"
|
|
);
|
|
|
|
Emitter::SharedData
|
|
Emitter::DefaultData(
|
|
Emitter::ClassDerivations,
|
|
Subsystem::MessageHandlers,
|
|
Subsystem::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;
|
|
}
|