Files
TeslaRel410/CODE/BT/BT/BTTEAM.CPP
T
CydandClaude Fable 5 fdd9ac9d97 Initial import: Tesla Release 4.10 (Tesla:BattleTech & Tesla:Red Planet)
Archival snapshot of the Virtual World Entertainment Tesla cockpit
software, 1994-1996: MUNGA engine and L4 pod layer source (Borland
C++ 5.0), BT/RP game code, and game content (models, audio, maps,
gauges, Division renderer data). Includes third-party libraries:
Division dVS/DPL graphics, HMI SOS audio, WATTCP networking.

Files are preserved byte-for-byte (.gitattributes disables all
line-ending conversion). README.md documents the layout, target
hardware, and toolchain.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 13:21:58 -05:00

153 lines
4.1 KiB
C++

//===========================================================================//
// File: btteam.cpp //
// Project: BattleTech //
// Contents: BattleTech Team Specifications //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 01/11/96 JM initial coding //
//---------------------------------------------------------------------------//
// 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(BTTEAM_HPP)
# include <btteam.hpp>
#endif
#if !defined(HOSTMGR_HPP)
# include <hostmgr.hpp>
#endif
#if !defined(APP_HPP)
# include <app.hpp>
#endif
#if !defined(BTCNSL_HPP)
# include <btcnsl.hpp>
#endif
//#############################################################################
//############################### BTTeam ###############################
//#############################################################################
//#############################################################################
// Shared Data Support
//
Derivation
BTTeam::ClassDerivations(Team::ClassDerivations,"BTTeam");
BTTeam::SharedData
BTTeam::DefaultData(
BTTeam::ClassDerivations,
BTTeam::MessageHandlers,
BTTeam::AttributeIndex,
BTTeam::StateCount,
(BTTeam::MakeHandler)BTTeam::Make
);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void
BTTeam::TeamSimulation(
Scalar // time_slice
)
{
Check(this);
//
//------------------------------------------------------------------------
// Update the console every 15 seconds
//------------------------------------------------------------------------
//
if (lastPerformance - lastConsoleUpdate >= 15.0f)
{
lastConsoleUpdate = lastPerformance;
//
//---------------------------------------------
// Tell the console (if there is one) our score
//---------------------------------------------
//
Check(application);
HostManager *host_manager = application->GetHostManager();
Check(host_manager);
Host *console_host = host_manager->GetConsoleHost();
if (console_host)
{
Check(console_host);
ConsoleBTTeamScoreUpdateMessage
score_message(ownerID, (int)teamScore);
application->SendMessage(
console_host->GetHostID(),
NetworkClient::ConsoleClientID,
&score_message
);
}
}
Check_Fpu();
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
BTTeam::BTTeam(
MakeMessage *creation_message,
SharedData &shared_data
) :
Team (creation_message, shared_data)
{
lastConsoleUpdate = lastPerformance;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
BTTeam::~BTTeam()
{
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
BTTeam*
BTTeam::Make(MakeMessage *creation_message)
{
Check_Fpu();
return new BTTeam(creation_message);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
Logical
BTTeam::CreateMakeMessage(
MakeMessage *creation_message,
NotationFile *model_file,
const ResourceDirectories *directories
)
{
Check(creation_message);
Check(model_file);
if (!Team::CreateMakeMessage(creation_message, model_file, directories))
{
return False;
}
creation_message->classToCreate = BTTeamClassID;
return True;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
Logical
BTTeam::TestInstance() const
{
return IsDerivedFrom(ClassDerivations);
}