//===========================================================================// // File: myomers.hpp // // Project: BattleTech Brick: Mech subsystems // // Contents: Myomers -- the artificial-muscle (locomotion power) subsystem // //---------------------------------------------------------------------------// // Copyright (C) 1995, Virtual World Entertainment, Inc. // // All Rights reserved worldwide // // This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL // //===========================================================================// #if !defined(MYOMERS_HPP) # define MYOMERS_HPP # if !defined(POWERSUB_HPP) # include # endif //##################### Forward Class Declarations ####################### class Mech; //########################################################################### //#################### Myomers Model Resource ########################## //########################################################################### struct Myomers__SubsystemResource: public PoweredSubsystem::SubsystemResource { Scalar velocityEfficiency; Scalar accelerationEfficiency; Scalar seekVoltage[5]; int seekVoltageRecommendedIndex; }; //########################################################################### //############################## Myomers ############################### //########################################################################### class Myomers: public PoweredSubsystem { public: static Derivation ClassDerivations; static SharedData DefaultData; typedef void (Myomers::*Performance)(Scalar time_slice); void SetPerformance(Performance performance) { Check(this); activePerformance = (Simulation::Performance)performance; } static Logical TestClass(Mech &); Logical TestInstance() const; void MyomersSimulation(Scalar time_slice); public: typedef Myomers__SubsystemResource SubsystemResource; Myomers( Mech *owner, int subsystem_ID, SubsystemResource *subsystem_resource, SharedData &shared_data = DefaultData ); ~Myomers(); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Attribute publication. The shipped binary's string pool lists this // class's attribute names contiguously, immediately after the class name // "Myomers" and its ToggleSeekVoltage message: // // SpeedEffect CurrentSeekVoltageIndex RecommendedSeekVoltageIndex // MinSeekVoltageIndex MaxSeekVoltageIndex SeekVoltage // // -- which is EXACTLY the order of the members below, so the // reconstruction's layout matches the original and the ids can be // pinned faithfully rather than guessed. SpeedEffect is the one an // authored AttributeWatcher in BTL4.RES binds (the myomer whine). // public: enum { SpeedEffectAttributeID = PoweredSubsystem::NextAttributeID, CurrentSeekVoltageIndexAttributeID, RecommendedSeekVoltageIndexAttributeID, MinSeekVoltageIndexAttributeID, MaxSeekVoltageIndexAttributeID, SeekVoltageAttributeID, NextAttributeID }; static const IndexEntry AttributePointers[]; static AttributeIndexSet AttributeIndex; protected: Scalar speedEffect; int currentSeekVoltageIndex; int recommendedSeekVoltageIndex; int minSeekVoltageIndex; int maxSeekVoltageIndex; Scalar seekVoltage[5]; Scalar heatRange; Scalar heatRangeSquared; Scalar velocityEfficiency; Scalar accelerationEfficiency; }; #endif