| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311 |
- /*
- ** Command & Conquer Renegade(tm)
- ** Copyright 2025 Electronic Arts Inc.
- **
- ** This program is free software: you can redistribute it and/or modify
- ** it under the terms of the GNU General Public License as published by
- ** the Free Software Foundation, either version 3 of the License, or
- ** (at your option) any later version.
- **
- ** This program is distributed in the hope that it will be useful,
- ** but WITHOUT ANY WARRANTY; without even the implied warranty of
- ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ** GNU General Public License for more details.
- **
- ** You should have received a copy of the GNU General Public License
- ** along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- /***********************************************************************************************
- *** Confidential - Westwood Studios ***
- ***********************************************************************************************
- * *
- * Project Name : Commando *
- * *
- * $Archive:: /Commando/Code/Combat/staticnetworkobject.h $*
- * *
- * $Author:: Tom_s $*
- * *
- * $Modtime:: 10/16/01 3:56p $*
- * *
- * $Revision:: 11 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
- #if defined(_MSC_VER)
- #pragma once
- #endif
- #ifndef __STATICNETWORKOBJECT_H
- #define __STATICNETWORKOBJECT_H
- #include "networkobject.h"
- #include "vector.h"
- ////////////////////////////////////////////////////////////////
- // Forward delcarations
- ////////////////////////////////////////////////////////////////
- class StaticAnimPhysClass;
- class DoorNetworkObjectClass;
- class ElevatorNetworkObjectClass;
- class DSAPONetworkObjectClass;
- ////////////////////////////////////////////////////////////////
- //
- // StaticNetworkObjectClass
- //
- ////////////////////////////////////////////////////////////////
- class StaticNetworkObjectClass : public NetworkObjectClass
- {
- public:
- ////////////////////////////////////////////////////////////////
- // Public constructors/destructors
- ////////////////////////////////////////////////////////////////
- StaticNetworkObjectClass (void);
- ~StaticNetworkObjectClass (void);
- ////////////////////////////////////////////////////////////////
- // Public methods
- ////////////////////////////////////////////////////////////////
- //
- // Initialization
- //
- virtual void Initialize (StaticAnimPhysClass *phys_obj);
- virtual void Delete (void) {}
- //
- // Timestep support
- //
- virtual void Network_Think (void);
- //
- // Server-to-client state importing/exporting
- //
- virtual void Import_Rare (BitStreamClass &packet);
- virtual void Export_Rare (BitStreamClass &packet);
- //
- // Filtering support
- //
- virtual bool Get_World_Position (Vector3 &pos) const;
- virtual int Get_Vis_ID (void);
- //virtual float Compute_Object_Priority (int client_id, const Vector3 &client_pos);
- //
- // Static methods
- //
- static void Generate_Static_Network_Objects (void);
- static void Free_Static_Network_Objects (void);
- //
- // Type identification
- //
- virtual DoorNetworkObjectClass * As_Door_Network_Object_Class( void ) { return NULL; }
- virtual ElevatorNetworkObjectClass * As_Elevator_Network_Object_Class( void ) { return NULL; }
- virtual DSAPONetworkObjectClass * As_DSAPO_Network_Object_Class( void ) { return NULL; }
- //
- // Diagnostics
- //
- //virtual bool Is_Tagged(void) { return true; }
- static int Get_Static_Network_Object_Count (void) { return StaticNetworkObjectList.Count (); }
- static const StaticNetworkObjectClass * Get_Static_Network_Object (int index) { return StaticNetworkObjectList[index]; }
- protected:
- ////////////////////////////////////////////////////////////////
- // Protected member data
- ////////////////////////////////////////////////////////////////
- StaticAnimPhysClass * PhysObj;
- static DynamicVectorClass<StaticNetworkObjectClass *> StaticNetworkObjectList;
- private:
- ////////////////////////////////////////////////////////////////
- // Private member data
- ////////////////////////////////////////////////////////////////
- int AnimationMode;
- float LoopStart;
- float LoopEnd;
- float CurrFrame;
- float TargetFrame;
- };
- ////////////////////////////////////////////////////////////////
- //
- // DoorNetworkObjectClass
- //
- ////////////////////////////////////////////////////////////////
- class DoorNetworkObjectClass : public StaticNetworkObjectClass
- {
- public:
- ////////////////////////////////////////////////////////////////
- // Public constructor
- ////////////////////////////////////////////////////////////////
- /*
- DoorNetworkObjectClass (void) :
- DoorState (0) {}
- */
- DoorNetworkObjectClass (void);
- ////////////////////////////////////////////////////////////////
- // Public methods
- ////////////////////////////////////////////////////////////////
- //
- // Intialization
- //
- virtual void Initialize (StaticAnimPhysClass *phys_obj);
- //
- // Timestep support
- //
- virtual void Network_Think (void);
- //
- // Server-to-client state importing/exporting
- //
- virtual void Import_Rare (BitStreamClass &packet);
- virtual void Export_Rare (BitStreamClass &packet);
- //
- // Type identification
- //
- virtual DoorNetworkObjectClass * As_Door_Network_Object_Class( void ) { return this; }
- //
- // Diagnostics
- //
- //virtual bool Is_Tagged(void) { return false; }
- virtual void Get_Description(StringClass & description);
- private:
- ////////////////////////////////////////////////////////////////
- // Private member data
- ////////////////////////////////////////////////////////////////
- int DoorState;
- };
- ////////////////////////////////////////////////////////////////
- //
- // ElevatorNetworkObjectClass
- //
- ////////////////////////////////////////////////////////////////
- class ElevatorNetworkObjectClass : public StaticNetworkObjectClass
- {
- public:
- ////////////////////////////////////////////////////////////////
- // Public constructor
- ////////////////////////////////////////////////////////////////
- /*
- ElevatorNetworkObjectClass (void) :
- State (0),
- DoorStateTop (0),
- DoorStateBottom (0) {}
- */
- ElevatorNetworkObjectClass (void);
- //
- // Intialization
- //
- virtual void Initialize (StaticAnimPhysClass *phys_obj);
- //
- // Timestep support
- //
- virtual void Network_Think (void);
- //
- // Server-to-client state importing/exporting
- //
- virtual void Import_Rare (BitStreamClass &packet);
- virtual void Export_Rare (BitStreamClass &packet);
- //
- // Type identification
- //
- virtual ElevatorNetworkObjectClass * As_Elevator_Network_Object_Class( void ) { return this; }
- //
- // Diagnostics
- //
- //virtual bool Is_Tagged(void) { return true; }
- virtual void Get_Description(StringClass & description);
- private:
- ////////////////////////////////////////////////////////////////
- // Private member data
- ////////////////////////////////////////////////////////////////
- int State;
- int DoorStateTop;
- int DoorStateBottom;
- };
- ////////////////////////////////////////////////////////////////
- //
- // DSAPONetworkObjectClass
- //
- ////////////////////////////////////////////////////////////////
- class DSAPONetworkObjectClass : public StaticNetworkObjectClass
- {
- public:
- ////////////////////////////////////////////////////////////////
- // Public constructor
- ////////////////////////////////////////////////////////////////
- /*
- DSAPONetworkObjectClass (void) :
- Health (0) {
- */
- DSAPONetworkObjectClass (void);
- ////////////////////////////////////////////////////////////////
- // Public methods
- ////////////////////////////////////////////////////////////////
- //
- // Initialization
- //
- virtual void Initialize (StaticAnimPhysClass *phys_obj);
- //
- // Timestep support
- //
- virtual void Network_Think (void);
- //
- // Server-to-client state importing/exporting
- //
- virtual void Import_Rare (BitStreamClass &packet);
- virtual void Export_Rare (BitStreamClass &packet);
- //
- // Type identification
- //
- virtual DSAPONetworkObjectClass * As_DSAPO_Network_Object_Class( void ) { return this; }
- private:
- ////////////////////////////////////////////////////////////////
- // Private member data
- ////////////////////////////////////////////////////////////////
- float Health;
- };
- #endif // __STATICNETWORKOBJECT_H
|