mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
87 lines
38 KiB
HTML
87 lines
38 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
|
|
|
<html><head><title>Entity</title><link rel="stylesheet" type="text/css" href="../../styles/main.css"><script language=JavaScript src="../../javascript/main.js"></script><script language=JavaScript src="../../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad()"><script language=JavaScript><!--
|
|
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>
|
|
|
|
<!-- Generated by Natural Docs, version 1.4 -->
|
|
<!-- http://www.naturaldocs.org -->
|
|
|
|
<!-- saved from url=(0026)http://www.naturaldocs.org -->
|
|
|
|
|
|
|
|
|
|
<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="Entity"></a>Entity</h1><div class=CBody><p>Basic entity class.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#Entity" >Entity</a></td><td class=SDescription>Basic entity class.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Entity.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Entity.destroy" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">destroy</a></td><td class=SDescription>Destorys the entity.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Entity.reset" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">reset</a></td><td class=SDescription>Called when the game resets the map. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Entity.tick" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">tick</a></td><td class=SDescription>Called progress the entity to the next tick. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Entity.tick_defered" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">tick_defered</a></td><td class=SDescription>Called after all entities tick() function has been called.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Entity.snap" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">snap</a></td><td class=SDescription>Called when a new snapshot is being generated for a specific client.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Entity.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#Entity.proximity_radius" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">proximity_radius</a></td><td class=SDescription>Contains the physical size of the entity.</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#Entity.pos" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">pos</a></td><td class=SDescription>Contains the current posititon of the entity.</td></tr><tr class="SClass"><td class=SEntry><a href="#Game_World" >Game World</a></td><td class=SDescription>Tracks all entities in the game. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Game_World.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Game_World.find_entities" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">find_entities</a></td><td class=SDescription>Finds entities close to a position and returns them in a list.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Game_World.interserct_character" >interserct_character</a></td><td class=SDescription>Finds the closest character that intersects the line.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Game_World.closest_character" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">closest_character</a></td><td class=SDescription>Finds the closest character to a specific point.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Game_World.insert_entity" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">insert_entity</a></td><td class=SDescription>Adds an entity to the world.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Game_World.remove_entity" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">remove_entity</a></td><td class=SDescription>Removes an entity from the world.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Game_World.destroy_entity" id=link12 onMouseOver="ShowTip(event, 'tt12', 'link12')" onMouseOut="HideTip('tt12')">destroy_entity</a></td><td class=SDescription>Destroys an entity in the world.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Game_World.snap" id=link13 onMouseOver="ShowTip(event, 'tt13', 'link13')" onMouseOut="HideTip('tt13')">snap</a></td><td class=SDescription>Calls snap on all the entities in the world to create the snapshot.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Game_World.tick" id=link14 onMouseOver="ShowTip(event, 'tt14', 'link14')" onMouseOut="HideTip('tt14')">tick</a></td><td class=SDescription>Calls tick on all the entities in the world to progress the world to the next tick.</td></tr><tr class="SClass"><td class=SEntry><a href="#Game_Controller" >Game Controller</a></td><td class=SDescription>Controls the main game logic. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Game_Controller.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Game_Controller.on_entity" id=link15 onMouseOver="ShowTip(event, 'tt15', 'link15')" onMouseOut="HideTip('tt15')">on_entity</a></td><td class=SDescription>Called when the map is loaded to process an entity in the map.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Game_Controller.on_character_spawn" id=link16 onMouseOver="ShowTip(event, 'tt16', 'link16')" onMouseOut="HideTip('tt16')">on_character_spawn</a></td><td class=SDescription>Called when a character spawns into the game world.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Game_Controller.on_character_death" id=link17 onMouseOver="ShowTip(event, 'tt17', 'link17')" onMouseOut="HideTip('tt17')">on_character_death</a></td><td class=SDescription>Called when a character in the world dies.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
|
|
|
|
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Entity.Functions"></a>Functions</h3></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Entity.destroy"></a>destroy</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual void destroy()</td></tr></table></blockquote><p>Destorys the entity.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Entity.reset"></a>reset</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual void reset()</td></tr></table></blockquote><p>Called when the game resets the map. Puts the entity back to it’s starting state or perhaps destroys it.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Entity.tick"></a>tick</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual void tick()</td></tr></table></blockquote><p>Called progress the entity to the next tick. Updates and moves the entity to it’s new state and position.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Entity.tick_defered"></a>tick_defered</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual void tick_defered()</td></tr></table></blockquote><p>Called after all entities tick() function has been called.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Entity.snap"></a>snap</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>virtual void snap(</td><td class=PType nowrap>int </td><td class=PParameter nowrap>snapping_client</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Called when a new snapshot is being generated for a specific client.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>snapping_client</td><td class=CDLDescription>ID of the client which snapshot is being generated. Could be -1 to create a complete snapshot of everything in the game for demo recording.</td></tr></table></div></div></div>
|
|
|
|
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Entity.Variables"></a>Variables</h3></div></div>
|
|
|
|
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="Entity.proximity_radius"></a>proximity_radius</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>float proximity_radius</td></tr></table></blockquote><p>Contains the physical size of the entity.</p></div></div></div>
|
|
|
|
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="Entity.pos"></a>pos</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>vec2 pos</td></tr></table></blockquote><p>Contains the current posititon of the entity.</p></div></div></div>
|
|
|
|
<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="Game_World"></a>Game World</h2><div class=CBody><p>Tracks all entities in the game. Propagates tick and snap calls to all entities.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SGroup"><td class=SEntry><a href="#Game_World.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Game_World.find_entities" id=link18 onMouseOver="ShowTip(event, 'tt8', 'link18')" onMouseOut="HideTip('tt8')">find_entities</a></td><td class=SDescription>Finds entities close to a position and returns them in a list.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Game_World.interserct_character" >interserct_character</a></td><td class=SDescription>Finds the closest character that intersects the line.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Game_World.closest_character" id=link19 onMouseOver="ShowTip(event, 'tt9', 'link19')" onMouseOut="HideTip('tt9')">closest_character</a></td><td class=SDescription>Finds the closest character to a specific point.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Game_World.insert_entity" id=link20 onMouseOver="ShowTip(event, 'tt10', 'link20')" onMouseOut="HideTip('tt10')">insert_entity</a></td><td class=SDescription>Adds an entity to the world.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Game_World.remove_entity" id=link21 onMouseOver="ShowTip(event, 'tt11', 'link21')" onMouseOut="HideTip('tt11')">remove_entity</a></td><td class=SDescription>Removes an entity from the world.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Game_World.destroy_entity" id=link22 onMouseOver="ShowTip(event, 'tt12', 'link22')" onMouseOut="HideTip('tt12')">destroy_entity</a></td><td class=SDescription>Destroys an entity in the world.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Game_World.snap" id=link23 onMouseOver="ShowTip(event, 'tt13', 'link23')" onMouseOut="HideTip('tt13')">snap</a></td><td class=SDescription>Calls snap on all the entities in the world to create the snapshot.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Game_World.tick" id=link24 onMouseOver="ShowTip(event, 'tt14', 'link24')" onMouseOut="HideTip('tt14')">tick</a></td><td class=SDescription>Calls tick on all the entities in the world to progress the world to the next tick.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
|
|
|
|
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Game_World.Functions"></a>Functions</h3></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Game_World.find_entities"></a>find_entities</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int find_entities(</td><td class=PType nowrap>vec2 </td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>pos,</td><td class=PDefaultValuePrefix> </td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PType nowrap>float </td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>radius,</td><td class=PDefaultValuePrefix> </td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PType nowrap>ENTITY </td><td class=PParameterPrefix nowrap>**</td><td class=PParameter nowrap>ents,</td><td class=PDefaultValuePrefix> </td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PType nowrap>int </td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>max,</td><td class=PDefaultValuePrefix> </td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PType nowrap>int </td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>type</td><td class=PDefaultValuePrefix> = </td><td class=PDefaultValue width=100%> -1</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Finds entities close to a position and returns them in a list.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>pos</td><td class=CDLDescription>Position.</td></tr><tr><td class=CDLEntry>radius</td><td class=CDLDescription>How close the entities have to be.</td></tr><tr><td class=CDLEntry>ents</td><td class=CDLDescription>Pointer to a list that should be filled with the pointers to the entities.</td></tr><tr><td class=CDLEntry>max</td><td class=CDLDescription>Number of entities that fits into the ents array.</td></tr><tr><td class=CDLEntry>type</td><td class=CDLDescription>Type of the entities to find. -1 for all types.</td></tr></table><h4 class=CHeading>Returns</h4><p>Number of entities found and added to the ents array.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Game_World.interserct_character"></a>interserct_character</h3><div class=CBody><p>Finds the closest character that intersects the line.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>pos0</td><td class=CDLDescription>Start position</td></tr><tr><td class=CDLEntry>pos2</td><td class=CDLDescription>End position</td></tr><tr><td class=CDLEntry>radius</td><td class=CDLDescription>How for from the line the character is allowed to be.</td></tr><tr><td class=CDLEntry>new_pos</td><td class=CDLDescription>Intersection position</td></tr><tr><td class=CDLEntry>notthis</td><td class=CDLDescription>Entity to ignore intersecting with</td></tr></table><h4 class=CHeading>Returns</h4><p>Returns a pointer to the closest hit or NULL of there is no intersection.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Game_World.closest_character"></a>closest_character</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>class CHARACTER *closest_character(</td><td class=PType nowrap>vec2 </td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>pos,</td></tr><tr><td></td><td class=PType nowrap>float </td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>radius,</td></tr><tr><td></td><td class=PType nowrap>ENTITY </td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>notthis</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Finds the closest character to a specific point.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>pos</td><td class=CDLDescription>The center position.</td></tr><tr><td class=CDLEntry>radius</td><td class=CDLDescription>How far off the character is allowed to be</td></tr><tr><td class=CDLEntry>notthis</td><td class=CDLDescription>Entity to ignore</td></tr></table><h4 class=CHeading>Returns</h4><p>Returns a pointer to the closest character or NULL if no character is close enough.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Game_World.insert_entity"></a>insert_entity</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void insert_entity(</td><td class=PType nowrap>ENTITY </td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>entity</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds an entity to the world.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>entity</td><td class=CDLDescription>Entity to add</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Game_World.remove_entity"></a>remove_entity</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void remove_entity(</td><td class=PType nowrap>ENTITY </td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>entity</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Removes an entity from the world.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>entity</td><td class=CDLDescription>Entity to remove</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Game_World.destroy_entity"></a>destroy_entity</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void destroy_entity(</td><td class=PType nowrap>ENTITY </td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>entity</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Destroys an entity in the world.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>entity</td><td class=CDLDescription>Entity to destroy</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Game_World.snap"></a>snap</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void snap(</td><td class=PType nowrap>int </td><td class=PParameter nowrap>snapping_client</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Calls snap on all the entities in the world to create the snapshot.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>snapping_client</td><td class=CDLDescription>ID of the client which snapshot is being created.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Game_World.tick"></a>tick</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>void tick()</td></tr></table></blockquote><p>Calls tick on all the entities in the world to progress the world to the next tick.</p></div></div></div>
|
|
|
|
<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="Game_Controller"></a>Game Controller</h2><div class=CBody><p>Controls the main game logic. Keeping track of team and player score, winning conditions and specific game logic.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SGroup"><td class=SEntry><a href="#Game_Controller.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Game_Controller.on_entity" id=link25 onMouseOver="ShowTip(event, 'tt15', 'link25')" onMouseOut="HideTip('tt15')">on_entity</a></td><td class=SDescription>Called when the map is loaded to process an entity in the map.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Game_Controller.on_character_spawn" id=link26 onMouseOver="ShowTip(event, 'tt16', 'link26')" onMouseOut="HideTip('tt16')">on_character_spawn</a></td><td class=SDescription>Called when a character spawns into the game world.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Game_Controller.on_character_death" id=link27 onMouseOver="ShowTip(event, 'tt17', 'link27')" onMouseOut="HideTip('tt17')">on_character_death</a></td><td class=SDescription>Called when a character in the world dies.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
|
|
|
|
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Game_Controller.Functions"></a>Functions</h3></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Game_Controller.on_entity"></a>on_entity</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>virtual bool on_entity(</td><td class=PType nowrap>int </td><td class=PParameter nowrap>index,</td></tr><tr><td></td><td class=PType nowrap>vec2 </td><td class=PParameter nowrap>pos</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Called when the map is loaded to process an entity in the map.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>index</td><td class=CDLDescription>Entity index.</td></tr><tr><td class=CDLEntry>pos</td><td class=CDLDescription>Where the entity is located in the world.</td></tr></table><h4 class=CHeading>Returns</h4><p>bool?</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Game_Controller.on_character_spawn"></a>on_character_spawn</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>virtual void on_character_spawn(</td><td class=PTypePrefix nowrap>class </td><td class=PType nowrap>CHARACTER </td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>chr</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Called when a character spawns into the game world.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>chr</td><td class=CDLDescription>The character that was spawned.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Game_Controller.on_character_death"></a>on_character_death</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>virtual int on_character_death(</td><td class=PTypePrefix nowrap>class </td><td class=PType nowrap>CHARACTER </td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>victim,</td></tr><tr><td></td><td class=PTypePrefix nowrap>class </td><td class=PType nowrap>PLAYER </td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>killer,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>int </td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>weapon</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Called when a character in the world dies.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>victim</td><td class=CDLDescription>The character that died.</td></tr><tr><td class=CDLEntry>killer</td><td class=CDLDescription>The player that killed it.</td></tr><tr><td class=CDLEntry>weapon</td><td class=CDLDescription>What weapon that killed it. Can be -1 for undefined weapon when switching team or player suicides.</td></tr></table></div></div></div>
|
|
|
|
</div><!--Content-->
|
|
|
|
|
|
<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
|
|
|
|
|
|
<div id=Menu><div class=MEntry><div class=MFile><a href="../../files2/e_system-h.html">OS Abstraction</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent6')">Engine</a><div class=MGroupContent id=MGroupContent6><div class=MEntry><div class=MFile><a href="../../files2/e_if_msg-h.html">Messaging</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent3')">Client</a><div class=MGroupContent id=MGroupContent3><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Overview</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MFile><a href="../../files2/docs/client_time-txt.html">Time on the client</a></div></div><div class=MEntry><div class=MFile><a href="../../files2/docs/prediction-txt.html">Prediction</a></div></div><div class=MEntry><div class=MFile><a href="../../files2/docs/snapshots-txt.html">Snapshots</a></div></div><div class=MEntry><div class=MFile><a href="../../files2/docs/server_op-txt.html">Server Operation</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent2')">Reference</a><div class=MGroupContent id=MGroupContent2><div class=MEntry><div class=MFile><a href="../../files2/e_if_modc-h.html">Client Hooks</a></div></div><div class=MEntry><div class=MFile><a href="../../files2/e_if_client-h.html">Client Interface</a></div></div><div class=MEntry><div class=MFile><a href="../../files2/e_if_other-h.html">Engine Interface</a></div></div><div class=MEntry><div class=MFile><a href="../../files2/e_if_gfx-h.html">Graphics</a></div></div><div class=MEntry><div class=MFile><a href="../../files2/e_if_inp-h.html">Input</a></div></div><div class=MEntry><div class=MFile><a href="../../files2/e_if_snd-h.html">Sound</a></div></div></div></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent5')">Server</a><div class=MGroupContent id=MGroupContent5><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent4')">Reference</a><div class=MGroupContent id=MGroupContent4><div class=MEntry><div class=MFile><a href="../../files2/e_if_mods-h.html">Server Hooks</a></div></div><div class=MEntry><div class=MFile><a href="../../files2/e_if_server-h.html">Server Interface</a></div></div></div></div></div></div></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent7')">Game</a><div class=MGroupContent id=MGroupContent7><div class=MEntry><div class=MFile id=MSelected>Entity</div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent8')">Index</a><div class=MGroupContent id=MGroupContent8><div class=MEntry><div class=MIndex><a href="../../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Constants.html">Constants</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Variables.html">Variables</a></div></div></div></div></div><script type="text/javascript"><!--
|
|
var searchPanel = new SearchPanel("searchPanel", "HTML", "../../search");
|
|
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Constants">Constants</option><option value="Functions">Functions</option><option value="Variables">Variables</option></select></div><script language=JavaScript><!--
|
|
HideAllBut([7, 8, 6], 9);// --></script></div><!--Menu-->
|
|
|
|
|
|
|
|
<!--START_ND_TOOLTIPS-->
|
|
<div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual void destroy()</td></tr></table></blockquote>Destorys the entity.</div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual void reset()</td></tr></table></blockquote>Called when the game resets the map. </div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual void tick()</td></tr></table></blockquote>Called progress the entity to the next tick. </div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual void tick_defered()</td></tr></table></blockquote>Called after all entities tick() function has been called.</div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>virtual void snap(</td><td class=PType nowrap>int </td><td class=PParameter nowrap>snapping_client</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Called when a new snapshot is being generated for a specific client.</div></div><div class=CToolTip id="tt6"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>float proximity_radius</td></tr></table></blockquote>Contains the physical size of the entity.</div></div><div class=CToolTip id="tt7"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>vec2 pos</td></tr></table></blockquote>Contains the current posititon of the entity.</div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>int find_entities(</td><td class=PType nowrap>vec2 </td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>pos,</td><td class=PDefaultValuePrefix> </td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PType nowrap>float </td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>radius,</td><td class=PDefaultValuePrefix> </td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PType nowrap>ENTITY </td><td class=PParameterPrefix nowrap>**</td><td class=PParameter nowrap>ents,</td><td class=PDefaultValuePrefix> </td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PType nowrap>int </td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>max,</td><td class=PDefaultValuePrefix> </td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PType nowrap>int </td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>type</td><td class=PDefaultValuePrefix> = </td><td class=PDefaultValue width=100%> -1</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Finds entities close to a position and returns them in a list.</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>class CHARACTER *closest_character(</td><td class=PType nowrap>vec2 </td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>pos,</td></tr><tr><td></td><td class=PType nowrap>float </td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>radius,</td></tr><tr><td></td><td class=PType nowrap>ENTITY </td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>notthis</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Finds the closest character to a specific point.</div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void insert_entity(</td><td class=PType nowrap>ENTITY </td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>entity</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Adds an entity to the world.</div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void remove_entity(</td><td class=PType nowrap>ENTITY </td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>entity</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Removes an entity from the world.</div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void destroy_entity(</td><td class=PType nowrap>ENTITY </td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>entity</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Destroys an entity in the world.</div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void snap(</td><td class=PType nowrap>int </td><td class=PParameter nowrap>snapping_client</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Calls snap on all the entities in the world to create the snapshot.</div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>void tick()</td></tr></table></blockquote>Calls tick on all the entities in the world to progress the world to the next tick.</div></div><div class=CToolTip id="tt15"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>virtual bool on_entity(</td><td class=PType nowrap>int </td><td class=PParameter nowrap>index,</td></tr><tr><td></td><td class=PType nowrap>vec2 </td><td class=PParameter nowrap>pos</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Called when the map is loaded to process an entity in the map.</div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>virtual void on_character_spawn(</td><td class=PTypePrefix nowrap>class </td><td class=PType nowrap>CHARACTER </td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>chr</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Called when a character spawns into the game world.</div></div><div class=CToolTip id="tt17"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>virtual int on_character_death(</td><td class=PTypePrefix nowrap>class </td><td class=PType nowrap>CHARACTER </td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>victim,</td></tr><tr><td></td><td class=PTypePrefix nowrap>class </td><td class=PType nowrap>PLAYER </td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>killer,</td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>int </td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>weapon</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Called when a character in the world dies.</div></div><!--END_ND_TOOLTIPS-->
|
|
|
|
|
|
|
|
|
|
<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>
|
|
|
|
|
|
<script language=JavaScript><!--
|
|
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |