Changeset 7298
- Timestamp:
- Aug 31, 2010, 8:56:01 PM (14 years ago)
- Location:
- code/branches/doc/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/doc/src/libraries/core/XMLPort.h
r7297 r7298 69 69 70 70 In the XML file, a param or attribute will be set like this: 71 @code 71 72 <classname paramname="value" /> 73 @endcode 72 74 73 75 The macro will then call loadfunction(value) to set the given value (or call savefunction() to … … 88 90 89 91 In the XML file, a param or attribute will be set like this: 92 @code 90 93 <classname paramname="value" /> 94 @endcode 91 95 92 96 The macro will then store "value" in the variable or read it when saving. … … 212 216 likely the best option, so this is usually true. 213 217 214 @ note218 @details 215 219 The load- and savefunctions have to follow an exactly defined protocol. 216 220 Loadfunction: 217 221 The loadfunction gets a pointer to the object. 218 > void loadfunction(objectclass* pointer); 222 @code 223 void loadfunction(objectclass* pointer); 224 @endcode 219 225 220 226 Savefunction: … … 222 228 gets called again, but with index + 1. It's the functions responsibility to do something smart 223 229 with the index and to return 0 if all objects were returned. 224 > objectclass* savefunction(unsigned int index) const; 230 @code 231 objectclass* savefunction(unsigned int index) const; 232 @endcode 225 233 226 234 Possible implementation: 235 @code 227 236 objectclass* savefunction(unsigned int index) const 228 237 { … … 232 241 return 0; 233 242 } 243 @endcode 234 244 235 245 Example: 236 246 Possible usage of the macro: 237 > XMLPortObject(SpaceShip, Weapon, "weapons", addWeapon, getWeapon, xmlelement, mode, false, true); 247 @code 248 XMLPortObject(SpaceShip, Weapon, "weapons", addWeapon, getWeapon, xmlelement, mode, false, true); 249 @endcode 238 250 239 251 Now you can add weapons through the XML file: 252 @code 240 253 <SpaceShip someattribute="..." ...> 241 254 <weapons> … … 245 258 </weapons> 246 259 </SpaceShip> 260 @endcode 247 261 248 262 Note that "weapons" is the subsection. This allows you to add more types of sub-objects. In our example, -
code/branches/doc/src/modules/notifications/NotificationQueue.h
r7297 r7298 71 71 72 72 Creating a NotificationQueue through XML goes as follows: 73 Be aware that the NotificationQueue must be inside the <Level></Level> tags or bad things will happen. 73 Be aware that the NotificationQueue must be inside the @code <Level></Level> @endcode tags or bad things will happen. 74 75 @code 74 76 <NotificationQueue 75 77 name = "SuperQueue" //Name of your OverlayQueue. … … 82 84 position = "0.0, 0.0" //The position of the NotificationQueue. (Default is 0.0,0.0) 83 85 /> 86 @endcode 84 87 @author 85 88 Damian 'Mozork' Frick -
code/branches/doc/src/modules/questsystem/AddQuest.h
r5781 r7298 46 46 Creating a AddQuest through XML goes as follows: 47 47 48 @code 48 49 <AddQuest questId="id" /> //Where id is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information, and identifies the Quest that should be added. 50 @endcode 49 51 @author 50 52 Damian 'Mozork' Frick -
code/branches/doc/src/modules/questsystem/AddQuestHint.h
r5781 r7298 46 46 Adds a QuestHint, resp. activates the QuestHint of the given id for the player the QuestEffect is invoked on. 47 47 48 Creating a AddQuestHint through XML goes as follows:48 Creating a AddQuestHint through XML goes as follows: 49 49 50 @code 50 51 <AddQuestHint hintId="id" /> //Where id is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information, and identifies the QuestHint that should be added. 52 @endcode 51 53 @author 52 54 Damian 'Mozork' Frick -
code/branches/doc/src/modules/questsystem/AddReward.h
r5781 r7298 48 48 Creating a AddReward through XML goes as follows: 49 49 50 @code 50 51 <AddReward> 51 52 <Rewardable /> //A list of Rewardable objects to be rewarded the player, see the specific Rewardables for their respective XML representations. … … 53 54 <Rewardable /> 54 55 </AddReward> 56 @endcode 55 57 @author 56 58 Damian 'Mozork' Frick -
code/branches/doc/src/modules/questsystem/CompleteQuest.h
r5781 r7298 46 46 Creating a CompleteQuest through XML goes as follows: 47 47 48 @code 48 49 <CompleteQuest questId="id" /> //Where id is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information, and identifies the Quest that should be completed. 50 @endcode 49 51 @author 50 52 Damian 'Mozork' Frick -
code/branches/doc/src/modules/questsystem/FailQuest.h
r5781 r7298 46 46 Creating a FailQuest through XML goes as follows: 47 47 48 @code 48 49 <FailQuest questId="id" /> //Where id is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information, and identifies the Quest that should be failed. 50 @endcode 49 51 @author 50 52 Damian 'Mozork' Frick -
code/branches/doc/src/modules/questsystem/GlobalQuest.h
r5781 r7298 50 50 Creating a GlobalQuest through XML goes as follows: 51 51 52 @code 52 53 <GlobalQuest id="questId"> //Where questId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information 53 54 <QuestDescription title="Title" description="Description." /> //The description of the quest. … … 78 79 </reward-effects> 79 80 </GlobalQuest> 81 @endcode 80 82 @author 81 83 Damian 'Mozork' Frick -
code/branches/doc/src/modules/questsystem/LocalQuest.h
r5781 r7298 49 49 Creating a LocalQuest through XML goes as follows: 50 50 51 @code 51 52 <LocalQuest id="questId"> //Where questId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information 52 53 <QuestDescription title="Title" description="Description." /> //The description of the quest. … … 72 73 </complete-effects> 73 74 </LocalQuest> 75 @endcode 74 76 @author 75 77 Damian 'Mozork' Frick -
code/branches/doc/src/modules/questsystem/QuestDescription.h
r7163 r7298 50 50 Creating a QuestDescription through XML goes as follows: 51 51 52 @code 52 53 <QuestDescription title="Title" description="Description Text" failMessage="You fail." completeMessage="You win!" /> 54 @endcode 53 55 @author 54 56 Damian 'Mozork' Frick -
code/branches/doc/src/modules/questsystem/QuestEffectBeacon.h
r6800 r7298 61 61 Creating a QuestEffectBeacon through XML goes as follows: 62 62 63 @code 63 64 <QuestEffectBeacon times=n> //Where 'n' is eighter a number >= 0, which means the QuestEffectBeacon can be executed n times. Or n = -1, which means the QuestEffectBeacon can be executed an infinite number of times. 64 65 <effects> … … 76 77 </attached> 77 78 </QuestEffectBeacon> 79 @endcode 78 80 @author 79 81 Damian 'Mozork' Frick -
code/branches/doc/src/modules/questsystem/QuestHint.h
r7163 r7298 60 60 Creating a QuestHint through XML goes as follows: 61 61 62 @code 62 63 <QuestHint id="hintId"> //Where hintId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information 63 64 <QuestDesctription title="" description="" /> 64 65 </QuestHint> 66 @endcode 65 67 @author 66 68 Damian 'Mozork' Frick -
code/branches/doc/src/modules/questsystem/QuestListener.h
r5781 r7298 62 62 You can use the QuestListener as if it were a Trigger or EventListener, that fires an Event when the status (depending on the set mode) of the given Quest changes. 63 63 64 @code 64 65 <BaseObject> // The object that should react to the status change of a Quest. 65 66 <events> … … 69 70 </events> 70 71 </BaseObject> 72 @endcode 71 73 @author 72 74 Damian 'Mozork' Frick
Note: See TracChangeset
for help on using the changeset viewer.