//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
#ifndef _FG_MULTIPLAY_HXX
#include STL_STRING
-#include <simgear/scene/model/model.hxx>
+#include <simgear/props/props.hxx>
#include <Main/globals.hxx>
#include <Main/fg_props.hxx>
*
******************************************************************/
-#include <simgear/props/props.hxx>
-
class FGMultiplay : public FGProtocol {
public:
/** Enables the FGMultiplay object. */
bool open();
- /** Tells the multiplayer_mgr to send/receive data. */
+ /** Tells the multiplayer_mgr to send/receive data.
+ */
bool process();
- /** Closes the multiplayer_mgr. */
+ /** Closes the multiplayer_mgr.
+ */
bool close();
-
private:
- struct _node_cache {
- double val;
- SGPropertyNode_ptr node;
- _node_cache(double v, SGPropertyNode_ptr n) {
- val = v; node = n;
- };
- };
-
- /** calculate accelerations
- */
- void calcAcc(double speedN, double speedE, double speedD);
-
- double last_time ; //sec
- double last_speedN, last_speedE, last_speedD; //fps
- double calcaccN, calcaccE, calcaccD; //fps2
-
- SGPropertyNode *lat_n, *lon_n, *alt_n;
- SGPropertyNode *heading_n, *pitch_n, *roll_n;
- SGPropertyNode *speedN_n, *speedE_n, *speedD_n;
- SGPropertyNode *left_aileron_n, *right_aileron_n;
- SGPropertyNode *elevator_n, *rudder_n;
- // SGPropertyNode *rpms[5];
- SGPropertyNode *rateH_n, *rateR_n, *rateP_n;
-
- map<string,struct _node_cache*> props;
- map<string,struct _node_cache*>::iterator propit;
+ // Map between the property id's from the multiplayers network packets
+ // and the property nodes
+ typedef std::map<unsigned, SGSharedPtr<SGPropertyNode> > PropertyMap;
+ PropertyMap mPropertyMap;
};
+
+
#endif // _FG_MULTIPLAY_HXX