//===========================================================================// // File: gauss.hh // // Project: BT Brick: Entity Manager // // Contents: Gauss Rifle class, derives from Projectile Weapon // //---------------------------------------------------------------------------// // Date Who Modification // // -------- --- ---------------------------------------------------------- // // 04/13/95 JM Initial coding. // // 07/19/95 GDU Complied to new munga, added new electrical behavior // //---------------------------------------------------------------------------// // Copyright (C) 1995, Virtual World Entertainment, Inc. All Rights reserved // // // // PROPRIETARY AND CONFIDENTIAL // //===========================================================================// #if !defined (GAUSS_HPP) #define GAUSS_HPP #if !defined(EMITTER_HPP) # include #endif //##################### Forward Class Declarations ####################### class Mech; class Projectile; //########################################################################### //######################### GaussRifle Model Resource ######################## //########################################################################### struct GaussRifle__SubsystemResource: public Emitter::SubsystemResource { Scalar dischargeVoltage; }; //########################################################################### //######################### CLASS -- GaussRifle ########################## //########################################################################### class GaussRifle : public Emitter { //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Shared Data Support // public: static Derivation ClassDerivations; static SharedData DefaultData; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Messageing Support // #if 0 //########################################################################## // Attribute Support // public: enum { = Emitter::NextAttributeID, NextAttributeID }; private: static const IndexEntry AttributePointers[]; public: static AttributeIndexSet AttributeIndex; #endif //########################################################################## // Model Support // public: typedef void (GaussRifle::*Performance)(Scalar time_slice); void SetPerformance(Performance performance) { Check(this); activePerformance = (Simulation::Performance)performance; } void GaussRifleSimulation(Scalar time_slice); //########################################################################## // TestClass Support // public: static Logical TestClass(Mech &); void ResetToInitialState(); //########################################################################## // Construction and Destruction // public: typedef GaussRifle__SubsystemResource SubsystemResource; GaussRifle( Mech *owner, int subsystem_ID, SubsystemResource *subsystem_resource, SharedData &shared_data=DefaultData ); ~GaussRifle(); Logical TestInstance() const; static int CreateStreamedSubsystem( ResourceFile *resource_file, NotationFile *model_file, const char *model_name, const char *subsystem_name, SubsystemResource *subsystem_resource, NotationFile *subsystem_file, const ResourceDirectories *directories, int passes =1 ); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Local data for the gun class // protected: void FireWeapon(); Vector3D muzzleVelocity; // @0x478 (past Emitter 0x478) -- ends 0x484 friend struct GaussRifleLayoutCheck; }; struct GaussRifleLayoutCheck { static_assert(offsetof(GaussRifle, muzzleVelocity) == 0x478, "GaussRifle::muzzleVelocity @0x478 (Emitter must end 0x478)"); static_assert(sizeof(GaussRifle) == 0x484, "sizeof(GaussRifle) 0x484 (== factory alloc)"); }; #endif