Module Header Template (RickJ): Difference between revisions

From Adventure Game Studio | Wiki
Jump to navigation Jump to search
(Also added to category "Advanced Tutorials")
No edit summary
 
Line 2: Line 2:
<pre>
<pre>
//===================================================================
//===================================================================
// *** AGS MODULE SCRIPT ***
// *** AGS MODULE HEADER ***
//
//
// Module: {Module's name}
// Module: <module name>
//
//
// Author: {First} {Last} {(ForumName)}
// Author: <first name> <last name> (<forum name>)
//
//
// 1 Abstract
// Copyright (C) yyyy <holder>
// {paragraph describing what module does}
//       
// 2 Revision History
// {YY-MM-dd Name  item description }
//
// 3 License
// 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 2
// 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, write to the Free
// Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA  02111-1307, USA.
//
// Copyright (C) {yyyy} {name of copyright holder}
//-------------------------------------------------------------------
//-------------------------------------------------------------------


//===================================================================
//===================================================================
// Constant Definition
// Dependancies:
// The following constant definitions allow the compiler to check for
// module  dependencies and to issue appropiate error messages when a
// required module is not installed. There should be a definition for
// the current version and all previous compatiable versions.
//-------------------------------------------------------------------
//-------------------------------------------------------------------
// Define this module's version info
#define ModuleName_VERSION 0100
#define ModuleName_VERSION_0100
// Check for correct AGS version
#ifdef AGS_SUPPORTS_IFVER
#ifnver 2.72
#error Module ModuleName requires AGS V2.72 or above
#endif
#endif
// Check for required module/version
#ifndef RequiredModuleName_VERSION_0200
#error Module ModuleName requires RequiredModuleName V2.00 or above
#endif


//===================================================================
//===================================================================
// Enumerated Data Types
// Configuration:
// The following constant definitions are used to modify the behavior
// of this module. 
//-------------------------------------------------------------------
//-------------------------------------------------------------------
#define ModuleName_CONFIGPARAM 10


//===================================================================
//===================================================================
// Global Variables
// Return Values:
// The following constant definitions represent possible return value
// of functions contained in this module.
//-------------------------------------------------------------------
//-------------------------------------------------------------------
#define ModuleName_RETURNVAL 100


//===================================================================
//===================================================================
// Global Functions
// Enumerated Types:
// The following enumerated data types are defined by this module.
//-------------------------------------------------------------------
//-------------------------------------------------------------------
enum ModuleName_Type {
eModuleName_Value1,
eModuleName_Value2
};


//===================================================================
//===================================================================
// Structure-1
  struct ModuleName  {
//
// The following structure contains the definition of a menu item.
//-------------------------------------------------------------------
//-------------------------------------------------------------------
// Public Data
int VariableName;
// Public Static Methods
import static function FunctionName();


//===================================================================
// Public Methods
// Structure-2
import function FunctionName();
//-------------------------------------------------------------------
 
  // Private Data
protected int variable_name;
 
// Private Methods
protected import function function_name();
};
</pre>
</pre>


[[Category:Scripting]][[Category:Advanced Tutorials]]
[[Category:Scripting]][[Category:Advanced Tutorials]]

Latest revision as of 15:07, 29 July 2008

RickJ's module header template:

//===================================================================
// *** AGS MODULE HEADER ***
//
// Module: <module name>
//
// Author: <first name> <last name> (<forum name>)
//
// Copyright (C) yyyy  <holder>
//-------------------------------------------------------------------

//===================================================================
// Dependancies:
// The following constant definitions allow the compiler to check for
// module  dependencies and to issue appropiate error messages when a
// required module is not installed. There should be a definition for
// the current version and all previous compatiable versions. 
//-------------------------------------------------------------------
	// Define this module's version info
	#define ModuleName_VERSION 0100
	#define ModuleName_VERSION_0100

	// Check for correct AGS version
	#ifdef AGS_SUPPORTS_IFVER
	#ifnver 2.72
	#error Module ModuleName requires AGS V2.72 or above
	#endif
	#endif

	// Check for required module/version 
	#ifndef RequiredModuleName_VERSION_0200
	#error Module ModuleName requires RequiredModuleName V2.00 or above
	#endif


//===================================================================
// Configuration:
// The following constant definitions are used to modify the behavior
// of this module.  
//-------------------------------------------------------------------
	#define ModuleName_CONFIGPARAM		10


//===================================================================
// Return Values:
// The following constant definitions represent possible return value
// of functions contained in this module. 
//-------------------------------------------------------------------
	#define ModuleName_RETURNVAL		100


//===================================================================
// Enumerated Types:
// The following enumerated data types are defined by this module. 
//-------------------------------------------------------------------
	enum ModuleName_Type {
		eModuleName_Value1,
		eModuleName_Value2
	};


//===================================================================
   struct ModuleName  {
//
// The following structure contains the definition of a menu item.
//-------------------------------------------------------------------
	// Public Data
	int	VariableName;

	// Public Static Methods
	import static function FunctionName();

	// Public Methods
	import function FunctionName();

   	// Private Data
	protected int	variable_name;

	// Private Methods
	protected import function function_name();
};