The robot function platform of the online Fox platform has been implemented, and all interfaces have been defined. You only need to implement this interface.
Class candroiduseritemsink: Public iandroiduseritemsink
{
// Control variable
Protected:
Cgamelogic m_gamelogic; // game logic
Iandroiduseritem * m_piandroiduseritem; // user interface
// Function Definition
Public:
// Constructor
Candroiduseritemsink ();
// Destructor
Virtual ~ Candroiduseritemsink ();
// Basic interface
Public:
// Release the object
Virtual void _ cdecl release () {}// if (isvalid () {Delete this ;} return;
// Valid or not
Virtual bool _ cdecl isvalid () {return afxisvalidaddress (this, sizeof (candroiduseritemsink ))? True: false ;}
// Interface Query
Virtual void * _ cdecl QueryInterface (const IID & guid, DWORD dwqueryver );
// Control Interface
Public:
// Initial interface
Virtual bool _ cdecl inituseritemsink (iunknownex * piunknownex );
// Reset the interface
Virtual bool _ cdecl reposituseritemsink ();
// Game events
Public:
// Time Message
Virtual bool _ cdecl oneventtimer (uint ntimerid );
// Game message
Virtual bool _ cdecl oneventgamemessage (word wsubcmdid, void * pdata, word wdatasize );
// Game message
Virtual bool _ cdecl oneventframemessage (word wsubcmdid, void * pdata, word wdatasize );
// Scenario message
Virtual bool _ cdecl oneventgamescene (byte cbgamestatus, bool blookonother, void * pdata, word wdatasize );
// User event
Public:
// Enter
Virtual void _ cdecl oneventuserenter (iandroiduseritem * piandroiduseritem, bool blookonuser );
// The user leaves
Virtual void _ cdecl oneventuserleave (iandroiduseritem * piandroiduseritem, bool blookonuser );
// User points
Virtual void _ cdecl oneventuserscore (iandroiduseritem * piandroiduseritem, bool blookonuser );
// User status
Virtual void _ cdecl oneventuserstatus (iandroiduseritem * piandroiduseritem, bool blookonuser );
// User Field
Virtual void _ cdecl oneventusersegment (iandroiduseritem * piandroiduseritem, bool blookonuser );
}
The implementation of this interface is actually very simple. The robot is a game player cgameclientdlg that has implemented all the functions. We just need to implement these functions again in the machine human, if the communication between various game modules is the blood of the life process, the game's operation interface is the body of a living body,
Ordinary game players need an interface to achieve a beautiful and user-friendly operation effect, while robots have no flesh and blood, but there is no lack of smooth blood, blood surging, the robot has a soul, because our job is to ensure that robots have souls! A simple method is to copy all the functions in cgameclientdlg and remove the code for all interface operations! It's easy. Isn't it as much trouble as we thought!