Changeset - r18501:8e3d905ea4bc
projects/openttd_vs100.vcxproj.filters
Show inline comments
 
@@ -43,53 +43,56 @@
 
    <Filter Include="AI API">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000013}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="AI API Implementation">
 
    <Filter Include="Script API">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000014}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="Script API Implementation">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000015}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="Blitters">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000015}</UniqueIdentifier>
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000016}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="Drivers">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000016}</UniqueIdentifier>
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000017}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="Sprite loaders">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000017}</UniqueIdentifier>
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000018}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="NewGRF">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000018}</UniqueIdentifier>
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000019}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="Map Accessors">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000019}</UniqueIdentifier>
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000020}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="Misc">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000020}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="Network Core">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000021}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="Network Core">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000022}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="Pathfinder">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000022}</UniqueIdentifier>
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000023}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="NPF">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000023}</UniqueIdentifier>
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000024}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="YAPF">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000024}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="Video">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000025}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="Music">
 
    <Filter Include="Video">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000026}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="Sound">
 
    <Filter Include="Music">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000027}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="Windows files">
 
    <Filter Include="Sound">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000028}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="Windows files">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000029}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="Threading">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000029}</UniqueIdentifier>
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000030}</UniqueIdentifier>
 
    </Filter>
 
  </ItemGroup>
 
  <ItemGroup>
 
@@ -1783,307 +1786,307 @@
 
      <Filter>AI API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_accounting.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_airport.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_base.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_basestation.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_bridge.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_bridgelist.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_cargo.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_cargolist.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_company.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_controller.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_date.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_depotlist.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_engine.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_enginelist.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_error.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_event.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_event_types.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_execmode.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_gamesettings.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_group.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_grouplist.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_industry.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_industrylist.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_industrytype.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_industrytypelist.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_list.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_log.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_map.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_marine.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_object.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_order.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_rail.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_railtypelist.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_road.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_sign.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_signlist.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_station.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_stationlist.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_subsidy.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_subsidylist.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_testmode.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_tile.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_tilelist.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_town.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_townlist.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_tunnel.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_types.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_vehicle.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_vehiclelist.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_waypoint.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_waypointlist.hpp">
 
      <Filter>AI API</Filter>
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClCompile Include="..\src\script\api\script_accounting.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_airport.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_base.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_basestation.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_bridge.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_bridgelist.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_cargo.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_cargolist.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_company.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_controller.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_date.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_depotlist.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_engine.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_enginelist.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_error.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_event.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_event_types.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_execmode.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_gamesettings.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_group.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_grouplist.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_industry.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_industrylist.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_industrytype.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_industrytypelist.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_list.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_log.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_map.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_marine.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_object.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_order.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_rail.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_railtypelist.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_road.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_sign.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_signlist.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_station.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_stationlist.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_subsidy.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_subsidylist.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_testmode.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_tile.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_tilelist.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_town.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_townlist.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_tunnel.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_vehicle.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_vehiclelist.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_waypoint.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_waypointlist.cpp">
 
      <Filter>AI API Implementation</Filter>
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\blitter\32bpp_anim.cpp">
 
      <Filter>Blitters</Filter>
projects/openttd_vs80.vcproj
Show inline comments
 
@@ -2738,6 +2738,10 @@
 
				RelativePath=".\..\src\ai\api\ai_info_docs.hpp"
 
				>
 
			</File>
 
		</Filter>
 
		<Filter
 
			Name="Script API"
 
			>
 
			<File
 
				RelativePath=".\..\src\script\api\script_accounting.hpp"
 
				>
 
@@ -2944,7 +2948,7 @@
 
			</File>
 
		</Filter>
 
		<Filter
 
			Name="AI API Implementation"
 
			Name="Script API Implementation"
 
			>
 
			<File
 
				RelativePath=".\..\src\script\api\script_accounting.cpp"
projects/openttd_vs90.vcproj
Show inline comments
 
@@ -2735,6 +2735,10 @@
 
				RelativePath=".\..\src\ai\api\ai_info_docs.hpp"
 
				>
 
			</File>
 
		</Filter>
 
		<Filter
 
			Name="Script API"
 
			>
 
			<File
 
				RelativePath=".\..\src\script\api\script_accounting.hpp"
 
				>
 
@@ -2941,7 +2945,7 @@
 
			</File>
 
		</Filter>
 
		<Filter
 
			Name="AI API Implementation"
 
			Name="Script API Implementation"
 
			>
 
			<File
 
				RelativePath=".\..\src\script\api\script_accounting.cpp"
source.list
Show inline comments
 
@@ -627,6 +627,8 @@ ai/ai_storage.hpp
 
# AI API
 
ai/api/ai_changelog.hpp
 
ai/api/ai_info_docs.hpp
 

	
 
# Script API
 
script/api/script_accounting.hpp
 
script/api/script_airport.hpp
 
script/api/script_base.hpp
 
@@ -679,7 +681,7 @@ script/api/script_vehiclelist.hpp
 
script/api/script_waypoint.hpp
 
script/api/script_waypointlist.hpp
 

	
 
# AI API Implementation
 
# Script API Implementation
 
script/api/script_accounting.cpp
 
script/api/script_airport.cpp
 
script/api/script_base.cpp
src/ai/ai.hpp
Show inline comments
 
@@ -102,12 +102,12 @@ public:
 
	/**
 
	 * Queue a new event for an AI.
 
	 */
 
	static void NewEvent(CompanyID company, AIEvent *event);
 
	static void NewEvent(CompanyID company, ScriptEvent *event);
 

	
 
	/**
 
	 * Broadcast a new event to all active AIs.
 
	 */
 
	static void BroadcastNewEvent(AIEvent *event, CompanyID skip_company = MAX_COMPANIES);
 
	static void BroadcastNewEvent(ScriptEvent *event, CompanyID skip_company = MAX_COMPANIES);
 

	
 
	/**
 
	 * Save data from an AI to a savegame.
src/ai/ai_core.cpp
Show inline comments
 
@@ -200,7 +200,7 @@
 
	}
 
}
 

	
 
/* static */ void AI::NewEvent(CompanyID company, AIEvent *event)
 
/* static */ void AI::NewEvent(CompanyID company, ScriptEvent *event)
 
{
 
	/* AddRef() and Release() need to be called at least once, so do it here */
 
	event->AddRef();
 
@@ -225,7 +225,7 @@
 
	event->Release();
 
}
 

	
 
/* static */ void AI::BroadcastNewEvent(AIEvent *event, CompanyID skip_company)
 
/* static */ void AI::BroadcastNewEvent(ScriptEvent *event, CompanyID skip_company)
 
{
 
	/* AddRef() and Release() need to be called at least once, so do it here */
 
	event->AddRef();
src/ai/ai_gui.cpp
Show inline comments
 
@@ -797,7 +797,7 @@ enum AIDebugWindowWidgets {
 
};
 

	
 
/**
 
 * Window with everything an AI prints via AILog.
 
 * Window with everything an AI prints via ScriptLog.
 
 */
 
struct AIDebugWindow : public QueryStringBaseWindow {
 
	static const int top_offset;    ///< Offset of the text at the top of the AID_WIDGET_LOG_PANEL.
 
@@ -931,7 +931,7 @@ struct AIDebugWindow : public QueryStrin
 
		/* If there are no active companies, don't display anything else. */
 
		if (ai_debug_company == INVALID_COMPANY) return;
 

	
 
		AILog::LogData *log = (AILog::LogData *)Company::Get(ai_debug_company)->ai_instance->GetLogPointer();
 
		ScriptLog::LogData *log = (ScriptLog::LogData *)Company::Get(ai_debug_company)->ai_instance->GetLogPointer();
 

	
 
		int scroll_count = (log == NULL) ? 0 : log->used;
 
		if (this->vscroll->GetCount() != scroll_count) {
 
@@ -984,7 +984,7 @@ struct AIDebugWindow : public QueryStrin
 

	
 
		switch (widget) {
 
			case AID_WIDGET_LOG_PANEL: {
 
				AILog::LogData *log = (AILog::LogData *)Company::Get(ai_debug_company)->ai_instance->GetLogPointer();
 
				ScriptLog::LogData *log = (ScriptLog::LogData *)Company::Get(ai_debug_company)->ai_instance->GetLogPointer();
 
				if (log == NULL) return;
 

	
 
				int y = this->top_offset;
 
@@ -994,11 +994,11 @@ struct AIDebugWindow : public QueryStrin
 

	
 
					TextColour colour;
 
					switch (log->type[pos]) {
 
						case AILog::LOG_SQ_INFO:  colour = TC_BLACK;  break;
 
						case AILog::LOG_SQ_ERROR: colour = TC_RED;    break;
 
						case AILog::LOG_INFO:     colour = TC_BLACK;  break;
 
						case AILog::LOG_WARNING:  colour = TC_YELLOW; break;
 
						case AILog::LOG_ERROR:    colour = TC_RED;    break;
 
						case ScriptLog::LOG_SQ_INFO:  colour = TC_BLACK;  break;
 
						case ScriptLog::LOG_SQ_ERROR: colour = TC_RED;    break;
 
						case ScriptLog::LOG_INFO:     colour = TC_BLACK;  break;
 
						case ScriptLog::LOG_WARNING:  colour = TC_YELLOW; break;
 
						case ScriptLog::LOG_ERROR:    colour = TC_RED;    break;
 
						default:                  colour = TC_BLACK;  break;
 
					}
 

	
 
@@ -1025,7 +1025,7 @@ struct AIDebugWindow : public QueryStrin
 
		this->RaiseWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START);
 
		ai_debug_company = show_ai;
 

	
 
		AILog::LogData *log = (AILog::LogData *)Company::Get(ai_debug_company)->ai_instance->GetLogPointer();
 
		ScriptLog::LogData *log = (ScriptLog::LogData *)Company::Get(ai_debug_company)->ai_instance->GetLogPointer();
 
		this->vscroll->SetCount((log == NULL) ? 0 : log->used);
 

	
 
		this->LowerWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START);
 
@@ -1124,7 +1124,7 @@ struct AIDebugWindow : public QueryStrin
 
		 * This needs to be done in gameloop-scope, so the AI is suspended immediately. */
 
		if (!gui_scope && data == ai_debug_company && this->break_check_enabled && !StrEmpty(this->edit_str_buf)) {
 
			/* Get the log instance of the active company */
 
			AILog::LogData *log = (AILog::LogData *)Company::Get(ai_debug_company)->ai_instance->GetLogPointer();
 
			ScriptLog::LogData *log = (ScriptLog::LogData *)Company::Get(ai_debug_company)->ai_instance->GetLogPointer();
 

	
 
			if (log != NULL && case_sensitive_break_check?
 
					strstr(log->lines[log->pos], this->edit_str_buf) != 0 :
src/ai/ai_instance.cpp
Show inline comments
 
@@ -85,8 +85,8 @@ static const int MAX_CONSTRUCTOR_OPS = 1
 
AIStorage::~AIStorage()
 
{
 
	/* Free our pointers */
 
	if (event_data != NULL) AIEventController::FreeEventPointer();
 
	if (log_data != NULL) AILog::FreeLogPointer();
 
	if (event_data != NULL) ScriptEventController::FreeEventPointer();
 
	if (log_data != NULL) ScriptLog::FreeLogPointer();
 
}
 

	
 
/**
 
@@ -97,7 +97,7 @@ AIStorage::~AIStorage()
 
static void PrintFunc(bool error_msg, const SQChar *message)
 
{
 
	/* Convert to OpenTTD internal capable string */
 
	AIController::Print(error_msg, SQ2OTTD(message));
 
	ScriptController::Print(error_msg, SQ2OTTD(message));
 
}
 

	
 
AIInstance::AIInstance() :
 
@@ -118,9 +118,9 @@ AIInstance::AIInstance() :
 

	
 
void AIInstance::Initialize(AIInfo *info)
 
{
 
	AIObject::ActiveInstance active(this);
 
	ScriptObject::ActiveInstance active(this);
 

	
 
	this->controller = new AIController();
 
	this->controller = new ScriptController();
 

	
 
	/* Register the AIController (including the "import" command) */
 
	SQAIController_Register(this->engine);
 
@@ -134,14 +134,14 @@ void AIInstance::Initialize(AIInfo *info
 
	}
 

	
 
	try {
 
		AIObject::SetAllowDoCommand(false);
 
		ScriptObject::SetAllowDoCommand(false);
 
		/* Load and execute the script for this AI */
 
		const char *main_script = info->GetMainScript();
 
		if (strcmp(main_script, "%_dummy") == 0) {
 
			extern void AI_CreateAIDummy(HSQUIRRELVM vm);
 
			AI_CreateAIDummy(this->engine->GetVM());
 
		} else if (!this->engine->LoadScript(main_script) || this->engine->IsSuspended()) {
 
			if (this->engine->IsSuspended()) AILog::Error("This AI took too long to load script. AI is not started.");
 
			if (this->engine->IsSuspended()) ScriptLog::Error("This AI took too long to load script. AI is not started.");
 
			this->Died();
 
			return;
 
		}
 
@@ -152,7 +152,7 @@ void AIInstance::Initialize(AIInfo *info
 
			this->Died();
 
			return;
 
		}
 
		AIObject::SetAllowDoCommand(true);
 
		ScriptObject::SetAllowDoCommand(true);
 
	} catch (AI_FatalError e) {
 
		this->is_dead = true;
 
		this->engine->ThrowError(e.GetErrorMessage());
 
@@ -163,7 +163,7 @@ void AIInstance::Initialize(AIInfo *info
 

	
 
AIInstance::~AIInstance()
 
{
 
	AIObject::ActiveInstance active(this);
 
	ScriptObject::ActiveInstance active(this);
 

	
 
	if (instance != NULL) this->engine->ReleaseObject(this->instance);
 
	if (engine != NULL) delete this->engine;
 
@@ -279,12 +279,12 @@ bool AIInstance::LoadCompatibilityScript
 

	
 
		if (this->engine->LoadScript(buf)) return true;
 

	
 
		AILog::Error("Failed to load API compatibility script");
 
		ScriptLog::Error("Failed to load API compatibility script");
 
		DEBUG(ai, 0, "Error compiling / running API compatibility script: %s", buf);
 
		return false;
 
	}
 

	
 
	AILog::Warning("API compatibility script not found");
 
	ScriptLog::Warning("API compatibility script not found");
 
	return true;
 
}
 

	
 
@@ -311,15 +311,15 @@ void AIInstance::Died()
 
		ShowErrorMessage(STR_ERROR_AI_PLEASE_REPORT_CRASH, INVALID_STRING_ID, WL_WARNING);
 

	
 
		if (info->GetURL() != NULL) {
 
			AILog::Info("Please report the error to the following URL:");
 
			AILog::Info(info->GetURL());
 
			ScriptLog::Info("Please report the error to the following URL:");
 
			ScriptLog::Info(info->GetURL());
 
		}
 
	}
 
}
 

	
 
void AIInstance::GameLoop()
 
{
 
	AIObject::ActiveInstance active(this);
 
	ScriptObject::ActiveInstance active(this);
 

	
 
	if (this->IsDead()) return;
 
	if (this->engine->HasScriptCrashed()) {
 
@@ -354,21 +354,21 @@ void AIInstance::GameLoop()
 

	
 
	if (!this->is_started) {
 
		try {
 
			AIObject::SetAllowDoCommand(false);
 
			ScriptObject::SetAllowDoCommand(false);
 
			/* Run the constructor if it exists. Don't allow any DoCommands in it. */
 
			if (this->engine->MethodExists(*this->instance, "constructor")) {
 
				if (!this->engine->CallMethod(*this->instance, "constructor", MAX_CONSTRUCTOR_OPS) || this->engine->IsSuspended()) {
 
					if (this->engine->IsSuspended()) AILog::Error("This AI took too long to initialize. AI is not started.");
 
					if (this->engine->IsSuspended()) ScriptLog::Error("This AI took too long to initialize. AI is not started.");
 
					this->Died();
 
					return;
 
				}
 
			}
 
			if (!this->CallLoad() || this->engine->IsSuspended()) {
 
				if (this->engine->IsSuspended()) AILog::Error("This AI took too long in the Load function. AI is not started.");
 
				if (this->engine->IsSuspended()) ScriptLog::Error("This AI took too long in the Load function. AI is not started.");
 
				this->Died();
 
				return;
 
			}
 
			AIObject::SetAllowDoCommand(true);
 
			ScriptObject::SetAllowDoCommand(true);
 
			/* Start the AI by calling Start() */
 
			if (!this->engine->CallMethod(*this->instance, "Start",  _settings_game.ai.ai_max_opcode_till_suspend) || !this->engine->IsSuspended()) this->Died();
 
		} catch (AI_VMSuspend e) {
 
@@ -410,22 +410,22 @@ void AIInstance::CollectGarbage() const
 

	
 
/* static */ void AIInstance::DoCommandReturn(AIInstance *instance)
 
{
 
	instance->engine->InsertResult(AIObject::GetLastCommandRes());
 
	instance->engine->InsertResult(ScriptObject::GetLastCommandRes());
 
}
 

	
 
/* static */ void AIInstance::DoCommandReturnVehicleID(AIInstance *instance)
 
{
 
	instance->engine->InsertResult(AIObject::GetNewVehicleID());
 
	instance->engine->InsertResult(ScriptObject::GetNewVehicleID());
 
}
 

	
 
/* static */ void AIInstance::DoCommandReturnSignID(AIInstance *instance)
 
{
 
	instance->engine->InsertResult(AIObject::GetNewSignID());
 
	instance->engine->InsertResult(ScriptObject::GetNewSignID());
 
}
 

	
 
/* static */ void AIInstance::DoCommandReturnGroupID(AIInstance *instance)
 
{
 
	instance->engine->InsertResult(AIObject::GetNewGroupID());
 
	instance->engine->InsertResult(ScriptObject::GetNewGroupID());
 
}
 

	
 
AIStorage *AIInstance::GetStorage()
 
@@ -435,9 +435,9 @@ AIStorage *AIInstance::GetStorage()
 

	
 
void *AIInstance::GetLogPointer()
 
{
 
	AIObject::ActiveInstance active(this);
 
	ScriptObject::ActiveInstance active(this);
 

	
 
	return AIObject::GetLogPointer();
 
	return ScriptObject::GetLogPointer();
 
}
 

	
 
/*
 
@@ -485,7 +485,7 @@ static const uint AISAVE_MAX_DEPTH = 25;
 
/* static */ bool AIInstance::SaveObject(HSQUIRRELVM vm, SQInteger index, int max_depth, bool test)
 
{
 
	if (max_depth == 0) {
 
		AILog::Error("Savedata can only be nested to 25 deep. No data saved.");
 
		ScriptLog::Error("Savedata can only be nested to 25 deep. No data saved.");
 
		return false;
 
	}
 

	
 
@@ -516,7 +516,7 @@ static const uint AISAVE_MAX_DEPTH = 25;
 
			const char *buf = SQ2OTTD(res);
 
			size_t len = strlen(buf) + 1;
 
			if (len >= 255) {
 
				AILog::Error("Maximum string length is 254 chars. No data saved.");
 
				ScriptLog::Error("Maximum string length is 254 chars. No data saved.");
 
				return false;
 
			}
 
			if (!test) {
 
@@ -596,7 +596,7 @@ static const uint AISAVE_MAX_DEPTH = 25;
 
		}
 

	
 
		default:
 
			AILog::Error("You tried to save an unsupported type. No data saved.");
 
			ScriptLog::Error("You tried to save an unsupported type. No data saved.");
 
			return false;
 
	}
 
}
 
@@ -609,7 +609,7 @@ static const uint AISAVE_MAX_DEPTH = 25;
 

	
 
void AIInstance::Save()
 
{
 
	AIObject::ActiveInstance active(this);
 
	ScriptObject::ActiveInstance active(this);
 

	
 
	/* Don't save data if the AI didn't start yet or if it crashed. */
 
	if (this->engine == NULL || this->engine->HasScriptCrashed()) {
 
@@ -629,8 +629,8 @@ void AIInstance::Save()
 
	} else if (this->engine->MethodExists(*this->instance, "Save")) {
 
		HSQOBJECT savedata;
 
		/* We don't want to be interrupted during the save function. */
 
		bool backup_allow = AIObject::GetAllowDoCommand();
 
		AIObject::SetAllowDoCommand(false);
 
		bool backup_allow = ScriptObject::GetAllowDoCommand();
 
		ScriptObject::SetAllowDoCommand(false);
 
		try {
 
			if (!this->engine->CallMethod(*this->instance, "Save", &savedata, MAX_SL_OPS)) {
 
				/* The script crashed in the Save function. We can't kill
 
@@ -652,10 +652,10 @@ void AIInstance::Save()
 
			this->engine->CrashOccurred();
 
			return;
 
		}
 
		AIObject::SetAllowDoCommand(backup_allow);
 
		ScriptObject::SetAllowDoCommand(backup_allow);
 

	
 
		if (!sq_istable(savedata)) {
 
			AILog::Error(this->engine->IsSuspended() ? "This AI took too long to Save." : "Save function should return a table.");
 
			ScriptLog::Error(this->engine->IsSuspended() ? "This AI took too long to Save." : "Save function should return a table.");
 
			SaveEmpty();
 
			this->engine->CrashOccurred();
 
			return;
 
@@ -671,7 +671,7 @@ void AIInstance::Save()
 
			this->engine->CrashOccurred();
 
		}
 
	} else {
 
		AILog::Warning("Save function is not implemented");
 
		ScriptLog::Warning("Save function is not implemented");
 
		_ai_sl_byte = 0;
 
		SlObject(NULL, _ai_byte);
 
	}
 
@@ -751,7 +751,7 @@ void AIInstance::Suspend()
 

	
 
void AIInstance::Load(int version)
 
{
 
	AIObject::ActiveInstance active(this);
 
	ScriptObject::ActiveInstance active(this);
 

	
 
	if (this->engine == NULL || version == -1) {
 
		LoadEmpty();
 
@@ -777,7 +777,7 @@ bool AIInstance::CallLoad()
 
	this->is_save_data_on_stack = false;
 

	
 
	if (!this->engine->MethodExists(*this->instance, "Load")) {
 
		AILog::Warning("Loading failed: there was data for the AI to load, but the AI does not have a Load() function.");
 
		ScriptLog::Warning("Loading failed: there was data for the AI to load, but the AI does not have a Load() function.");
 

	
 
		/* Pop the savegame data and version. */
 
		sq_pop(vm, 2);
 
@@ -812,21 +812,21 @@ SQInteger AIInstance::GetOpsTillSuspend(
 

	
 
void AIInstance::DoCommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
 
{
 
	AIObject::ActiveInstance active(this);
 
	ScriptObject::ActiveInstance active(this);
 

	
 
	AIObject::SetLastCommandRes(result.Succeeded());
 
	ScriptObject::SetLastCommandRes(result.Succeeded());
 

	
 
	if (result.Failed()) {
 
		AIObject::SetLastError(AIError::StringToError(result.GetErrorMessage()));
 
		ScriptObject::SetLastError(ScriptError::StringToError(result.GetErrorMessage()));
 
	} else {
 
		AIObject::IncreaseDoCommandCosts(result.GetCost());
 
		AIObject::SetLastCost(result.GetCost());
 
		ScriptObject::IncreaseDoCommandCosts(result.GetCost());
 
		ScriptObject::SetLastCost(result.GetCost());
 
	}
 
}
 

	
 
void AIInstance::InsertEvent(class AIEvent *event)
 
void AIInstance::InsertEvent(class ScriptEvent *event)
 
{
 
	AIObject::ActiveInstance active(this);
 
	ScriptObject::ActiveInstance active(this);
 

	
 
	AIEventController::InsertEvent(event);
 
	ScriptEventController::InsertEvent(event);
 
}
src/ai/ai_instance.hpp
Show inline comments
 
@@ -77,8 +77,8 @@ private:
 
/** Runtime information about an AI like a pointer to the squirrel vm and the current state. */
 
class AIInstance {
 
public:
 
	friend class AIObject;
 
	friend class AIController;
 
	friend class ScriptObject;
 
	friend class ScriptController;
 

	
 
	/**
 
	 * Create a new AI.
 
@@ -141,7 +141,7 @@ public:
 
	/**
 
	 * Get the controller attached to the instance.
 
	 */
 
	class AIController *GetController() { return controller; }
 
	class ScriptController *GetController() { return controller; }
 

	
 
	/**
 
	 * Return the "this AI died" value
 
@@ -198,10 +198,10 @@ public:
 
	 * Insert an event for this AI.
 
	 * @param event The event to insert.
 
	 */
 
	void InsertEvent(class AIEvent *event);
 
	void InsertEvent(class ScriptEvent *event);
 

	
 
private:
 
	class AIController *controller;  ///< The AI main class.
 
	class ScriptController *controller; ///< The AI main class.
 
	class AIStorage *storage;        ///< Some global information for each running AI.
 
	class Squirrel *engine;          ///< A wrapper around the squirrel vm.
 
	SQObject *instance;              ///< Squirrel-pointer to the AI main class.
src/ai/ai_storage.hpp
Show inline comments
 
@@ -29,10 +29,10 @@ typedef bool (AIModeProc)();
 
 * The storage for each AI. It keeps track of important information.
 
 */
 
class AIStorage {
 
friend class AIObject;
 
friend class ScriptObject;
 
private:
 
	AIModeProc *mode;                ///< The current build mode we are int.
 
	class AIObject *mode_instance;   ///< The instance belonging to the current build mode.
 
	class ScriptObject *mode_instance; ///< The instance belonging to the current build mode.
 

	
 
	uint delay;                      ///< The ticks of delay each DoCommand has.
 
	bool allow_do_command;           ///< Is the usage of DoCommands restricted?
src/ai/api/ai_accounting.hpp.sq
Show inline comments
 
@@ -12,24 +12,24 @@
 
#include "../../script/api/script_accounting.hpp"
 

	
 
namespace SQConvert {
 
	/* Allow AIAccounting to be used as Squirrel parameter */
 
	template <> inline AIAccounting *GetParam(ForceType<AIAccounting *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIAccounting *)instance; }
 
	template <> inline AIAccounting &GetParam(ForceType<AIAccounting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIAccounting *)instance; }
 
	template <> inline const AIAccounting *GetParam(ForceType<const AIAccounting *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIAccounting *)instance; }
 
	template <> inline const AIAccounting &GetParam(ForceType<const AIAccounting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIAccounting *)instance; }
 
	template <> inline int Return<AIAccounting *>(HSQUIRRELVM vm, AIAccounting *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Accounting", res, NULL, DefSQDestructorCallback<AIAccounting>, true); return 1; }
 
	/* Allow ScriptAccounting to be used as Squirrel parameter */
 
	template <> inline ScriptAccounting *GetParam(ForceType<ScriptAccounting *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptAccounting *)instance; }
 
	template <> inline ScriptAccounting &GetParam(ForceType<ScriptAccounting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptAccounting *)instance; }
 
	template <> inline const ScriptAccounting *GetParam(ForceType<const ScriptAccounting *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptAccounting *)instance; }
 
	template <> inline const ScriptAccounting &GetParam(ForceType<const ScriptAccounting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptAccounting *)instance; }
 
	template <> inline int Return<ScriptAccounting *>(HSQUIRRELVM vm, ScriptAccounting *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Accounting", res, NULL, DefSQDestructorCallback<ScriptAccounting>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AIAccounting, ST_AI>() { return "AIAccounting"; }
 
template <> const char *GetClassName<ScriptAccounting, ST_AI>() { return "AIAccounting"; }
 

	
 
void SQAIAccounting_Register(Squirrel *engine)
 
{
 
	DefSQClass<AIAccounting, ST_AI> SQAIAccounting("AIAccounting");
 
	DefSQClass<ScriptAccounting, ST_AI> SQAIAccounting("AIAccounting");
 
	SQAIAccounting.PreRegister(engine);
 
	SQAIAccounting.AddConstructor<void (AIAccounting::*)(), 1>(engine, "x");
 
	SQAIAccounting.AddConstructor<void (ScriptAccounting::*)(), 1>(engine, "x");
 

	
 
	SQAIAccounting.DefSQMethod(engine, &AIAccounting::GetCosts,   "GetCosts",   1, "x");
 
	SQAIAccounting.DefSQMethod(engine, &AIAccounting::ResetCosts, "ResetCosts", 1, "x");
 
	SQAIAccounting.DefSQMethod(engine, &ScriptAccounting::GetCosts,   "GetCosts",   1, "x");
 
	SQAIAccounting.DefSQMethod(engine, &ScriptAccounting::ResetCosts, "ResetCosts", 1, "x");
 

	
 
	SQAIAccounting.PostRegister(engine);
 
}
src/ai/api/ai_airport.hpp.sq
Show inline comments
 
@@ -13,57 +13,57 @@
 

	
 
namespace SQConvert {
 
	/* Allow enums to be used as Squirrel parameters */
 
	template <> inline AIAirport::AirportType GetParam(ForceType<AIAirport::AirportType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIAirport::AirportType)tmp; }
 
	template <> inline int Return<AIAirport::AirportType>(HSQUIRRELVM vm, AIAirport::AirportType res) { sq_pushinteger(vm, (int32)res); return 1; }
 
	template <> inline AIAirport::PlaneType GetParam(ForceType<AIAirport::PlaneType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIAirport::PlaneType)tmp; }
 
	template <> inline int Return<AIAirport::PlaneType>(HSQUIRRELVM vm, AIAirport::PlaneType res) { sq_pushinteger(vm, (int32)res); return 1; }
 
	template <> inline ScriptAirport::AirportType GetParam(ForceType<ScriptAirport::AirportType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptAirport::AirportType)tmp; }
 
	template <> inline int Return<ScriptAirport::AirportType>(HSQUIRRELVM vm, ScriptAirport::AirportType res) { sq_pushinteger(vm, (int32)res); return 1; }
 
	template <> inline ScriptAirport::PlaneType GetParam(ForceType<ScriptAirport::PlaneType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptAirport::PlaneType)tmp; }
 
	template <> inline int Return<ScriptAirport::PlaneType>(HSQUIRRELVM vm, ScriptAirport::PlaneType res) { sq_pushinteger(vm, (int32)res); return 1; }
 

	
 
	/* Allow AIAirport to be used as Squirrel parameter */
 
	template <> inline AIAirport *GetParam(ForceType<AIAirport *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIAirport *)instance; }
 
	template <> inline AIAirport &GetParam(ForceType<AIAirport &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIAirport *)instance; }
 
	template <> inline const AIAirport *GetParam(ForceType<const AIAirport *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIAirport *)instance; }
 
	template <> inline const AIAirport &GetParam(ForceType<const AIAirport &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIAirport *)instance; }
 
	template <> inline int Return<AIAirport *>(HSQUIRRELVM vm, AIAirport *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Airport", res, NULL, DefSQDestructorCallback<AIAirport>, true); return 1; }
 
	/* Allow ScriptAirport to be used as Squirrel parameter */
 
	template <> inline ScriptAirport *GetParam(ForceType<ScriptAirport *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptAirport *)instance; }
 
	template <> inline ScriptAirport &GetParam(ForceType<ScriptAirport &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptAirport *)instance; }
 
	template <> inline const ScriptAirport *GetParam(ForceType<const ScriptAirport *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptAirport *)instance; }
 
	template <> inline const ScriptAirport &GetParam(ForceType<const ScriptAirport &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptAirport *)instance; }
 
	template <> inline int Return<ScriptAirport *>(HSQUIRRELVM vm, ScriptAirport *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Airport", res, NULL, DefSQDestructorCallback<ScriptAirport>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AIAirport, ST_AI>() { return "AIAirport"; }
 
template <> const char *GetClassName<ScriptAirport, ST_AI>() { return "AIAirport"; }
 

	
 
void SQAIAirport_Register(Squirrel *engine)
 
{
 
	DefSQClass<AIAirport, ST_AI> SQAIAirport("AIAirport");
 
	DefSQClass<ScriptAirport, ST_AI> SQAIAirport("AIAirport");
 
	SQAIAirport.PreRegister(engine);
 
	SQAIAirport.AddConstructor<void (AIAirport::*)(), 1>(engine, "x");
 
	SQAIAirport.AddConstructor<void (ScriptAirport::*)(), 1>(engine, "x");
 

	
 
	SQAIAirport.DefSQConst(engine, AIAirport::AT_SMALL,         "AT_SMALL");
 
	SQAIAirport.DefSQConst(engine, AIAirport::AT_LARGE,         "AT_LARGE");
 
	SQAIAirport.DefSQConst(engine, AIAirport::AT_METROPOLITAN,  "AT_METROPOLITAN");
 
	SQAIAirport.DefSQConst(engine, AIAirport::AT_INTERNATIONAL, "AT_INTERNATIONAL");
 
	SQAIAirport.DefSQConst(engine, AIAirport::AT_COMMUTER,      "AT_COMMUTER");
 
	SQAIAirport.DefSQConst(engine, AIAirport::AT_INTERCON,      "AT_INTERCON");
 
	SQAIAirport.DefSQConst(engine, AIAirport::AT_HELIPORT,      "AT_HELIPORT");
 
	SQAIAirport.DefSQConst(engine, AIAirport::AT_HELISTATION,   "AT_HELISTATION");
 
	SQAIAirport.DefSQConst(engine, AIAirport::AT_HELIDEPOT,     "AT_HELIDEPOT");
 
	SQAIAirport.DefSQConst(engine, AIAirport::AT_INVALID,       "AT_INVALID");
 
	SQAIAirport.DefSQConst(engine, AIAirport::PT_HELICOPTER,    "PT_HELICOPTER");
 
	SQAIAirport.DefSQConst(engine, AIAirport::PT_SMALL_PLANE,   "PT_SMALL_PLANE");
 
	SQAIAirport.DefSQConst(engine, AIAirport::PT_BIG_PLANE,     "PT_BIG_PLANE");
 
	SQAIAirport.DefSQConst(engine, AIAirport::PT_INVALID,       "PT_INVALID");
 
	SQAIAirport.DefSQConst(engine, ScriptAirport::AT_SMALL,         "AT_SMALL");
 
	SQAIAirport.DefSQConst(engine, ScriptAirport::AT_LARGE,         "AT_LARGE");
 
	SQAIAirport.DefSQConst(engine, ScriptAirport::AT_METROPOLITAN,  "AT_METROPOLITAN");
 
	SQAIAirport.DefSQConst(engine, ScriptAirport::AT_INTERNATIONAL, "AT_INTERNATIONAL");
 
	SQAIAirport.DefSQConst(engine, ScriptAirport::AT_COMMUTER,      "AT_COMMUTER");
 
	SQAIAirport.DefSQConst(engine, ScriptAirport::AT_INTERCON,      "AT_INTERCON");
 
	SQAIAirport.DefSQConst(engine, ScriptAirport::AT_HELIPORT,      "AT_HELIPORT");
 
	SQAIAirport.DefSQConst(engine, ScriptAirport::AT_HELISTATION,   "AT_HELISTATION");
 
	SQAIAirport.DefSQConst(engine, ScriptAirport::AT_HELIDEPOT,     "AT_HELIDEPOT");
 
	SQAIAirport.DefSQConst(engine, ScriptAirport::AT_INVALID,       "AT_INVALID");
 
	SQAIAirport.DefSQConst(engine, ScriptAirport::PT_HELICOPTER,    "PT_HELICOPTER");
 
	SQAIAirport.DefSQConst(engine, ScriptAirport::PT_SMALL_PLANE,   "PT_SMALL_PLANE");
 
	SQAIAirport.DefSQConst(engine, ScriptAirport::PT_BIG_PLANE,     "PT_BIG_PLANE");
 
	SQAIAirport.DefSQConst(engine, ScriptAirport::PT_INVALID,       "PT_INVALID");
 

	
 
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsValidAirportType,            "IsValidAirportType",            2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsAirportInformationAvailable, "IsAirportInformationAvailable", 2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetPrice,                      "GetPrice",                      2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsHangarTile,                  "IsHangarTile",                  2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsAirportTile,                 "IsAirportTile",                 2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportWidth,               "GetAirportWidth",               2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportHeight,              "GetAirportHeight",              2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportCoverageRadius,      "GetAirportCoverageRadius",      2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetNumHangars,                 "GetNumHangars",                 2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetHangarOfAirport,            "GetHangarOfAirport",            2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::BuildAirport,                  "BuildAirport",                  4, ".iii");
 
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::RemoveAirport,                 "RemoveAirport",                 2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportType,                "GetAirportType",                2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetNoiseLevelIncrease,         "GetNoiseLevelIncrease",         3, ".ii");
 
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetNearestTown,                "GetNearestTown",                3, ".ii");
 
	SQAIAirport.DefSQStaticMethod(engine, &ScriptAirport::IsValidAirportType,            "IsValidAirportType",            2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &ScriptAirport::IsAirportInformationAvailable, "IsAirportInformationAvailable", 2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &ScriptAirport::GetPrice,                      "GetPrice",                      2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &ScriptAirport::IsHangarTile,                  "IsHangarTile",                  2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &ScriptAirport::IsAirportTile,                 "IsAirportTile",                 2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &ScriptAirport::GetAirportWidth,               "GetAirportWidth",               2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &ScriptAirport::GetAirportHeight,              "GetAirportHeight",              2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &ScriptAirport::GetAirportCoverageRadius,      "GetAirportCoverageRadius",      2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &ScriptAirport::GetNumHangars,                 "GetNumHangars",                 2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &ScriptAirport::GetHangarOfAirport,            "GetHangarOfAirport",            2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &ScriptAirport::BuildAirport,                  "BuildAirport",                  4, ".iii");
 
	SQAIAirport.DefSQStaticMethod(engine, &ScriptAirport::RemoveAirport,                 "RemoveAirport",                 2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &ScriptAirport::GetAirportType,                "GetAirportType",                2, ".i");
 
	SQAIAirport.DefSQStaticMethod(engine, &ScriptAirport::GetNoiseLevelIncrease,         "GetNoiseLevelIncrease",         3, ".ii");
 
	SQAIAirport.DefSQStaticMethod(engine, &ScriptAirport::GetNearestTown,                "GetNearestTown",                3, ".ii");
 

	
 
	SQAIAirport.PostRegister(engine);
 
}
src/ai/api/ai_base.hpp.sq
Show inline comments
 
@@ -12,28 +12,28 @@
 
#include "../../script/api/script_base.hpp"
 

	
 
namespace SQConvert {
 
	/* Allow AIBase to be used as Squirrel parameter */
 
	template <> inline AIBase *GetParam(ForceType<AIBase *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIBase *)instance; }
 
	template <> inline AIBase &GetParam(ForceType<AIBase &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIBase *)instance; }
 
	template <> inline const AIBase *GetParam(ForceType<const AIBase *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIBase *)instance; }
 
	template <> inline const AIBase &GetParam(ForceType<const AIBase &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIBase *)instance; }
 
	template <> inline int Return<AIBase *>(HSQUIRRELVM vm, AIBase *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Base", res, NULL, DefSQDestructorCallback<AIBase>, true); return 1; }
 
	/* Allow ScriptBase to be used as Squirrel parameter */
 
	template <> inline ScriptBase *GetParam(ForceType<ScriptBase *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptBase *)instance; }
 
	template <> inline ScriptBase &GetParam(ForceType<ScriptBase &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptBase *)instance; }
 
	template <> inline const ScriptBase *GetParam(ForceType<const ScriptBase *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptBase *)instance; }
 
	template <> inline const ScriptBase &GetParam(ForceType<const ScriptBase &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptBase *)instance; }
 
	template <> inline int Return<ScriptBase *>(HSQUIRRELVM vm, ScriptBase *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Base", res, NULL, DefSQDestructorCallback<ScriptBase>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AIBase, ST_AI>() { return "AIBase"; }
 
template <> const char *GetClassName<ScriptBase, ST_AI>() { return "AIBase"; }
 

	
 
void SQAIBase_Register(Squirrel *engine)
 
{
 
	DefSQClass<AIBase, ST_AI> SQAIBase("AIBase");
 
	DefSQClass<ScriptBase, ST_AI> SQAIBase("AIBase");
 
	SQAIBase.PreRegister(engine);
 
	SQAIBase.AddConstructor<void (AIBase::*)(), 1>(engine, "x");
 
	SQAIBase.AddConstructor<void (ScriptBase::*)(), 1>(engine, "x");
 

	
 
	SQAIBase.DefSQStaticMethod(engine, &AIBase::Rand,          "Rand",          1, ".");
 
	SQAIBase.DefSQStaticMethod(engine, &AIBase::RandItem,      "RandItem",      2, ".i");
 
	SQAIBase.DefSQStaticMethod(engine, &AIBase::RandRange,     "RandRange",     2, ".i");
 
	SQAIBase.DefSQStaticMethod(engine, &AIBase::RandRangeItem, "RandRangeItem", 3, ".ii");
 
	SQAIBase.DefSQStaticMethod(engine, &AIBase::Chance,        "Chance",        3, ".ii");
 
	SQAIBase.DefSQStaticMethod(engine, &AIBase::ChanceItem,    "ChanceItem",    4, ".iii");
 
	SQAIBase.DefSQStaticMethod(engine, &ScriptBase::Rand,          "Rand",          1, ".");
 
	SQAIBase.DefSQStaticMethod(engine, &ScriptBase::RandItem,      "RandItem",      2, ".i");
 
	SQAIBase.DefSQStaticMethod(engine, &ScriptBase::RandRange,     "RandRange",     2, ".i");
 
	SQAIBase.DefSQStaticMethod(engine, &ScriptBase::RandRangeItem, "RandRangeItem", 3, ".ii");
 
	SQAIBase.DefSQStaticMethod(engine, &ScriptBase::Chance,        "Chance",        3, ".ii");
 
	SQAIBase.DefSQStaticMethod(engine, &ScriptBase::ChanceItem,    "ChanceItem",    4, ".iii");
 

	
 
	SQAIBase.PostRegister(engine);
 
}
src/ai/api/ai_basestation.hpp.sq
Show inline comments
 
@@ -13,34 +13,34 @@
 

	
 
namespace SQConvert {
 
	/* Allow enums to be used as Squirrel parameters */
 
	template <> inline AIBaseStation::SpecialStationIDs GetParam(ForceType<AIBaseStation::SpecialStationIDs>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIBaseStation::SpecialStationIDs)tmp; }
 
	template <> inline int Return<AIBaseStation::SpecialStationIDs>(HSQUIRRELVM vm, AIBaseStation::SpecialStationIDs res) { sq_pushinteger(vm, (int32)res); return 1; }
 
	template <> inline ScriptBaseStation::SpecialStationIDs GetParam(ForceType<ScriptBaseStation::SpecialStationIDs>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptBaseStation::SpecialStationIDs)tmp; }
 
	template <> inline int Return<ScriptBaseStation::SpecialStationIDs>(HSQUIRRELVM vm, ScriptBaseStation::SpecialStationIDs res) { sq_pushinteger(vm, (int32)res); return 1; }
 

	
 
	/* Allow AIBaseStation to be used as Squirrel parameter */
 
	template <> inline AIBaseStation *GetParam(ForceType<AIBaseStation *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIBaseStation *)instance; }
 
	template <> inline AIBaseStation &GetParam(ForceType<AIBaseStation &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIBaseStation *)instance; }
 
	template <> inline const AIBaseStation *GetParam(ForceType<const AIBaseStation *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIBaseStation *)instance; }
 
	template <> inline const AIBaseStation &GetParam(ForceType<const AIBaseStation &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIBaseStation *)instance; }
 
	template <> inline int Return<AIBaseStation *>(HSQUIRRELVM vm, AIBaseStation *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "BaseStation", res, NULL, DefSQDestructorCallback<AIBaseStation>, true); return 1; }
 
	/* Allow ScriptBaseStation to be used as Squirrel parameter */
 
	template <> inline ScriptBaseStation *GetParam(ForceType<ScriptBaseStation *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptBaseStation *)instance; }
 
	template <> inline ScriptBaseStation &GetParam(ForceType<ScriptBaseStation &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptBaseStation *)instance; }
 
	template <> inline const ScriptBaseStation *GetParam(ForceType<const ScriptBaseStation *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptBaseStation *)instance; }
 
	template <> inline const ScriptBaseStation &GetParam(ForceType<const ScriptBaseStation &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptBaseStation *)instance; }
 
	template <> inline int Return<ScriptBaseStation *>(HSQUIRRELVM vm, ScriptBaseStation *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "BaseStation", res, NULL, DefSQDestructorCallback<ScriptBaseStation>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AIBaseStation, ST_AI>() { return "AIBaseStation"; }
 
template <> const char *GetClassName<ScriptBaseStation, ST_AI>() { return "AIBaseStation"; }
 

	
 
void SQAIBaseStation_Register(Squirrel *engine)
 
{
 
	DefSQClass<AIBaseStation, ST_AI> SQAIBaseStation("AIBaseStation");
 
	DefSQClass<ScriptBaseStation, ST_AI> SQAIBaseStation("AIBaseStation");
 
	SQAIBaseStation.PreRegister(engine);
 
	SQAIBaseStation.AddConstructor<void (AIBaseStation::*)(), 1>(engine, "x");
 
	SQAIBaseStation.AddConstructor<void (ScriptBaseStation::*)(), 1>(engine, "x");
 

	
 
	SQAIBaseStation.DefSQConst(engine, AIBaseStation::STATION_NEW,           "STATION_NEW");
 
	SQAIBaseStation.DefSQConst(engine, AIBaseStation::STATION_JOIN_ADJACENT, "STATION_JOIN_ADJACENT");
 
	SQAIBaseStation.DefSQConst(engine, AIBaseStation::STATION_INVALID,       "STATION_INVALID");
 
	SQAIBaseStation.DefSQConst(engine, ScriptBaseStation::STATION_NEW,           "STATION_NEW");
 
	SQAIBaseStation.DefSQConst(engine, ScriptBaseStation::STATION_JOIN_ADJACENT, "STATION_JOIN_ADJACENT");
 
	SQAIBaseStation.DefSQConst(engine, ScriptBaseStation::STATION_INVALID,       "STATION_INVALID");
 

	
 
	SQAIBaseStation.DefSQStaticMethod(engine, &AIBaseStation::IsValidBaseStation,  "IsValidBaseStation",  2, ".i");
 
	SQAIBaseStation.DefSQStaticMethod(engine, &AIBaseStation::GetName,             "GetName",             2, ".i");
 
	SQAIBaseStation.DefSQStaticMethod(engine, &AIBaseStation::SetName,             "SetName",             3, ".i.");
 
	SQAIBaseStation.DefSQStaticMethod(engine, &AIBaseStation::GetLocation,         "GetLocation",         2, ".i");
 
	SQAIBaseStation.DefSQStaticMethod(engine, &AIBaseStation::GetConstructionDate, "GetConstructionDate", 2, ".i");
 
	SQAIBaseStation.DefSQStaticMethod(engine, &ScriptBaseStation::IsValidBaseStation,  "IsValidBaseStation",  2, ".i");
 
	SQAIBaseStation.DefSQStaticMethod(engine, &ScriptBaseStation::GetName,             "GetName",             2, ".i");
 
	SQAIBaseStation.DefSQStaticMethod(engine, &ScriptBaseStation::SetName,             "SetName",             3, ".i.");
 
	SQAIBaseStation.DefSQStaticMethod(engine, &ScriptBaseStation::GetLocation,         "GetLocation",         2, ".i");
 
	SQAIBaseStation.DefSQStaticMethod(engine, &ScriptBaseStation::GetConstructionDate, "GetConstructionDate", 2, ".i");
 

	
 
	SQAIBaseStation.PostRegister(engine);
 
}
src/ai/api/ai_bridge.hpp.sq
Show inline comments
 
@@ -13,49 +13,49 @@
 

	
 
namespace SQConvert {
 
	/* Allow enums to be used as Squirrel parameters */
 
	template <> inline AIBridge::ErrorMessages GetParam(ForceType<AIBridge::ErrorMessages>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIBridge::ErrorMessages)tmp; }
 
	template <> inline int Return<AIBridge::ErrorMessages>(HSQUIRRELVM vm, AIBridge::ErrorMessages res) { sq_pushinteger(vm, (int32)res); return 1; }
 
	template <> inline ScriptBridge::ErrorMessages GetParam(ForceType<ScriptBridge::ErrorMessages>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptBridge::ErrorMessages)tmp; }
 
	template <> inline int Return<ScriptBridge::ErrorMessages>(HSQUIRRELVM vm, ScriptBridge::ErrorMessages res) { sq_pushinteger(vm, (int32)res); return 1; }
 

	
 
	/* Allow AIBridge to be used as Squirrel parameter */
 
	template <> inline AIBridge *GetParam(ForceType<AIBridge *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIBridge *)instance; }
 
	template <> inline AIBridge &GetParam(ForceType<AIBridge &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIBridge *)instance; }
 
	template <> inline const AIBridge *GetParam(ForceType<const AIBridge *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIBridge *)instance; }
 
	template <> inline const AIBridge &GetParam(ForceType<const AIBridge &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIBridge *)instance; }
 
	template <> inline int Return<AIBridge *>(HSQUIRRELVM vm, AIBridge *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Bridge", res, NULL, DefSQDestructorCallback<AIBridge>, true); return 1; }
 
	/* Allow ScriptBridge to be used as Squirrel parameter */
 
	template <> inline ScriptBridge *GetParam(ForceType<ScriptBridge *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptBridge *)instance; }
 
	template <> inline ScriptBridge &GetParam(ForceType<ScriptBridge &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptBridge *)instance; }
 
	template <> inline const ScriptBridge *GetParam(ForceType<const ScriptBridge *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptBridge *)instance; }
 
	template <> inline const ScriptBridge &GetParam(ForceType<const ScriptBridge &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptBridge *)instance; }
 
	template <> inline int Return<ScriptBridge *>(HSQUIRRELVM vm, ScriptBridge *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Bridge", res, NULL, DefSQDestructorCallback<ScriptBridge>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AIBridge, ST_AI>() { return "AIBridge"; }
 
template <> const char *GetClassName<ScriptBridge, ST_AI>() { return "AIBridge"; }
 

	
 
void SQAIBridge_Register(Squirrel *engine)
 
{
 
	DefSQClass<AIBridge, ST_AI> SQAIBridge("AIBridge");
 
	DefSQClass<ScriptBridge, ST_AI> SQAIBridge("AIBridge");
 
	SQAIBridge.PreRegister(engine);
 
	SQAIBridge.AddConstructor<void (AIBridge::*)(), 1>(engine, "x");
 
	SQAIBridge.AddConstructor<void (ScriptBridge::*)(), 1>(engine, "x");
 

	
 
	SQAIBridge.DefSQConst(engine, AIBridge::ERR_BRIDGE_BASE,                     "ERR_BRIDGE_BASE");
 
	SQAIBridge.DefSQConst(engine, AIBridge::ERR_BRIDGE_TYPE_UNAVAILABLE,         "ERR_BRIDGE_TYPE_UNAVAILABLE");
 
	SQAIBridge.DefSQConst(engine, AIBridge::ERR_BRIDGE_CANNOT_END_IN_WATER,      "ERR_BRIDGE_CANNOT_END_IN_WATER");
 
	SQAIBridge.DefSQConst(engine, AIBridge::ERR_BRIDGE_HEADS_NOT_ON_SAME_HEIGHT, "ERR_BRIDGE_HEADS_NOT_ON_SAME_HEIGHT");
 
	SQAIBridge.DefSQConst(engine, ScriptBridge::ERR_BRIDGE_BASE,                     "ERR_BRIDGE_BASE");
 
	SQAIBridge.DefSQConst(engine, ScriptBridge::ERR_BRIDGE_TYPE_UNAVAILABLE,         "ERR_BRIDGE_TYPE_UNAVAILABLE");
 
	SQAIBridge.DefSQConst(engine, ScriptBridge::ERR_BRIDGE_CANNOT_END_IN_WATER,      "ERR_BRIDGE_CANNOT_END_IN_WATER");
 
	SQAIBridge.DefSQConst(engine, ScriptBridge::ERR_BRIDGE_HEADS_NOT_ON_SAME_HEIGHT, "ERR_BRIDGE_HEADS_NOT_ON_SAME_HEIGHT");
 

	
 
	AIError::RegisterErrorMap(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE,     AIBridge::ERR_BRIDGE_TYPE_UNAVAILABLE);
 
	AIError::RegisterErrorMap(STR_ERROR_ENDS_OF_BRIDGE_MUST_BOTH,    AIBridge::ERR_BRIDGE_CANNOT_END_IN_WATER);
 
	AIError::RegisterErrorMap(STR_ERROR_BRIDGEHEADS_NOT_SAME_HEIGHT, AIBridge::ERR_BRIDGE_HEADS_NOT_ON_SAME_HEIGHT);
 
	ScriptError::RegisterErrorMap(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE,     ScriptBridge::ERR_BRIDGE_TYPE_UNAVAILABLE);
 
	ScriptError::RegisterErrorMap(STR_ERROR_ENDS_OF_BRIDGE_MUST_BOTH,    ScriptBridge::ERR_BRIDGE_CANNOT_END_IN_WATER);
 
	ScriptError::RegisterErrorMap(STR_ERROR_BRIDGEHEADS_NOT_SAME_HEIGHT, ScriptBridge::ERR_BRIDGE_HEADS_NOT_ON_SAME_HEIGHT);
 

	
 
	AIError::RegisterErrorMapString(AIBridge::ERR_BRIDGE_TYPE_UNAVAILABLE,         "ERR_BRIDGE_TYPE_UNAVAILABLE");
 
	AIError::RegisterErrorMapString(AIBridge::ERR_BRIDGE_CANNOT_END_IN_WATER,      "ERR_BRIDGE_CANNOT_END_IN_WATER");
 
	AIError::RegisterErrorMapString(AIBridge::ERR_BRIDGE_HEADS_NOT_ON_SAME_HEIGHT, "ERR_BRIDGE_HEADS_NOT_ON_SAME_HEIGHT");
 
	ScriptError::RegisterErrorMapString(ScriptBridge::ERR_BRIDGE_TYPE_UNAVAILABLE,         "ERR_BRIDGE_TYPE_UNAVAILABLE");
 
	ScriptError::RegisterErrorMapString(ScriptBridge::ERR_BRIDGE_CANNOT_END_IN_WATER,      "ERR_BRIDGE_CANNOT_END_IN_WATER");
 
	ScriptError::RegisterErrorMapString(ScriptBridge::ERR_BRIDGE_HEADS_NOT_ON_SAME_HEIGHT, "ERR_BRIDGE_HEADS_NOT_ON_SAME_HEIGHT");
 

	
 
	SQAIBridge.DefSQStaticMethod(engine, &AIBridge::IsValidBridge,     "IsValidBridge",     2, ".i");
 
	SQAIBridge.DefSQStaticMethod(engine, &AIBridge::IsBridgeTile,      "IsBridgeTile",      2, ".i");
 
	SQAIBridge.DefSQStaticMethod(engine, &AIBridge::GetBridgeID,       "GetBridgeID",       2, ".i");
 
	SQAIBridge.DefSQStaticMethod(engine, &AIBridge::GetName,           "GetName",           2, ".i");
 
	SQAIBridge.DefSQStaticMethod(engine, &AIBridge::GetMaxSpeed,       "GetMaxSpeed",       2, ".i");
 
	SQAIBridge.DefSQStaticMethod(engine, &AIBridge::GetPrice,          "GetPrice",          3, ".ii");
 
	SQAIBridge.DefSQStaticMethod(engine, &AIBridge::GetMaxLength,      "GetMaxLength",      2, ".i");
 
	SQAIBridge.DefSQStaticMethod(engine, &AIBridge::GetMinLength,      "GetMinLength",      2, ".i");
 
	SQAIBridge.DefSQStaticMethod(engine, &AIBridge::BuildBridge,       "BuildBridge",       5, ".iiii");
 
	SQAIBridge.DefSQStaticMethod(engine, &AIBridge::RemoveBridge,      "RemoveBridge",      2, ".i");
 
	SQAIBridge.DefSQStaticMethod(engine, &AIBridge::GetOtherBridgeEnd, "GetOtherBridgeEnd", 2, ".i");
 
	SQAIBridge.DefSQStaticMethod(engine, &ScriptBridge::IsValidBridge,     "IsValidBridge",     2, ".i");
 
	SQAIBridge.DefSQStaticMethod(engine, &ScriptBridge::IsBridgeTile,      "IsBridgeTile",      2, ".i");
 
	SQAIBridge.DefSQStaticMethod(engine, &ScriptBridge::GetBridgeID,       "GetBridgeID",       2, ".i");
 
	SQAIBridge.DefSQStaticMethod(engine, &ScriptBridge::GetName,           "GetName",           2, ".i");
 
	SQAIBridge.DefSQStaticMethod(engine, &ScriptBridge::GetMaxSpeed,       "GetMaxSpeed",       2, ".i");
 
	SQAIBridge.DefSQStaticMethod(engine, &ScriptBridge::GetPrice,          "GetPrice",          3, ".ii");
 
	SQAIBridge.DefSQStaticMethod(engine, &ScriptBridge::GetMaxLength,      "GetMaxLength",      2, ".i");
 
	SQAIBridge.DefSQStaticMethod(engine, &ScriptBridge::GetMinLength,      "GetMinLength",      2, ".i");
 
	SQAIBridge.DefSQStaticMethod(engine, &ScriptBridge::BuildBridge,       "BuildBridge",       5, ".iiii");
 
	SQAIBridge.DefSQStaticMethod(engine, &ScriptBridge::RemoveBridge,      "RemoveBridge",      2, ".i");
 
	SQAIBridge.DefSQStaticMethod(engine, &ScriptBridge::GetOtherBridgeEnd, "GetOtherBridgeEnd", 2, ".i");
 

	
 
	SQAIBridge.PostRegister(engine);
 
}
src/ai/api/ai_bridgelist.hpp.sq
Show inline comments
 
@@ -12,41 +12,41 @@
 
#include "../../script/api/script_bridgelist.hpp"
 

	
 
namespace SQConvert {
 
	/* Allow AIBridgeList to be used as Squirrel parameter */
 
	template <> inline AIBridgeList *GetParam(ForceType<AIBridgeList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIBridgeList *)instance; }
 
	template <> inline AIBridgeList &GetParam(ForceType<AIBridgeList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIBridgeList *)instance; }
 
	template <> inline const AIBridgeList *GetParam(ForceType<const AIBridgeList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIBridgeList *)instance; }
 
	template <> inline const AIBridgeList &GetParam(ForceType<const AIBridgeList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIBridgeList *)instance; }
 
	template <> inline int Return<AIBridgeList *>(HSQUIRRELVM vm, AIBridgeList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "BridgeList", res, NULL, DefSQDestructorCallback<AIBridgeList>, true); return 1; }
 
	/* Allow ScriptBridgeList to be used as Squirrel parameter */
 
	template <> inline ScriptBridgeList *GetParam(ForceType<ScriptBridgeList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptBridgeList *)instance; }
 
	template <> inline ScriptBridgeList &GetParam(ForceType<ScriptBridgeList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptBridgeList *)instance; }
 
	template <> inline const ScriptBridgeList *GetParam(ForceType<const ScriptBridgeList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptBridgeList *)instance; }
 
	template <> inline const ScriptBridgeList &GetParam(ForceType<const ScriptBridgeList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptBridgeList *)instance; }
 
	template <> inline int Return<ScriptBridgeList *>(HSQUIRRELVM vm, ScriptBridgeList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "BridgeList", res, NULL, DefSQDestructorCallback<ScriptBridgeList>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AIBridgeList, ST_AI>() { return "AIBridgeList"; }
 
template <> const char *GetClassName<ScriptBridgeList, ST_AI>() { return "AIBridgeList"; }
 

	
 
void SQAIBridgeList_Register(Squirrel *engine)
 
{
 
	DefSQClass<AIBridgeList, ST_AI> SQAIBridgeList("AIBridgeList");
 
	DefSQClass<ScriptBridgeList, ST_AI> SQAIBridgeList("AIBridgeList");
 
	SQAIBridgeList.PreRegister(engine, "AIList");
 
	SQAIBridgeList.AddConstructor<void (AIBridgeList::*)(), 1>(engine, "x");
 
	SQAIBridgeList.AddConstructor<void (ScriptBridgeList::*)(), 1>(engine, "x");
 

	
 
	SQAIBridgeList.PostRegister(engine);
 
}
 

	
 
namespace SQConvert {
 
	/* Allow AIBridgeList_Length to be used as Squirrel parameter */
 
	template <> inline AIBridgeList_Length *GetParam(ForceType<AIBridgeList_Length *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIBridgeList_Length *)instance; }
 
	template <> inline AIBridgeList_Length &GetParam(ForceType<AIBridgeList_Length &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIBridgeList_Length *)instance; }
 
	template <> inline const AIBridgeList_Length *GetParam(ForceType<const AIBridgeList_Length *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIBridgeList_Length *)instance; }
 
	template <> inline const AIBridgeList_Length &GetParam(ForceType<const AIBridgeList_Length &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIBridgeList_Length *)instance; }
 
	template <> inline int Return<AIBridgeList_Length *>(HSQUIRRELVM vm, AIBridgeList_Length *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "BridgeList_Length", res, NULL, DefSQDestructorCallback<AIBridgeList_Length>, true); return 1; }
 
	/* Allow ScriptBridgeList_Length to be used as Squirrel parameter */
 
	template <> inline ScriptBridgeList_Length *GetParam(ForceType<ScriptBridgeList_Length *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptBridgeList_Length *)instance; }
 
	template <> inline ScriptBridgeList_Length &GetParam(ForceType<ScriptBridgeList_Length &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptBridgeList_Length *)instance; }
 
	template <> inline const ScriptBridgeList_Length *GetParam(ForceType<const ScriptBridgeList_Length *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptBridgeList_Length *)instance; }
 
	template <> inline const ScriptBridgeList_Length &GetParam(ForceType<const ScriptBridgeList_Length &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptBridgeList_Length *)instance; }
 
	template <> inline int Return<ScriptBridgeList_Length *>(HSQUIRRELVM vm, ScriptBridgeList_Length *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "BridgeList_Length", res, NULL, DefSQDestructorCallback<ScriptBridgeList_Length>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AIBridgeList_Length, ST_AI>() { return "AIBridgeList_Length"; }
 
template <> const char *GetClassName<ScriptBridgeList_Length, ST_AI>() { return "AIBridgeList_Length"; }
 

	
 
void SQAIBridgeList_Length_Register(Squirrel *engine)
 
{
 
	DefSQClass<AIBridgeList_Length, ST_AI> SQAIBridgeList_Length("AIBridgeList_Length");
 
	DefSQClass<ScriptBridgeList_Length, ST_AI> SQAIBridgeList_Length("AIBridgeList_Length");
 
	SQAIBridgeList_Length.PreRegister(engine, "AIList");
 
	SQAIBridgeList_Length.AddConstructor<void (AIBridgeList_Length::*)(uint length), 2>(engine, "xi");
 
	SQAIBridgeList_Length.AddConstructor<void (ScriptBridgeList_Length::*)(uint length), 2>(engine, "xi");
 

	
 
	SQAIBridgeList_Length.PostRegister(engine);
 
}
src/ai/api/ai_cargo.hpp.sq
Show inline comments
 
@@ -13,55 +13,55 @@
 

	
 
namespace SQConvert {
 
	/* Allow enums to be used as Squirrel parameters */
 
	template <> inline AICargo::CargoClass GetParam(ForceType<AICargo::CargoClass>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AICargo::CargoClass)tmp; }
 
	template <> inline int Return<AICargo::CargoClass>(HSQUIRRELVM vm, AICargo::CargoClass res) { sq_pushinteger(vm, (int32)res); return 1; }
 
	template <> inline AICargo::TownEffect GetParam(ForceType<AICargo::TownEffect>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AICargo::TownEffect)tmp; }
 
	template <> inline int Return<AICargo::TownEffect>(HSQUIRRELVM vm, AICargo::TownEffect res) { sq_pushinteger(vm, (int32)res); return 1; }
 
	template <> inline AICargo::SpecialCargoID GetParam(ForceType<AICargo::SpecialCargoID>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AICargo::SpecialCargoID)tmp; }
 
	template <> inline int Return<AICargo::SpecialCargoID>(HSQUIRRELVM vm, AICargo::SpecialCargoID res) { sq_pushinteger(vm, (int32)res); return 1; }
 
	template <> inline ScriptCargo::CargoClass GetParam(ForceType<ScriptCargo::CargoClass>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptCargo::CargoClass)tmp; }
 
	template <> inline int Return<ScriptCargo::CargoClass>(HSQUIRRELVM vm, ScriptCargo::CargoClass res) { sq_pushinteger(vm, (int32)res); return 1; }
 
	template <> inline ScriptCargo::TownEffect GetParam(ForceType<ScriptCargo::TownEffect>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptCargo::TownEffect)tmp; }
 
	template <> inline int Return<ScriptCargo::TownEffect>(HSQUIRRELVM vm, ScriptCargo::TownEffect res) { sq_pushinteger(vm, (int32)res); return 1; }
 
	template <> inline ScriptCargo::SpecialCargoID GetParam(ForceType<ScriptCargo::SpecialCargoID>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptCargo::SpecialCargoID)tmp; }
 
	template <> inline int Return<ScriptCargo::SpecialCargoID>(HSQUIRRELVM vm, ScriptCargo::SpecialCargoID res) { sq_pushinteger(vm, (int32)res); return 1; }
 

	
 
	/* Allow AICargo to be used as Squirrel parameter */
 
	template <> inline AICargo *GetParam(ForceType<AICargo *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AICargo *)instance; }
 
	template <> inline AICargo &GetParam(ForceType<AICargo &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICargo *)instance; }
 
	template <> inline const AICargo *GetParam(ForceType<const AICargo *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AICargo *)instance; }
 
	template <> inline const AICargo &GetParam(ForceType<const AICargo &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICargo *)instance; }
 
	template <> inline int Return<AICargo *>(HSQUIRRELVM vm, AICargo *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Cargo", res, NULL, DefSQDestructorCallback<AICargo>, true); return 1; }
 
	/* Allow ScriptCargo to be used as Squirrel parameter */
 
	template <> inline ScriptCargo *GetParam(ForceType<ScriptCargo *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptCargo *)instance; }
 
	template <> inline ScriptCargo &GetParam(ForceType<ScriptCargo &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptCargo *)instance; }
 
	template <> inline const ScriptCargo *GetParam(ForceType<const ScriptCargo *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptCargo *)instance; }
 
	template <> inline const ScriptCargo &GetParam(ForceType<const ScriptCargo &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptCargo *)instance; }
 
	template <> inline int Return<ScriptCargo *>(HSQUIRRELVM vm, ScriptCargo *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Cargo", res, NULL, DefSQDestructorCallback<ScriptCargo>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AICargo, ST_AI>() { return "AICargo"; }
 
template <> const char *GetClassName<ScriptCargo, ST_AI>() { return "AICargo"; }
 

	
 
void SQAICargo_Register(Squirrel *engine)
 
{
 
	DefSQClass<AICargo, ST_AI> SQAICargo("AICargo");
 
	DefSQClass<ScriptCargo, ST_AI> SQAICargo("AICargo");
 
	SQAICargo.PreRegister(engine);
 
	SQAICargo.AddConstructor<void (AICargo::*)(), 1>(engine, "x");
 
	SQAICargo.AddConstructor<void (ScriptCargo::*)(), 1>(engine, "x");
 

	
 
	SQAICargo.DefSQConst(engine, AICargo::CC_PASSENGERS,   "CC_PASSENGERS");
 
	SQAICargo.DefSQConst(engine, AICargo::CC_MAIL,         "CC_MAIL");
 
	SQAICargo.DefSQConst(engine, AICargo::CC_EXPRESS,      "CC_EXPRESS");
 
	SQAICargo.DefSQConst(engine, AICargo::CC_ARMOURED,     "CC_ARMOURED");
 
	SQAICargo.DefSQConst(engine, AICargo::CC_BULK,         "CC_BULK");
 
	SQAICargo.DefSQConst(engine, AICargo::CC_PIECE_GOODS,  "CC_PIECE_GOODS");
 
	SQAICargo.DefSQConst(engine, AICargo::CC_LIQUID,       "CC_LIQUID");
 
	SQAICargo.DefSQConst(engine, AICargo::CC_REFRIGERATED, "CC_REFRIGERATED");
 
	SQAICargo.DefSQConst(engine, AICargo::CC_HAZARDOUS,    "CC_HAZARDOUS");
 
	SQAICargo.DefSQConst(engine, AICargo::CC_COVERED,      "CC_COVERED");
 
	SQAICargo.DefSQConst(engine, AICargo::TE_NONE,         "TE_NONE");
 
	SQAICargo.DefSQConst(engine, AICargo::TE_PASSENGERS,   "TE_PASSENGERS");
 
	SQAICargo.DefSQConst(engine, AICargo::TE_MAIL,         "TE_MAIL");
 
	SQAICargo.DefSQConst(engine, AICargo::TE_GOODS,        "TE_GOODS");
 
	SQAICargo.DefSQConst(engine, AICargo::TE_WATER,        "TE_WATER");
 
	SQAICargo.DefSQConst(engine, AICargo::TE_FOOD,         "TE_FOOD");
 
	SQAICargo.DefSQConst(engine, AICargo::CT_AUTO_REFIT,   "CT_AUTO_REFIT");
 
	SQAICargo.DefSQConst(engine, AICargo::CT_NO_REFIT,     "CT_NO_REFIT");
 
	SQAICargo.DefSQConst(engine, ScriptCargo::CC_PASSENGERS,   "CC_PASSENGERS");
 
	SQAICargo.DefSQConst(engine, ScriptCargo::CC_MAIL,         "CC_MAIL");
 
	SQAICargo.DefSQConst(engine, ScriptCargo::CC_EXPRESS,      "CC_EXPRESS");
 
	SQAICargo.DefSQConst(engine, ScriptCargo::CC_ARMOURED,     "CC_ARMOURED");
 
	SQAICargo.DefSQConst(engine, ScriptCargo::CC_BULK,         "CC_BULK");
 
	SQAICargo.DefSQConst(engine, ScriptCargo::CC_PIECE_GOODS,  "CC_PIECE_GOODS");
 
	SQAICargo.DefSQConst(engine, ScriptCargo::CC_LIQUID,       "CC_LIQUID");
 
	SQAICargo.DefSQConst(engine, ScriptCargo::CC_REFRIGERATED, "CC_REFRIGERATED");
 
	SQAICargo.DefSQConst(engine, ScriptCargo::CC_HAZARDOUS,    "CC_HAZARDOUS");
 
	SQAICargo.DefSQConst(engine, ScriptCargo::CC_COVERED,      "CC_COVERED");
 
	SQAICargo.DefSQConst(engine, ScriptCargo::TE_NONE,         "TE_NONE");
 
	SQAICargo.DefSQConst(engine, ScriptCargo::TE_PASSENGERS,   "TE_PASSENGERS");
 
	SQAICargo.DefSQConst(engine, ScriptCargo::TE_MAIL,         "TE_MAIL");
 
	SQAICargo.DefSQConst(engine, ScriptCargo::TE_GOODS,        "TE_GOODS");
 
	SQAICargo.DefSQConst(engine, ScriptCargo::TE_WATER,        "TE_WATER");
 
	SQAICargo.DefSQConst(engine, ScriptCargo::TE_FOOD,         "TE_FOOD");
 
	SQAICargo.DefSQConst(engine, ScriptCargo::CT_AUTO_REFIT,   "CT_AUTO_REFIT");
 
	SQAICargo.DefSQConst(engine, ScriptCargo::CT_NO_REFIT,     "CT_NO_REFIT");
 

	
 
	SQAICargo.DefSQStaticMethod(engine, &AICargo::IsValidCargo,      "IsValidCargo",      2, ".i");
 
	SQAICargo.DefSQStaticMethod(engine, &AICargo::IsValidTownEffect, "IsValidTownEffect", 2, ".i");
 
	SQAICargo.DefSQStaticMethod(engine, &AICargo::GetCargoLabel,     "GetCargoLabel",     2, ".i");
 
	SQAICargo.DefSQStaticMethod(engine, &AICargo::IsFreight,         "IsFreight",         2, ".i");
 
	SQAICargo.DefSQStaticMethod(engine, &AICargo::HasCargoClass,     "HasCargoClass",     3, ".ii");
 
	SQAICargo.DefSQStaticMethod(engine, &AICargo::GetTownEffect,     "GetTownEffect",     2, ".i");
 
	SQAICargo.DefSQStaticMethod(engine, &AICargo::GetCargoIncome,    "GetCargoIncome",    4, ".iii");
 
	SQAICargo.DefSQStaticMethod(engine, &ScriptCargo::IsValidCargo,      "IsValidCargo",      2, ".i");
 
	SQAICargo.DefSQStaticMethod(engine, &ScriptCargo::IsValidTownEffect, "IsValidTownEffect", 2, ".i");
 
	SQAICargo.DefSQStaticMethod(engine, &ScriptCargo::GetCargoLabel,     "GetCargoLabel",     2, ".i");
 
	SQAICargo.DefSQStaticMethod(engine, &ScriptCargo::IsFreight,         "IsFreight",         2, ".i");
 
	SQAICargo.DefSQStaticMethod(engine, &ScriptCargo::HasCargoClass,     "HasCargoClass",     3, ".ii");
 
	SQAICargo.DefSQStaticMethod(engine, &ScriptCargo::GetTownEffect,     "GetTownEffect",     2, ".i");
 
	SQAICargo.DefSQStaticMethod(engine, &ScriptCargo::GetCargoIncome,    "GetCargoIncome",    4, ".iii");
 

	
 
	SQAICargo.PostRegister(engine);
 
}
src/ai/api/ai_cargolist.hpp.sq
Show inline comments
 
@@ -12,81 +12,81 @@
 
#include "../../script/api/script_cargolist.hpp"
 

	
 
namespace SQConvert {
 
	/* Allow AICargoList to be used as Squirrel parameter */
 
	template <> inline AICargoList *GetParam(ForceType<AICargoList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AICargoList *)instance; }
 
	template <> inline AICargoList &GetParam(ForceType<AICargoList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICargoList *)instance; }
 
	template <> inline const AICargoList *GetParam(ForceType<const AICargoList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AICargoList *)instance; }
 
	template <> inline const AICargoList &GetParam(ForceType<const AICargoList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICargoList *)instance; }
 
	template <> inline int Return<AICargoList *>(HSQUIRRELVM vm, AICargoList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "CargoList", res, NULL, DefSQDestructorCallback<AICargoList>, true); return 1; }
 
	/* Allow ScriptCargoList to be used as Squirrel parameter */
 
	template <> inline ScriptCargoList *GetParam(ForceType<ScriptCargoList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptCargoList *)instance; }
 
	template <> inline ScriptCargoList &GetParam(ForceType<ScriptCargoList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptCargoList *)instance; }
 
	template <> inline const ScriptCargoList *GetParam(ForceType<const ScriptCargoList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptCargoList *)instance; }
 
	template <> inline const ScriptCargoList &GetParam(ForceType<const ScriptCargoList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptCargoList *)instance; }
 
	template <> inline int Return<ScriptCargoList *>(HSQUIRRELVM vm, ScriptCargoList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "CargoList", res, NULL, DefSQDestructorCallback<ScriptCargoList>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AICargoList, ST_AI>() { return "AICargoList"; }
 
template <> const char *GetClassName<ScriptCargoList, ST_AI>() { return "AICargoList"; }
 

	
 
void SQAICargoList_Register(Squirrel *engine)
 
{
 
	DefSQClass<AICargoList, ST_AI> SQAICargoList("AICargoList");
 
	DefSQClass<ScriptCargoList, ST_AI> SQAICargoList("AICargoList");
 
	SQAICargoList.PreRegister(engine, "AIList");
 
	SQAICargoList.AddConstructor<void (AICargoList::*)(), 1>(engine, "x");
 
	SQAICargoList.AddConstructor<void (ScriptCargoList::*)(), 1>(engine, "x");
 

	
 
	SQAICargoList.PostRegister(engine);
 
}
 

	
 
namespace SQConvert {
 
	/* Allow AICargoList_IndustryAccepting to be used as Squirrel parameter */
 
	template <> inline AICargoList_IndustryAccepting *GetParam(ForceType<AICargoList_IndustryAccepting *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AICargoList_IndustryAccepting *)instance; }
 
	template <> inline AICargoList_IndustryAccepting &GetParam(ForceType<AICargoList_IndustryAccepting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICargoList_IndustryAccepting *)instance; }
 
	template <> inline const AICargoList_IndustryAccepting *GetParam(ForceType<const AICargoList_IndustryAccepting *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AICargoList_IndustryAccepting *)instance; }
 
	template <> inline const AICargoList_IndustryAccepting &GetParam(ForceType<const AICargoList_IndustryAccepting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICargoList_IndustryAccepting *)instance; }
 
	template <> inline int Return<AICargoList_IndustryAccepting *>(HSQUIRRELVM vm, AICargoList_IndustryAccepting *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "CargoList_IndustryAccepting", res, NULL, DefSQDestructorCallback<AICargoList_IndustryAccepting>, true); return 1; }
 
	/* Allow ScriptCargoList_IndustryAccepting to be used as Squirrel parameter */
 
	template <> inline ScriptCargoList_IndustryAccepting *GetParam(ForceType<ScriptCargoList_IndustryAccepting *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptCargoList_IndustryAccepting *)instance; }
 
	template <> inline ScriptCargoList_IndustryAccepting &GetParam(ForceType<ScriptCargoList_IndustryAccepting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptCargoList_IndustryAccepting *)instance; }
 
	template <> inline const ScriptCargoList_IndustryAccepting *GetParam(ForceType<const ScriptCargoList_IndustryAccepting *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptCargoList_IndustryAccepting *)instance; }
 
	template <> inline const ScriptCargoList_IndustryAccepting &GetParam(ForceType<const ScriptCargoList_IndustryAccepting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptCargoList_IndustryAccepting *)instance; }
 
	template <> inline int Return<ScriptCargoList_IndustryAccepting *>(HSQUIRRELVM vm, ScriptCargoList_IndustryAccepting *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "CargoList_IndustryAccepting", res, NULL, DefSQDestructorCallback<ScriptCargoList_IndustryAccepting>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AICargoList_IndustryAccepting, ST_AI>() { return "AICargoList_IndustryAccepting"; }
 
template <> const char *GetClassName<ScriptCargoList_IndustryAccepting, ST_AI>() { return "AICargoList_IndustryAccepting"; }
 

	
 
void SQAICargoList_IndustryAccepting_Register(Squirrel *engine)
 
{
 
	DefSQClass<AICargoList_IndustryAccepting, ST_AI> SQAICargoList_IndustryAccepting("AICargoList_IndustryAccepting");
 
	DefSQClass<ScriptCargoList_IndustryAccepting, ST_AI> SQAICargoList_IndustryAccepting("AICargoList_IndustryAccepting");
 
	SQAICargoList_IndustryAccepting.PreRegister(engine, "AIList");
 
	SQAICargoList_IndustryAccepting.AddConstructor<void (AICargoList_IndustryAccepting::*)(IndustryID industry_id), 2>(engine, "xi");
 
	SQAICargoList_IndustryAccepting.AddConstructor<void (ScriptCargoList_IndustryAccepting::*)(IndustryID industry_id), 2>(engine, "xi");
 

	
 
	SQAICargoList_IndustryAccepting.PostRegister(engine);
 
}
 

	
 
namespace SQConvert {
 
	/* Allow AICargoList_IndustryProducing to be used as Squirrel parameter */
 
	template <> inline AICargoList_IndustryProducing *GetParam(ForceType<AICargoList_IndustryProducing *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AICargoList_IndustryProducing *)instance; }
 
	template <> inline AICargoList_IndustryProducing &GetParam(ForceType<AICargoList_IndustryProducing &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICargoList_IndustryProducing *)instance; }
 
	template <> inline const AICargoList_IndustryProducing *GetParam(ForceType<const AICargoList_IndustryProducing *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AICargoList_IndustryProducing *)instance; }
 
	template <> inline const AICargoList_IndustryProducing &GetParam(ForceType<const AICargoList_IndustryProducing &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICargoList_IndustryProducing *)instance; }
 
	template <> inline int Return<AICargoList_IndustryProducing *>(HSQUIRRELVM vm, AICargoList_IndustryProducing *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "CargoList_IndustryProducing", res, NULL, DefSQDestructorCallback<AICargoList_IndustryProducing>, true); return 1; }
 
	/* Allow ScriptCargoList_IndustryProducing to be used as Squirrel parameter */
 
	template <> inline ScriptCargoList_IndustryProducing *GetParam(ForceType<ScriptCargoList_IndustryProducing *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptCargoList_IndustryProducing *)instance; }
 
	template <> inline ScriptCargoList_IndustryProducing &GetParam(ForceType<ScriptCargoList_IndustryProducing &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptCargoList_IndustryProducing *)instance; }
 
	template <> inline const ScriptCargoList_IndustryProducing *GetParam(ForceType<const ScriptCargoList_IndustryProducing *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptCargoList_IndustryProducing *)instance; }
 
	template <> inline const ScriptCargoList_IndustryProducing &GetParam(ForceType<const ScriptCargoList_IndustryProducing &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptCargoList_IndustryProducing *)instance; }
 
	template <> inline int Return<ScriptCargoList_IndustryProducing *>(HSQUIRRELVM vm, ScriptCargoList_IndustryProducing *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "CargoList_IndustryProducing", res, NULL, DefSQDestructorCallback<ScriptCargoList_IndustryProducing>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AICargoList_IndustryProducing, ST_AI>() { return "AICargoList_IndustryProducing"; }
 
template <> const char *GetClassName<ScriptCargoList_IndustryProducing, ST_AI>() { return "AICargoList_IndustryProducing"; }
 

	
 
void SQAICargoList_IndustryProducing_Register(Squirrel *engine)
 
{
 
	DefSQClass<AICargoList_IndustryProducing, ST_AI> SQAICargoList_IndustryProducing("AICargoList_IndustryProducing");
 
	DefSQClass<ScriptCargoList_IndustryProducing, ST_AI> SQAICargoList_IndustryProducing("AICargoList_IndustryProducing");
 
	SQAICargoList_IndustryProducing.PreRegister(engine, "AIList");
 
	SQAICargoList_IndustryProducing.AddConstructor<void (AICargoList_IndustryProducing::*)(IndustryID industry_id), 2>(engine, "xi");
 
	SQAICargoList_IndustryProducing.AddConstructor<void (ScriptCargoList_IndustryProducing::*)(IndustryID industry_id), 2>(engine, "xi");
 

	
 
	SQAICargoList_IndustryProducing.PostRegister(engine);
 
}
 

	
 
namespace SQConvert {
 
	/* Allow AICargoList_StationAccepting to be used as Squirrel parameter */
 
	template <> inline AICargoList_StationAccepting *GetParam(ForceType<AICargoList_StationAccepting *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AICargoList_StationAccepting *)instance; }
 
	template <> inline AICargoList_StationAccepting &GetParam(ForceType<AICargoList_StationAccepting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICargoList_StationAccepting *)instance; }
 
	template <> inline const AICargoList_StationAccepting *GetParam(ForceType<const AICargoList_StationAccepting *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AICargoList_StationAccepting *)instance; }
 
	template <> inline const AICargoList_StationAccepting &GetParam(ForceType<const AICargoList_StationAccepting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICargoList_StationAccepting *)instance; }
 
	template <> inline int Return<AICargoList_StationAccepting *>(HSQUIRRELVM vm, AICargoList_StationAccepting *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "CargoList_StationAccepting", res, NULL, DefSQDestructorCallback<AICargoList_StationAccepting>, true); return 1; }
 
	/* Allow ScriptCargoList_StationAccepting to be used as Squirrel parameter */
 
	template <> inline ScriptCargoList_StationAccepting *GetParam(ForceType<ScriptCargoList_StationAccepting *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptCargoList_StationAccepting *)instance; }
 
	template <> inline ScriptCargoList_StationAccepting &GetParam(ForceType<ScriptCargoList_StationAccepting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptCargoList_StationAccepting *)instance; }
 
	template <> inline const ScriptCargoList_StationAccepting *GetParam(ForceType<const ScriptCargoList_StationAccepting *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptCargoList_StationAccepting *)instance; }
 
	template <> inline const ScriptCargoList_StationAccepting &GetParam(ForceType<const ScriptCargoList_StationAccepting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptCargoList_StationAccepting *)instance; }
 
	template <> inline int Return<ScriptCargoList_StationAccepting *>(HSQUIRRELVM vm, ScriptCargoList_StationAccepting *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "CargoList_StationAccepting", res, NULL, DefSQDestructorCallback<ScriptCargoList_StationAccepting>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AICargoList_StationAccepting, ST_AI>() { return "AICargoList_StationAccepting"; }
 
template <> const char *GetClassName<ScriptCargoList_StationAccepting, ST_AI>() { return "AICargoList_StationAccepting"; }
 

	
 
void SQAICargoList_StationAccepting_Register(Squirrel *engine)
 
{
 
	DefSQClass<AICargoList_StationAccepting, ST_AI> SQAICargoList_StationAccepting("AICargoList_StationAccepting");
 
	DefSQClass<ScriptCargoList_StationAccepting, ST_AI> SQAICargoList_StationAccepting("AICargoList_StationAccepting");
 
	SQAICargoList_StationAccepting.PreRegister(engine, "AIList");
 
	SQAICargoList_StationAccepting.AddConstructor<void (AICargoList_StationAccepting::*)(StationID station_id), 2>(engine, "xi");
 
	SQAICargoList_StationAccepting.AddConstructor<void (ScriptCargoList_StationAccepting::*)(StationID station_id), 2>(engine, "xi");
 

	
 
	SQAICargoList_StationAccepting.PostRegister(engine);
 
}
src/ai/api/ai_company.hpp.sq
Show inline comments
 
@@ -13,66 +13,66 @@
 

	
 
namespace SQConvert {
 
	/* Allow enums to be used as Squirrel parameters */
 
	template <> inline AICompany::Quarter GetParam(ForceType<AICompany::Quarter>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AICompany::Quarter)tmp; }
 
	template <> inline int Return<AICompany::Quarter>(HSQUIRRELVM vm, AICompany::Quarter res) { sq_pushinteger(vm, (int32)res); return 1; }
 
	template <> inline AICompany::CompanyID GetParam(ForceType<AICompany::CompanyID>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AICompany::CompanyID)tmp; }
 
	template <> inline int Return<AICompany::CompanyID>(HSQUIRRELVM vm, AICompany::CompanyID res) { sq_pushinteger(vm, (int32)res); return 1; }
 
	template <> inline AICompany::Gender GetParam(ForceType<AICompany::Gender>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AICompany::Gender)tmp; }
 
	template <> inline int Return<AICompany::Gender>(HSQUIRRELVM vm, AICompany::Gender res) { sq_pushinteger(vm, (int32)res); return 1; }
 
	template <> inline ScriptCompany::Quarter GetParam(ForceType<ScriptCompany::Quarter>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptCompany::Quarter)tmp; }
 
	template <> inline int Return<ScriptCompany::Quarter>(HSQUIRRELVM vm, ScriptCompany::Quarter res) { sq_pushinteger(vm, (int32)res); return 1; }
 
	template <> inline ScriptCompany::CompanyID GetParam(ForceType<ScriptCompany::CompanyID>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptCompany::CompanyID)tmp; }
 
	template <> inline int Return<ScriptCompany::CompanyID>(HSQUIRRELVM vm, ScriptCompany::CompanyID res) { sq_pushinteger(vm, (int32)res); return 1; }
 
	template <> inline ScriptCompany::Gender GetParam(ForceType<ScriptCompany::Gender>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptCompany::Gender)tmp; }
 
	template <> inline int Return<ScriptCompany::Gender>(HSQUIRRELVM vm, ScriptCompany::Gender res) { sq_pushinteger(vm, (int32)res); return 1; }
 

	
 
	/* Allow AICompany to be used as Squirrel parameter */
 
	template <> inline AICompany *GetParam(ForceType<AICompany *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AICompany *)instance; }
 
	template <> inline AICompany &GetParam(ForceType<AICompany &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICompany *)instance; }
 
	template <> inline const AICompany *GetParam(ForceType<const AICompany *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AICompany *)instance; }
 
	template <> inline const AICompany &GetParam(ForceType<const AICompany &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICompany *)instance; }
 
	template <> inline int Return<AICompany *>(HSQUIRRELVM vm, AICompany *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Company", res, NULL, DefSQDestructorCallback<AICompany>, true); return 1; }
 
	/* Allow ScriptCompany to be used as Squirrel parameter */
 
	template <> inline ScriptCompany *GetParam(ForceType<ScriptCompany *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptCompany *)instance; }
 
	template <> inline ScriptCompany &GetParam(ForceType<ScriptCompany &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptCompany *)instance; }
 
	template <> inline const ScriptCompany *GetParam(ForceType<const ScriptCompany *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptCompany *)instance; }
 
	template <> inline const ScriptCompany &GetParam(ForceType<const ScriptCompany &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptCompany *)instance; }
 
	template <> inline int Return<ScriptCompany *>(HSQUIRRELVM vm, ScriptCompany *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Company", res, NULL, DefSQDestructorCallback<ScriptCompany>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AICompany, ST_AI>() { return "AICompany"; }
 
template <> const char *GetClassName<ScriptCompany, ST_AI>() { return "AICompany"; }
 

	
 
void SQAICompany_Register(Squirrel *engine)
 
{
 
	DefSQClass<AICompany, ST_AI> SQAICompany("AICompany");
 
	DefSQClass<ScriptCompany, ST_AI> SQAICompany("AICompany");
 
	SQAICompany.PreRegister(engine);
 
	SQAICompany.AddConstructor<void (AICompany::*)(), 1>(engine, "x");
 
	SQAICompany.AddConstructor<void (ScriptCompany::*)(), 1>(engine, "x");
 

	
 
	SQAICompany.DefSQConst(engine, AICompany::CURRENT_QUARTER,  "CURRENT_QUARTER");
 
	SQAICompany.DefSQConst(engine, AICompany::EARLIEST_QUARTER, "EARLIEST_QUARTER");
 
	SQAICompany.DefSQConst(engine, AICompany::COMPANY_FIRST,    "COMPANY_FIRST");
 
	SQAICompany.DefSQConst(engine, AICompany::COMPANY_LAST,     "COMPANY_LAST");
 
	SQAICompany.DefSQConst(engine, AICompany::COMPANY_SELF,     "COMPANY_SELF");
 
	SQAICompany.DefSQConst(engine, AICompany::COMPANY_INVALID,  "COMPANY_INVALID");
 
	SQAICompany.DefSQConst(engine, AICompany::GENDER_MALE,      "GENDER_MALE");
 
	SQAICompany.DefSQConst(engine, AICompany::GENDER_FEMALE,    "GENDER_FEMALE");
 
	SQAICompany.DefSQConst(engine, AICompany::GENDER_INVALID,   "GENDER_INVALID");
 
	SQAICompany.DefSQConst(engine, ScriptCompany::CURRENT_QUARTER,  "CURRENT_QUARTER");
 
	SQAICompany.DefSQConst(engine, ScriptCompany::EARLIEST_QUARTER, "EARLIEST_QUARTER");
 
	SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_FIRST,    "COMPANY_FIRST");
 
	SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_LAST,     "COMPANY_LAST");
 
	SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_SELF,     "COMPANY_SELF");
 
	SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_INVALID,  "COMPANY_INVALID");
 
	SQAICompany.DefSQConst(engine, ScriptCompany::GENDER_MALE,      "GENDER_MALE");
 
	SQAICompany.DefSQConst(engine, ScriptCompany::GENDER_FEMALE,    "GENDER_FEMALE");
 
	SQAICompany.DefSQConst(engine, ScriptCompany::GENDER_INVALID,   "GENDER_INVALID");
 

	
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::ResolveCompanyID,              "ResolveCompanyID",              2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::IsMine,                        "IsMine",                        2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::SetName,                       "SetName",                       2, "..");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetName,                       "GetName",                       2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::SetPresidentName,              "SetPresidentName",              2, "..");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetPresidentName,              "GetPresidentName",              2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::SetPresidentGender,            "SetPresidentGender",            2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetPresidentGender,            "GetPresidentGender",            2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::SetLoanAmount,                 "SetLoanAmount",                 2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::SetMinimumLoanAmount,          "SetMinimumLoanAmount",          2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetLoanAmount,                 "GetLoanAmount",                 1, ".");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetMaxLoanAmount,              "GetMaxLoanAmount",              1, ".");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetLoanInterval,               "GetLoanInterval",               1, ".");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetBankBalance,                "GetBankBalance",                2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetQuarterlyIncome,            "GetQuarterlyIncome",            3, ".ii");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetQuarterlyExpenses,          "GetQuarterlyExpenses",          3, ".ii");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetQuarterlyCargoDelivered,    "GetQuarterlyCargoDelivered",    3, ".ii");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetQuarterlyPerformanceRating, "GetQuarterlyPerformanceRating", 3, ".ii");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetQuarterlyCompanyValue,      "GetQuarterlyCompanyValue",      3, ".ii");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::BuildCompanyHQ,                "BuildCompanyHQ",                2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetCompanyHQ,                  "GetCompanyHQ",                  2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::SetAutoRenewStatus,            "SetAutoRenewStatus",            2, ".b");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetAutoRenewStatus,            "GetAutoRenewStatus",            2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::SetAutoRenewMonths,            "SetAutoRenewMonths",            2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetAutoRenewMonths,            "GetAutoRenewMonths",            2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::SetAutoRenewMoney,             "SetAutoRenewMoney",             2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetAutoRenewMoney,             "GetAutoRenewMoney",             2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::ResolveCompanyID,              "ResolveCompanyID",              2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::IsMine,                        "IsMine",                        2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::SetName,                       "SetName",                       2, "..");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetName,                       "GetName",                       2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::SetPresidentName,              "SetPresidentName",              2, "..");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetPresidentName,              "GetPresidentName",              2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::SetPresidentGender,            "SetPresidentGender",            2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetPresidentGender,            "GetPresidentGender",            2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::SetLoanAmount,                 "SetLoanAmount",                 2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::SetMinimumLoanAmount,          "SetMinimumLoanAmount",          2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetLoanAmount,                 "GetLoanAmount",                 1, ".");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetMaxLoanAmount,              "GetMaxLoanAmount",              1, ".");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetLoanInterval,               "GetLoanInterval",               1, ".");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetBankBalance,                "GetBankBalance",                2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetQuarterlyIncome,            "GetQuarterlyIncome",            3, ".ii");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetQuarterlyExpenses,          "GetQuarterlyExpenses",          3, ".ii");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetQuarterlyCargoDelivered,    "GetQuarterlyCargoDelivered",    3, ".ii");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetQuarterlyPerformanceRating, "GetQuarterlyPerformanceRating", 3, ".ii");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetQuarterlyCompanyValue,      "GetQuarterlyCompanyValue",      3, ".ii");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::BuildCompanyHQ,                "BuildCompanyHQ",                2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetCompanyHQ,                  "GetCompanyHQ",                  2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::SetAutoRenewStatus,            "SetAutoRenewStatus",            2, ".b");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetAutoRenewStatus,            "GetAutoRenewStatus",            2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::SetAutoRenewMonths,            "SetAutoRenewMonths",            2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetAutoRenewMonths,            "GetAutoRenewMonths",            2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::SetAutoRenewMoney,             "SetAutoRenewMoney",             2, ".i");
 
	SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetAutoRenewMoney,             "GetAutoRenewMoney",             2, ".i");
 

	
 
	SQAICompany.PostRegister(engine);
 
}
src/ai/api/ai_controller.hpp.sq
Show inline comments
 
@@ -9,23 +9,23 @@
 

	
 
#include "../../script/api/script_controller.hpp"
 

	
 
template <> const char *GetClassName<AIController, ST_AI>() { return "AIController"; }
 
template <> const char *GetClassName<ScriptController, ST_AI>() { return "AIController"; }
 

	
 
void SQAIController_Register(Squirrel *engine)
 
{
 
	DefSQClass<AIController, ST_AI> SQAIController("AIController");
 
	DefSQClass<ScriptController, ST_AI> SQAIController("AIController");
 
	SQAIController.PreRegister(engine);
 

	
 
	SQAIController.DefSQStaticMethod(engine, &AIController::GetTick,           "GetTick",           1, ".");
 
	SQAIController.DefSQStaticMethod(engine, &AIController::GetOpsTillSuspend, "GetOpsTillSuspend", 1, ".");
 
	SQAIController.DefSQStaticMethod(engine, &AIController::SetCommandDelay,   "SetCommandDelay",   2, ".i");
 
	SQAIController.DefSQStaticMethod(engine, &AIController::Sleep,             "Sleep",             2, ".i");
 
	SQAIController.DefSQStaticMethod(engine, &AIController::GetSetting,        "GetSetting",        2, ".s");
 
	SQAIController.DefSQStaticMethod(engine, &AIController::GetVersion,        "GetVersion",        1, ".");
 
	SQAIController.DefSQStaticMethod(engine, &AIController::Print,             "Print",             3, ".bs");
 
	SQAIController.DefSQStaticMethod(engine, &ScriptController::GetTick,           "GetTick",           1, ".");
 
	SQAIController.DefSQStaticMethod(engine, &ScriptController::GetOpsTillSuspend, "GetOpsTillSuspend", 1, ".");
 
	SQAIController.DefSQStaticMethod(engine, &ScriptController::SetCommandDelay,   "SetCommandDelay",   2, ".i");
 
	SQAIController.DefSQStaticMethod(engine, &ScriptController::Sleep,             "Sleep",             2, ".i");
 
	SQAIController.DefSQStaticMethod(engine, &ScriptController::GetSetting,        "GetSetting",        2, ".s");
 
	SQAIController.DefSQStaticMethod(engine, &ScriptController::GetVersion,        "GetVersion",        1, ".");
 
	SQAIController.DefSQStaticMethod(engine, &ScriptController::Print,             "Print",             3, ".bs");
 

	
 
	SQAIController.PostRegister(engine);
 

	
 
	/* Register the import statement to the global scope */
 
	SQAIController.DefSQStaticMethod(engine, &AIController::Import,            "import",            4, ".ssi");
 
	SQAIController.DefSQStaticMethod(engine, &ScriptController::Import,            "import",            4, ".ssi");
 
}
src/ai/api/ai_date.hpp.sq
Show inline comments
 
@@ -12,27 +12,27 @@
 
#include "../../script/api/script_date.hpp"
 

	
 
namespace SQConvert {
 
	/* Allow AIDate to be used as Squirrel parameter */
 
	template <> inline AIDate *GetParam(ForceType<AIDate *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIDate *)instance; }
 
	template <> inline AIDate &GetParam(ForceType<AIDate &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIDate *)instance; }
 
	template <> inline const AIDate *GetParam(ForceType<const AIDate *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIDate *)instance; }
 
	template <> inline const AIDate &GetParam(ForceType<const AIDate &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIDate *)instance; }
 
	template <> inline int Return<AIDate *>(HSQUIRRELVM vm, AIDate *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Date", res, NULL, DefSQDestructorCallback<AIDate>, true); return 1; }
 
	/* Allow ScriptDate to be used as Squirrel parameter */
 
	template <> inline ScriptDate *GetParam(ForceType<ScriptDate *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptDate *)instance; }
 
	template <> inline ScriptDate &GetParam(ForceType<ScriptDate &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptDate *)instance; }
 
	template <> inline const ScriptDate *GetParam(ForceType<const ScriptDate *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptDate *)instance; }
 
	template <> inline const ScriptDate &GetParam(ForceType<const ScriptDate &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptDate *)instance; }
 
	template <> inline int Return<ScriptDate *>(HSQUIRRELVM vm, ScriptDate *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Date", res, NULL, DefSQDestructorCallback<ScriptDate>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AIDate, ST_AI>() { return "AIDate"; }
 
template <> const char *GetClassName<ScriptDate, ST_AI>() { return "AIDate"; }
 

	
 
void SQAIDate_Register(Squirrel *engine)
 
{
 
	DefSQClass<AIDate, ST_AI> SQAIDate("AIDate");
 
	DefSQClass<ScriptDate, ST_AI> SQAIDate("AIDate");
 
	SQAIDate.PreRegister(engine);
 
	SQAIDate.AddConstructor<void (AIDate::*)(), 1>(engine, "x");
 
	SQAIDate.AddConstructor<void (ScriptDate::*)(), 1>(engine, "x");
 

	
 
	SQAIDate.DefSQStaticMethod(engine, &AIDate::GetCurrentDate, "GetCurrentDate", 1, ".");
 
	SQAIDate.DefSQStaticMethod(engine, &AIDate::GetYear,        "GetYear",        2, ".i");
 
	SQAIDate.DefSQStaticMethod(engine, &AIDate::GetMonth,       "GetMonth",       2, ".i");
 
	SQAIDate.DefSQStaticMethod(engine, &AIDate::GetDayOfMonth,  "GetDayOfMonth",  2, ".i");
 
	SQAIDate.DefSQStaticMethod(engine, &AIDate::GetDate,        "GetDate",        4, ".iii");
 
	SQAIDate.DefSQStaticMethod(engine, &ScriptDate::GetCurrentDate, "GetCurrentDate", 1, ".");
 
	SQAIDate.DefSQStaticMethod(engine, &ScriptDate::GetYear,        "GetYear",        2, ".i");
 
	SQAIDate.DefSQStaticMethod(engine, &ScriptDate::GetMonth,       "GetMonth",       2, ".i");
 
	SQAIDate.DefSQStaticMethod(engine, &ScriptDate::GetDayOfMonth,  "GetDayOfMonth",  2, ".i");
 
	SQAIDate.DefSQStaticMethod(engine, &ScriptDate::GetDate,        "GetDate",        4, ".iii");
 

	
 
	SQAIDate.PostRegister(engine);
 
}
src/ai/api/ai_depotlist.hpp.sq
Show inline comments
 
@@ -12,21 +12,21 @@
 
#include "../../script/api/script_depotlist.hpp"
 

	
 
namespace SQConvert {
 
	/* Allow AIDepotList to be used as Squirrel parameter */
 
	template <> inline AIDepotList *GetParam(ForceType<AIDepotList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIDepotList *)instance; }
 
	template <> inline AIDepotList &GetParam(ForceType<AIDepotList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIDepotList *)instance; }
 
	template <> inline const AIDepotList *GetParam(ForceType<const AIDepotList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIDepotList *)instance; }
 
	template <> inline const AIDepotList &GetParam(ForceType<const AIDepotList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIDepotList *)instance; }
 
	template <> inline int Return<AIDepotList *>(HSQUIRRELVM vm, AIDepotList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "DepotList", res, NULL, DefSQDestructorCallback<AIDepotList>, true); return 1; }
 
	/* Allow ScriptDepotList to be used as Squirrel parameter */
 
	template <> inline ScriptDepotList *GetParam(ForceType<ScriptDepotList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptDepotList *)instance; }
 
	template <> inline ScriptDepotList &GetParam(ForceType<ScriptDepotList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptDepotList *)instance; }
 
	template <> inline const ScriptDepotList *GetParam(ForceType<const ScriptDepotList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptDepotList *)instance; }
 
	template <> inline const ScriptDepotList &GetParam(ForceType<const ScriptDepotList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptDepotList *)instance; }
 
	template <> inline int Return<ScriptDepotList *>(HSQUIRRELVM vm, ScriptDepotList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "DepotList", res, NULL, DefSQDestructorCallback<ScriptDepotList>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AIDepotList, ST_AI>() { return "AIDepotList"; }
 
template <> const char *GetClassName<ScriptDepotList, ST_AI>() { return "AIDepotList"; }
 

	
 
void SQAIDepotList_Register(Squirrel *engine)
 
{
 
	DefSQClass<AIDepotList, ST_AI> SQAIDepotList("AIDepotList");
 
	DefSQClass<ScriptDepotList, ST_AI> SQAIDepotList("AIDepotList");
 
	SQAIDepotList.PreRegister(engine, "AIList");
 
	SQAIDepotList.AddConstructor<void (AIDepotList::*)(AITile::TransportType transport_type), 2>(engine, "xi");
 
	SQAIDepotList.AddConstructor<void (ScriptDepotList::*)(ScriptTile::TransportType transport_type), 2>(engine, "xi");
 

	
 
	SQAIDepotList.PostRegister(engine);
 
}
src/ai/api/ai_engine.hpp.sq
Show inline comments
 
@@ -12,46 +12,46 @@
 
#include "../../script/api/script_engine.hpp"
 

	
 
namespace SQConvert {
 
	/* Allow AIEngine to be used as Squirrel parameter */
 
	template <> inline AIEngine *GetParam(ForceType<AIEngine *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIEngine *)instance; }
 
	template <> inline AIEngine &GetParam(ForceType<AIEngine &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIEngine *)instance; }
 
	template <> inline const AIEngine *GetParam(ForceType<const AIEngine *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIEngine *)instance; }
 
	template <> inline const AIEngine &GetParam(ForceType<const AIEngine &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIEngine *)instance; }
 
	template <> inline int Return<AIEngine *>(HSQUIRRELVM vm, AIEngine *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Engine", res, NULL, DefSQDestructorCallback<AIEngine>, true); return 1; }
 
	/* Allow ScriptEngine to be used as Squirrel parameter */
 
	template <> inline ScriptEngine *GetParam(ForceType<ScriptEngine *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptEngine *)instance; }
 
	template <> inline ScriptEngine &GetParam(ForceType<ScriptEngine &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptEngine *)instance; }
 
	template <> inline const ScriptEngine *GetParam(ForceType<const ScriptEngine *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptEngine *)instance; }
 
	template <> inline const ScriptEngine &GetParam(ForceType<const ScriptEngine &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptEngine *)instance; }
 
	template <> inline int Return<ScriptEngine *>(HSQUIRRELVM vm, ScriptEngine *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Engine", res, NULL, DefSQDestructorCallback<ScriptEngine>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AIEngine, ST_AI>() { return "AIEngine"; }
 
template <> const char *GetClassName<ScriptEngine, ST_AI>() { return "AIEngine"; }
 

	
 
void SQAIEngine_Register(Squirrel *engine)
 
{
 
	DefSQClass<AIEngine, ST_AI> SQAIEngine("AIEngine");
 
	DefSQClass<ScriptEngine, ST_AI> SQAIEngine("AIEngine");
 
	SQAIEngine.PreRegister(engine);
 
	SQAIEngine.AddConstructor<void (AIEngine::*)(), 1>(engine, "x");
 
	SQAIEngine.AddConstructor<void (ScriptEngine::*)(), 1>(engine, "x");
 

	
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::IsValidEngine,        "IsValidEngine",        2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::IsBuildable,          "IsBuildable",          2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetName,              "GetName",              2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetCargoType,         "GetCargoType",         2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::CanRefitCargo,        "CanRefitCargo",        3, ".ii");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::CanPullCargo,         "CanPullCargo",         3, ".ii");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetCapacity,          "GetCapacity",          2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetReliability,       "GetReliability",       2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetMaxSpeed,          "GetMaxSpeed",          2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetPrice,             "GetPrice",             2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetMaxAge,            "GetMaxAge",            2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetRunningCost,       "GetRunningCost",       2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetPower,             "GetPower",             2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetWeight,            "GetWeight",            2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetMaxTractiveEffort, "GetMaxTractiveEffort", 2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetDesignDate,        "GetDesignDate",        2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetVehicleType,       "GetVehicleType",       2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::IsWagon,              "IsWagon",              2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::CanRunOnRail,         "CanRunOnRail",         3, ".ii");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::HasPowerOnRail,       "HasPowerOnRail",       3, ".ii");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetRoadType,          "GetRoadType",          2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetRailType,          "GetRailType",          2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::IsArticulated,        "IsArticulated",        2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetPlaneType,         "GetPlaneType",         2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::IsValidEngine,        "IsValidEngine",        2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::IsBuildable,          "IsBuildable",          2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::GetName,              "GetName",              2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::GetCargoType,         "GetCargoType",         2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::CanRefitCargo,        "CanRefitCargo",        3, ".ii");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::CanPullCargo,         "CanPullCargo",         3, ".ii");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::GetCapacity,          "GetCapacity",          2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::GetReliability,       "GetReliability",       2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::GetMaxSpeed,          "GetMaxSpeed",          2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::GetPrice,             "GetPrice",             2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::GetMaxAge,            "GetMaxAge",            2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::GetRunningCost,       "GetRunningCost",       2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::GetPower,             "GetPower",             2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::GetWeight,            "GetWeight",            2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::GetMaxTractiveEffort, "GetMaxTractiveEffort", 2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::GetDesignDate,        "GetDesignDate",        2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::GetVehicleType,       "GetVehicleType",       2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::IsWagon,              "IsWagon",              2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::CanRunOnRail,         "CanRunOnRail",         3, ".ii");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::HasPowerOnRail,       "HasPowerOnRail",       3, ".ii");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::GetRoadType,          "GetRoadType",          2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::GetRailType,          "GetRailType",          2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::IsArticulated,        "IsArticulated",        2, ".i");
 
	SQAIEngine.DefSQStaticMethod(engine, &ScriptEngine::GetPlaneType,         "GetPlaneType",         2, ".i");
 

	
 
	SQAIEngine.PostRegister(engine);
 
}
src/ai/api/ai_enginelist.hpp.sq
Show inline comments
 
@@ -12,21 +12,21 @@
 
#include "../../script/api/script_enginelist.hpp"
 

	
 
namespace SQConvert {
 
	/* Allow AIEngineList to be used as Squirrel parameter */
 
	template <> inline AIEngineList *GetParam(ForceType<AIEngineList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIEngineList *)instance; }
 
	template <> inline AIEngineList &GetParam(ForceType<AIEngineList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIEngineList *)instance; }
 
	template <> inline const AIEngineList *GetParam(ForceType<const AIEngineList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIEngineList *)instance; }
 
	template <> inline const AIEngineList &GetParam(ForceType<const AIEngineList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIEngineList *)instance; }
 
	template <> inline int Return<AIEngineList *>(HSQUIRRELVM vm, AIEngineList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "EngineList", res, NULL, DefSQDestructorCallback<AIEngineList>, true); return 1; }
 
	/* Allow ScriptEngineList to be used as Squirrel parameter */
 
	template <> inline ScriptEngineList *GetParam(ForceType<ScriptEngineList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptEngineList *)instance; }
 
	template <> inline ScriptEngineList &GetParam(ForceType<ScriptEngineList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptEngineList *)instance; }
 
	template <> inline const ScriptEngineList *GetParam(ForceType<const ScriptEngineList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptEngineList *)instance; }
 
	template <> inline const ScriptEngineList &GetParam(ForceType<const ScriptEngineList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptEngineList *)instance; }
 
	template <> inline int Return<ScriptEngineList *>(HSQUIRRELVM vm, ScriptEngineList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "EngineList", res, NULL, DefSQDestructorCallback<ScriptEngineList>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AIEngineList, ST_AI>() { return "AIEngineList"; }
 
template <> const char *GetClassName<ScriptEngineList, ST_AI>() { return "AIEngineList"; }
 

	
 
void SQAIEngineList_Register(Squirrel *engine)
 
{
 
	DefSQClass<AIEngineList, ST_AI> SQAIEngineList("AIEngineList");
 
	DefSQClass<ScriptEngineList, ST_AI> SQAIEngineList("AIEngineList");
 
	SQAIEngineList.PreRegister(engine, "AIList");
 
	SQAIEngineList.AddConstructor<void (AIEngineList::*)(AIVehicle::VehicleType vehicle_type), 2>(engine, "xi");
 
	SQAIEngineList.AddConstructor<void (ScriptEngineList::*)(ScriptVehicle::VehicleType vehicle_type), 2>(engine, "xi");
 

	
 
	SQAIEngineList.PostRegister(engine);
 
}
src/ai/api/ai_error.hpp.sq
Show inline comments
 
@@ -13,116 +13,116 @@
 

	
 
namespace SQConvert {
 
	/* Allow enums to be used as Squirrel parameters */
 
	template <> inline AIError::ErrorCategories GetParam(ForceType<AIError::ErrorCategories>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIError::ErrorCategories)tmp; }
 
	template <> inline int Return<AIError::ErrorCategories>(HSQUIRRELVM vm, AIError::ErrorCategories res) { sq_pushinteger(vm, (int32)res); return 1; }
 
	template <> inline AIError::ErrorMessages GetParam(ForceType<AIError::ErrorMessages>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIError::ErrorMessages)tmp; }
 
	template <> inline int Return<AIError::ErrorMessages>(HSQUIRRELVM vm, AIError::ErrorMessages res) { sq_pushinteger(vm, (int32)res); return 1; }
 
	template <> inline ScriptError::ErrorCategories GetParam(ForceType<ScriptError::ErrorCategories>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptError::ErrorCategories)tmp; }
 
	template <> inline int Return<ScriptError::ErrorCategories>(HSQUIRRELVM vm, ScriptError::ErrorCategories res) { sq_pushinteger(vm, (int32)res); return 1; }
 
	template <> inline ScriptError::ErrorMessages GetParam(ForceType<ScriptError::ErrorMessages>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptError::ErrorMessages)tmp; }
 
	template <> inline int Return<ScriptError::ErrorMessages>(HSQUIRRELVM vm, ScriptError::ErrorMessages res) { sq_pushinteger(vm, (int32)res); return 1; }
 

	
 
	/* Allow AIError to be used as Squirrel parameter */
 
	template <> inline AIError *GetParam(ForceType<AIError *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIError *)instance; }
 
	template <> inline AIError &GetParam(ForceType<AIError &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIError *)instance; }
 
	template <> inline const AIError *GetParam(ForceType<const AIError *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIError *)instance; }
 
	template <> inline const AIError &GetParam(ForceType<const AIError &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIError *)instance; }
 
	template <> inline int Return<AIError *>(HSQUIRRELVM vm, AIError *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Error", res, NULL, DefSQDestructorCallback<AIError>, true); return 1; }
 
	/* Allow ScriptError to be used as Squirrel parameter */
 
	template <> inline ScriptError *GetParam(ForceType<ScriptError *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptError *)instance; }
 
	template <> inline ScriptError &GetParam(ForceType<ScriptError &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptError *)instance; }
 
	template <> inline const ScriptError *GetParam(ForceType<const ScriptError *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptError *)instance; }
 
	template <> inline const ScriptError &GetParam(ForceType<const ScriptError &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptError *)instance; }
 
	template <> inline int Return<ScriptError *>(HSQUIRRELVM vm, ScriptError *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Error", res, NULL, DefSQDestructorCallback<ScriptError>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AIError, ST_AI>() { return "AIError"; }
 
template <> const char *GetClassName<ScriptError, ST_AI>() { return "AIError"; }
 

	
 
void SQAIError_Register(Squirrel *engine)
 
{
 
	DefSQClass<AIError, ST_AI> SQAIError("AIError");
 
	DefSQClass<ScriptError, ST_AI> SQAIError("AIError");
 
	SQAIError.PreRegister(engine);
 
	SQAIError.AddConstructor<void (AIError::*)(), 1>(engine, "x");
 
	SQAIError.AddConstructor<void (ScriptError::*)(), 1>(engine, "x");
 

	
 
	SQAIError.DefSQConst(engine, AIError::ERR_CAT_NONE,                     "ERR_CAT_NONE");
 
	SQAIError.DefSQConst(engine, AIError::ERR_CAT_GENERAL,                  "ERR_CAT_GENERAL");
 
	SQAIError.DefSQConst(engine, AIError::ERR_CAT_VEHICLE,                  "ERR_CAT_VEHICLE");
 
	SQAIError.DefSQConst(engine, AIError::ERR_CAT_STATION,                  "ERR_CAT_STATION");
 
	SQAIError.DefSQConst(engine, AIError::ERR_CAT_BRIDGE,                   "ERR_CAT_BRIDGE");
 
	SQAIError.DefSQConst(engine, AIError::ERR_CAT_TUNNEL,                   "ERR_CAT_TUNNEL");
 
	SQAIError.DefSQConst(engine, AIError::ERR_CAT_TILE,                     "ERR_CAT_TILE");
 
	SQAIError.DefSQConst(engine, AIError::ERR_CAT_SIGN,                     "ERR_CAT_SIGN");
 
	SQAIError.DefSQConst(engine, AIError::ERR_CAT_RAIL,                     "ERR_CAT_RAIL");
 
	SQAIError.DefSQConst(engine, AIError::ERR_CAT_ROAD,                     "ERR_CAT_ROAD");
 
	SQAIError.DefSQConst(engine, AIError::ERR_CAT_ORDER,                    "ERR_CAT_ORDER");
 
	SQAIError.DefSQConst(engine, AIError::ERR_CAT_MARINE,                   "ERR_CAT_MARINE");
 
	SQAIError.DefSQConst(engine, AIError::ERR_CAT_WAYPOINT,                 "ERR_CAT_WAYPOINT");
 
	SQAIError.DefSQConst(engine, AIError::ERR_CAT_BIT_SIZE,                 "ERR_CAT_BIT_SIZE");
 
	SQAIError.DefSQConst(engine, AIError::ERR_NONE,                         "ERR_NONE");
 
	SQAIError.DefSQConst(engine, AIError::ERR_UNKNOWN,                      "ERR_UNKNOWN");
 
	SQAIError.DefSQConst(engine, AIError::ERR_PRECONDITION_FAILED,          "ERR_PRECONDITION_FAILED");
 
	SQAIError.DefSQConst(engine, AIError::ERR_PRECONDITION_STRING_TOO_LONG, "ERR_PRECONDITION_STRING_TOO_LONG");
 
	SQAIError.DefSQConst(engine, AIError::ERR_NEWGRF_SUPPLIED_ERROR,        "ERR_NEWGRF_SUPPLIED_ERROR");
 
	SQAIError.DefSQConst(engine, AIError::ERR_GENERAL_BASE,                 "ERR_GENERAL_BASE");
 
	SQAIError.DefSQConst(engine, AIError::ERR_NOT_ENOUGH_CASH,              "ERR_NOT_ENOUGH_CASH");
 
	SQAIError.DefSQConst(engine, AIError::ERR_LOCAL_AUTHORITY_REFUSES,      "ERR_LOCAL_AUTHORITY_REFUSES");
 
	SQAIError.DefSQConst(engine, AIError::ERR_ALREADY_BUILT,                "ERR_ALREADY_BUILT");
 
	SQAIError.DefSQConst(engine, AIError::ERR_AREA_NOT_CLEAR,               "ERR_AREA_NOT_CLEAR");
 
	SQAIError.DefSQConst(engine, AIError::ERR_OWNED_BY_ANOTHER_COMPANY,     "ERR_OWNED_BY_ANOTHER_COMPANY");
 
	SQAIError.DefSQConst(engine, AIError::ERR_NAME_IS_NOT_UNIQUE,           "ERR_NAME_IS_NOT_UNIQUE");
 
	SQAIError.DefSQConst(engine, AIError::ERR_FLAT_LAND_REQUIRED,           "ERR_FLAT_LAND_REQUIRED");
 
	SQAIError.DefSQConst(engine, AIError::ERR_LAND_SLOPED_WRONG,            "ERR_LAND_SLOPED_WRONG");
 
	SQAIError.DefSQConst(engine, AIError::ERR_VEHICLE_IN_THE_WAY,           "ERR_VEHICLE_IN_THE_WAY");
 
	SQAIError.DefSQConst(engine, AIError::ERR_SITE_UNSUITABLE,              "ERR_SITE_UNSUITABLE");
 
	SQAIError.DefSQConst(engine, AIError::ERR_TOO_CLOSE_TO_EDGE,            "ERR_TOO_CLOSE_TO_EDGE");
 
	SQAIError.DefSQConst(engine, AIError::ERR_STATION_TOO_SPREAD_OUT,       "ERR_STATION_TOO_SPREAD_OUT");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_CAT_NONE,                     "ERR_CAT_NONE");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_CAT_GENERAL,                  "ERR_CAT_GENERAL");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_CAT_VEHICLE,                  "ERR_CAT_VEHICLE");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_CAT_STATION,                  "ERR_CAT_STATION");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_CAT_BRIDGE,                   "ERR_CAT_BRIDGE");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_CAT_TUNNEL,                   "ERR_CAT_TUNNEL");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_CAT_TILE,                     "ERR_CAT_TILE");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_CAT_SIGN,                     "ERR_CAT_SIGN");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_CAT_RAIL,                     "ERR_CAT_RAIL");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_CAT_ROAD,                     "ERR_CAT_ROAD");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_CAT_ORDER,                    "ERR_CAT_ORDER");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_CAT_MARINE,                   "ERR_CAT_MARINE");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_CAT_WAYPOINT,                 "ERR_CAT_WAYPOINT");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_CAT_BIT_SIZE,                 "ERR_CAT_BIT_SIZE");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_NONE,                         "ERR_NONE");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_UNKNOWN,                      "ERR_UNKNOWN");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_PRECONDITION_FAILED,          "ERR_PRECONDITION_FAILED");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG, "ERR_PRECONDITION_STRING_TOO_LONG");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_NEWGRF_SUPPLIED_ERROR,        "ERR_NEWGRF_SUPPLIED_ERROR");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_GENERAL_BASE,                 "ERR_GENERAL_BASE");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_NOT_ENOUGH_CASH,              "ERR_NOT_ENOUGH_CASH");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_LOCAL_AUTHORITY_REFUSES,      "ERR_LOCAL_AUTHORITY_REFUSES");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_ALREADY_BUILT,                "ERR_ALREADY_BUILT");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_AREA_NOT_CLEAR,               "ERR_AREA_NOT_CLEAR");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY,     "ERR_OWNED_BY_ANOTHER_COMPANY");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_NAME_IS_NOT_UNIQUE,           "ERR_NAME_IS_NOT_UNIQUE");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_FLAT_LAND_REQUIRED,           "ERR_FLAT_LAND_REQUIRED");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_LAND_SLOPED_WRONG,            "ERR_LAND_SLOPED_WRONG");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_VEHICLE_IN_THE_WAY,           "ERR_VEHICLE_IN_THE_WAY");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_SITE_UNSUITABLE,              "ERR_SITE_UNSUITABLE");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_TOO_CLOSE_TO_EDGE,            "ERR_TOO_CLOSE_TO_EDGE");
 
	SQAIError.DefSQConst(engine, ScriptError::ERR_STATION_TOO_SPREAD_OUT,       "ERR_STATION_TOO_SPREAD_OUT");
 

	
 
	AIError::RegisterErrorMap(STR_ERROR_NOT_ENOUGH_CASH_REQUIRES_CURRENCY,          AIError::ERR_NOT_ENOUGH_CASH);
 
	AIError::RegisterErrorMap(STR_ERROR_LOCAL_AUTHORITY_REFUSES_TO_ALLOW_THIS,      AIError::ERR_LOCAL_AUTHORITY_REFUSES);
 
	AIError::RegisterErrorMap(STR_ERROR_ALREADY_BUILT,                              AIError::ERR_ALREADY_BUILT);
 
	AIError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST,                 AIError::ERR_ALREADY_BUILT);
 
	AIError::RegisterErrorMap(STR_ERROR_BUILDING_MUST_BE_DEMOLISHED,                AIError::ERR_AREA_NOT_CLEAR);
 
	AIError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST,                 AIError::ERR_AREA_NOT_CLEAR);
 
	AIError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_RAILROAD,                     AIError::ERR_AREA_NOT_CLEAR);
 
	AIError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_AIRPORT_FIRST,                AIError::ERR_AREA_NOT_CLEAR);
 
	AIError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_CARGO_TRAM_STATION_FIRST,     AIError::ERR_AREA_NOT_CLEAR);
 
	AIError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_TRUCK_STATION_FIRST,          AIError::ERR_AREA_NOT_CLEAR);
 
	AIError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_PASSENGER_TRAM_STATION_FIRST, AIError::ERR_AREA_NOT_CLEAR);
 
	AIError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_BUS_STATION_FIRST,            AIError::ERR_AREA_NOT_CLEAR);
 
	AIError::RegisterErrorMap(STR_ERROR_BUOY_IN_THE_WAY,                            AIError::ERR_AREA_NOT_CLEAR);
 
	AIError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_DOCK_FIRST,                   AIError::ERR_AREA_NOT_CLEAR);
 
	AIError::RegisterErrorMap(STR_ERROR_GENERIC_OBJECT_IN_THE_WAY,                  AIError::ERR_AREA_NOT_CLEAR);
 
	AIError::RegisterErrorMap(STR_ERROR_COMPANY_HEADQUARTERS_IN,                    AIError::ERR_AREA_NOT_CLEAR);
 
	AIError::RegisterErrorMap(STR_ERROR_OBJECT_IN_THE_WAY,                          AIError::ERR_AREA_NOT_CLEAR);
 
	AIError::RegisterErrorMap(STR_ERROR_MUST_REMOVE_ROAD_FIRST,                     AIError::ERR_AREA_NOT_CLEAR);
 
	AIError::RegisterErrorMap(STR_ERROR_MUST_REMOVE_RAILROAD_TRACK,                 AIError::ERR_AREA_NOT_CLEAR);
 
	AIError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST,                 AIError::ERR_AREA_NOT_CLEAR);
 
	AIError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_TUNNEL_FIRST,                 AIError::ERR_AREA_NOT_CLEAR);
 
	AIError::RegisterErrorMap(STR_ERROR_EXCAVATION_WOULD_DAMAGE,                    AIError::ERR_AREA_NOT_CLEAR);
 
	AIError::RegisterErrorMap(STR_ERROR_AREA_IS_OWNED_BY_ANOTHER,                   AIError::ERR_OWNED_BY_ANOTHER_COMPANY);
 
	AIError::RegisterErrorMap(STR_ERROR_OWNED_BY,                                   AIError::ERR_OWNED_BY_ANOTHER_COMPANY);
 
	AIError::RegisterErrorMap(STR_ERROR_NAME_MUST_BE_UNIQUE,                        AIError::ERR_NAME_IS_NOT_UNIQUE);
 
	AIError::RegisterErrorMap(STR_ERROR_FLAT_LAND_REQUIRED,                         AIError::ERR_FLAT_LAND_REQUIRED);
 
	AIError::RegisterErrorMap(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION,             AIError::ERR_LAND_SLOPED_WRONG);
 
	AIError::RegisterErrorMap(STR_ERROR_TRAIN_IN_THE_WAY,                           AIError::ERR_VEHICLE_IN_THE_WAY);
 
	AIError::RegisterErrorMap(STR_ERROR_ROAD_VEHICLE_IN_THE_WAY,                    AIError::ERR_VEHICLE_IN_THE_WAY);
 
	AIError::RegisterErrorMap(STR_ERROR_SHIP_IN_THE_WAY,                            AIError::ERR_VEHICLE_IN_THE_WAY);
 
	AIError::RegisterErrorMap(STR_ERROR_AIRCRAFT_IN_THE_WAY,                        AIError::ERR_VEHICLE_IN_THE_WAY);
 
	AIError::RegisterErrorMap(STR_ERROR_SITE_UNSUITABLE,                            AIError::ERR_SITE_UNSUITABLE);
 
	AIError::RegisterErrorMap(STR_ERROR_TOO_CLOSE_TO_EDGE_OF_MAP,                   AIError::ERR_TOO_CLOSE_TO_EDGE);
 
	AIError::RegisterErrorMap(STR_ERROR_STATION_TOO_SPREAD_OUT,                     AIError::ERR_STATION_TOO_SPREAD_OUT);
 
	ScriptError::RegisterErrorMap(STR_ERROR_NOT_ENOUGH_CASH_REQUIRES_CURRENCY,          ScriptError::ERR_NOT_ENOUGH_CASH);
 
	ScriptError::RegisterErrorMap(STR_ERROR_LOCAL_AUTHORITY_REFUSES_TO_ALLOW_THIS,      ScriptError::ERR_LOCAL_AUTHORITY_REFUSES);
 
	ScriptError::RegisterErrorMap(STR_ERROR_ALREADY_BUILT,                              ScriptError::ERR_ALREADY_BUILT);
 
	ScriptError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST,                 ScriptError::ERR_ALREADY_BUILT);
 
	ScriptError::RegisterErrorMap(STR_ERROR_BUILDING_MUST_BE_DEMOLISHED,                ScriptError::ERR_AREA_NOT_CLEAR);
 
	ScriptError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST,                 ScriptError::ERR_AREA_NOT_CLEAR);
 
	ScriptError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_RAILROAD,                     ScriptError::ERR_AREA_NOT_CLEAR);
 
	ScriptError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_AIRPORT_FIRST,                ScriptError::ERR_AREA_NOT_CLEAR);
 
	ScriptError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_CARGO_TRAM_STATION_FIRST,     ScriptError::ERR_AREA_NOT_CLEAR);
 
	ScriptError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_TRUCK_STATION_FIRST,          ScriptError::ERR_AREA_NOT_CLEAR);
 
	ScriptError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_PASSENGER_TRAM_STATION_FIRST, ScriptError::ERR_AREA_NOT_CLEAR);
 
	ScriptError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_BUS_STATION_FIRST,            ScriptError::ERR_AREA_NOT_CLEAR);
 
	ScriptError::RegisterErrorMap(STR_ERROR_BUOY_IN_THE_WAY,                            ScriptError::ERR_AREA_NOT_CLEAR);
 
	ScriptError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_DOCK_FIRST,                   ScriptError::ERR_AREA_NOT_CLEAR);
 
	ScriptError::RegisterErrorMap(STR_ERROR_GENERIC_OBJECT_IN_THE_WAY,                  ScriptError::ERR_AREA_NOT_CLEAR);
 
	ScriptError::RegisterErrorMap(STR_ERROR_COMPANY_HEADQUARTERS_IN,                    ScriptError::ERR_AREA_NOT_CLEAR);
 
	ScriptError::RegisterErrorMap(STR_ERROR_OBJECT_IN_THE_WAY,                          ScriptError::ERR_AREA_NOT_CLEAR);
 
	ScriptError::RegisterErrorMap(STR_ERROR_MUST_REMOVE_ROAD_FIRST,                     ScriptError::ERR_AREA_NOT_CLEAR);
 
	ScriptError::RegisterErrorMap(STR_ERROR_MUST_REMOVE_RAILROAD_TRACK,                 ScriptError::ERR_AREA_NOT_CLEAR);
 
	ScriptError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST,                 ScriptError::ERR_AREA_NOT_CLEAR);
 
	ScriptError::RegisterErrorMap(STR_ERROR_MUST_DEMOLISH_TUNNEL_FIRST,                 ScriptError::ERR_AREA_NOT_CLEAR);
 
	ScriptError::RegisterErrorMap(STR_ERROR_EXCAVATION_WOULD_DAMAGE,                    ScriptError::ERR_AREA_NOT_CLEAR);
 
	ScriptError::RegisterErrorMap(STR_ERROR_AREA_IS_OWNED_BY_ANOTHER,                   ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY);
 
	ScriptError::RegisterErrorMap(STR_ERROR_OWNED_BY,                                   ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY);
 
	ScriptError::RegisterErrorMap(STR_ERROR_NAME_MUST_BE_UNIQUE,                        ScriptError::ERR_NAME_IS_NOT_UNIQUE);
 
	ScriptError::RegisterErrorMap(STR_ERROR_FLAT_LAND_REQUIRED,                         ScriptError::ERR_FLAT_LAND_REQUIRED);
 
	ScriptError::RegisterErrorMap(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION,             ScriptError::ERR_LAND_SLOPED_WRONG);
 
	ScriptError::RegisterErrorMap(STR_ERROR_TRAIN_IN_THE_WAY,                           ScriptError::ERR_VEHICLE_IN_THE_WAY);
 
	ScriptError::RegisterErrorMap(STR_ERROR_ROAD_VEHICLE_IN_THE_WAY,                    ScriptError::ERR_VEHICLE_IN_THE_WAY);
 
	ScriptError::RegisterErrorMap(STR_ERROR_SHIP_IN_THE_WAY,                            ScriptError::ERR_VEHICLE_IN_THE_WAY);
 
	ScriptError::RegisterErrorMap(STR_ERROR_AIRCRAFT_IN_THE_WAY,                        ScriptError::ERR_VEHICLE_IN_THE_WAY);
 
	ScriptError::RegisterErrorMap(STR_ERROR_SITE_UNSUITABLE,                            ScriptError::ERR_SITE_UNSUITABLE);
 
	ScriptError::RegisterErrorMap(STR_ERROR_TOO_CLOSE_TO_EDGE_OF_MAP,                   ScriptError::ERR_TOO_CLOSE_TO_EDGE);
 
	ScriptError::RegisterErrorMap(STR_ERROR_STATION_TOO_SPREAD_OUT,                     ScriptError::ERR_STATION_TOO_SPREAD_OUT);
 

	
 
	AIError::RegisterErrorMapString(AIError::ERR_NONE,                         "ERR_NONE");
 
	AIError::RegisterErrorMapString(AIError::ERR_UNKNOWN,                      "ERR_UNKNOWN");
 
	AIError::RegisterErrorMapString(AIError::ERR_PRECONDITION_FAILED,          "ERR_PRECONDITION_FAILED");
 
	AIError::RegisterErrorMapString(AIError::ERR_PRECONDITION_STRING_TOO_LONG, "ERR_PRECONDITION_STRING_TOO_LONG");
 
	AIError::RegisterErrorMapString(AIError::ERR_NEWGRF_SUPPLIED_ERROR,        "ERR_NEWGRF_SUPPLIED_ERROR");
 
	AIError::RegisterErrorMapString(AIError::ERR_NOT_ENOUGH_CASH,              "ERR_NOT_ENOUGH_CASH");
 
	AIError::RegisterErrorMapString(AIError::ERR_LOCAL_AUTHORITY_REFUSES,      "ERR_LOCAL_AUTHORITY_REFUSES");
 
	AIError::RegisterErrorMapString(AIError::ERR_ALREADY_BUILT,                "ERR_ALREADY_BUILT");
 
	AIError::RegisterErrorMapString(AIError::ERR_AREA_NOT_CLEAR,               "ERR_AREA_NOT_CLEAR");
 
	AIError::RegisterErrorMapString(AIError::ERR_OWNED_BY_ANOTHER_COMPANY,     "ERR_OWNED_BY_ANOTHER_COMPANY");
 
	AIError::RegisterErrorMapString(AIError::ERR_NAME_IS_NOT_UNIQUE,           "ERR_NAME_IS_NOT_UNIQUE");
 
	AIError::RegisterErrorMapString(AIError::ERR_FLAT_LAND_REQUIRED,           "ERR_FLAT_LAND_REQUIRED");
 
	AIError::RegisterErrorMapString(AIError::ERR_LAND_SLOPED_WRONG,            "ERR_LAND_SLOPED_WRONG");
 
	AIError::RegisterErrorMapString(AIError::ERR_VEHICLE_IN_THE_WAY,           "ERR_VEHICLE_IN_THE_WAY");
 
	AIError::RegisterErrorMapString(AIError::ERR_SITE_UNSUITABLE,              "ERR_SITE_UNSUITABLE");
 
	AIError::RegisterErrorMapString(AIError::ERR_TOO_CLOSE_TO_EDGE,            "ERR_TOO_CLOSE_TO_EDGE");
 
	AIError::RegisterErrorMapString(AIError::ERR_STATION_TOO_SPREAD_OUT,       "ERR_STATION_TOO_SPREAD_OUT");
 
	ScriptError::RegisterErrorMapString(ScriptError::ERR_NONE,                         "ERR_NONE");
 
	ScriptError::RegisterErrorMapString(ScriptError::ERR_UNKNOWN,                      "ERR_UNKNOWN");
 
	ScriptError::RegisterErrorMapString(ScriptError::ERR_PRECONDITION_FAILED,          "ERR_PRECONDITION_FAILED");
 
	ScriptError::RegisterErrorMapString(ScriptError::ERR_PRECONDITION_STRING_TOO_LONG, "ERR_PRECONDITION_STRING_TOO_LONG");
 
	ScriptError::RegisterErrorMapString(ScriptError::ERR_NEWGRF_SUPPLIED_ERROR,        "ERR_NEWGRF_SUPPLIED_ERROR");
 
	ScriptError::RegisterErrorMapString(ScriptError::ERR_NOT_ENOUGH_CASH,              "ERR_NOT_ENOUGH_CASH");
 
	ScriptError::RegisterErrorMapString(ScriptError::ERR_LOCAL_AUTHORITY_REFUSES,      "ERR_LOCAL_AUTHORITY_REFUSES");
 
	ScriptError::RegisterErrorMapString(ScriptError::ERR_ALREADY_BUILT,                "ERR_ALREADY_BUILT");
 
	ScriptError::RegisterErrorMapString(ScriptError::ERR_AREA_NOT_CLEAR,               "ERR_AREA_NOT_CLEAR");
 
	ScriptError::RegisterErrorMapString(ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY,     "ERR_OWNED_BY_ANOTHER_COMPANY");
 
	ScriptError::RegisterErrorMapString(ScriptError::ERR_NAME_IS_NOT_UNIQUE,           "ERR_NAME_IS_NOT_UNIQUE");
 
	ScriptError::RegisterErrorMapString(ScriptError::ERR_FLAT_LAND_REQUIRED,           "ERR_FLAT_LAND_REQUIRED");
 
	ScriptError::RegisterErrorMapString(ScriptError::ERR_LAND_SLOPED_WRONG,            "ERR_LAND_SLOPED_WRONG");
 
	ScriptError::RegisterErrorMapString(ScriptError::ERR_VEHICLE_IN_THE_WAY,           "ERR_VEHICLE_IN_THE_WAY");
 
	ScriptError::RegisterErrorMapString(ScriptError::ERR_SITE_UNSUITABLE,              "ERR_SITE_UNSUITABLE");
 
	ScriptError::RegisterErrorMapString(ScriptError::ERR_TOO_CLOSE_TO_EDGE,            "ERR_TOO_CLOSE_TO_EDGE");
 
	ScriptError::RegisterErrorMapString(ScriptError::ERR_STATION_TOO_SPREAD_OUT,       "ERR_STATION_TOO_SPREAD_OUT");
 

	
 
	SQAIError.DefSQStaticMethod(engine, &AIError::GetErrorCategory,   "GetErrorCategory",   1, ".");
 
	SQAIError.DefSQStaticMethod(engine, &AIError::GetLastError,       "GetLastError",       1, ".");
 
	SQAIError.DefSQStaticMethod(engine, &AIError::GetLastErrorString, "GetLastErrorString", 1, ".");
 
	SQAIError.DefSQStaticMethod(engine, &ScriptError::GetErrorCategory,   "GetErrorCategory",   1, ".");
 
	SQAIError.DefSQStaticMethod(engine, &ScriptError::GetLastError,       "GetLastError",       1, ".");
 
	SQAIError.DefSQStaticMethod(engine, &ScriptError::GetLastErrorString, "GetLastErrorString", 1, ".");
 

	
 
	SQAIError.PostRegister(engine);
 
}
src/ai/api/ai_event.hpp.sq
Show inline comments
 
@@ -13,73 +13,73 @@
 

	
 
namespace SQConvert {
 
	/* Allow enums to be used as Squirrel parameters */
 
	template <> inline AIEvent::AIEventType GetParam(ForceType<AIEvent::AIEventType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIEvent::AIEventType)tmp; }
 
	template <> inline int Return<AIEvent::AIEventType>(HSQUIRRELVM vm, AIEvent::AIEventType res) { sq_pushinteger(vm, (int32)res); return 1; }
 
	template <> inline ScriptEvent::ScriptEventType GetParam(ForceType<ScriptEvent::ScriptEventType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptEvent::ScriptEventType)tmp; }
 
	template <> inline int Return<ScriptEvent::ScriptEventType>(HSQUIRRELVM vm, ScriptEvent::ScriptEventType res) { sq_pushinteger(vm, (int32)res); return 1; }
 

	
 
	/* Allow AIEvent to be used as Squirrel parameter */
 
	template <> inline AIEvent *GetParam(ForceType<AIEvent *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIEvent *)instance; }
 
	template <> inline AIEvent &GetParam(ForceType<AIEvent &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIEvent *)instance; }
 
	template <> inline const AIEvent *GetParam(ForceType<const AIEvent *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIEvent *)instance; }
 
	template <> inline const AIEvent &GetParam(ForceType<const AIEvent &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIEvent *)instance; }
 
	template <> inline int Return<AIEvent *>(HSQUIRRELVM vm, AIEvent *res) { if (res == NULL) { sq_pushnull(vm); return 1; } Squirrel::CreateClassInstanceVM(vm, "Event", res, NULL, DefSQDestructorCallback<AIEvent>, true); return 1; }
 
	/* Allow ScriptEvent to be used as Squirrel parameter */
 
	template <> inline ScriptEvent *GetParam(ForceType<ScriptEvent *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptEvent *)instance; }
 
	template <> inline ScriptEvent &GetParam(ForceType<ScriptEvent &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptEvent *)instance; }
 
	template <> inline const ScriptEvent *GetParam(ForceType<const ScriptEvent *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptEvent *)instance; }
 
	template <> inline const ScriptEvent &GetParam(ForceType<const ScriptEvent &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptEvent *)instance; }
 
	template <> inline int Return<ScriptEvent *>(HSQUIRRELVM vm, ScriptEvent *res) { if (res == NULL) { sq_pushnull(vm); return 1; } Squirrel::CreateClassInstanceVM(vm, "Event", res, NULL, DefSQDestructorCallback<ScriptEvent>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AIEvent, ST_AI>() { return "AIEvent"; }
 
template <> const char *GetClassName<ScriptEvent, ST_AI>() { return "AIEvent"; }
 

	
 
void SQAIEvent_Register(Squirrel *engine)
 
{
 
	DefSQClass<AIEvent, ST_AI> SQAIEvent("AIEvent");
 
	DefSQClass<ScriptEvent, ST_AI> SQAIEvent("AIEvent");
 
	SQAIEvent.PreRegister(engine);
 
	SQAIEvent.AddConstructor<void (AIEvent::*)(AIEvent::AIEventType type), 2>(engine, "xi");
 
	SQAIEvent.AddConstructor<void (ScriptEvent::*)(ScriptEvent::ScriptEventType type), 2>(engine, "xi");
 

	
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_INVALID,                     "AI_ET_INVALID");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_TEST,                        "AI_ET_TEST");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_SUBSIDY_OFFER,               "AI_ET_SUBSIDY_OFFER");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_SUBSIDY_OFFER_EXPIRED,       "AI_ET_SUBSIDY_OFFER_EXPIRED");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_SUBSIDY_AWARDED,             "AI_ET_SUBSIDY_AWARDED");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_SUBSIDY_EXPIRED,             "AI_ET_SUBSIDY_EXPIRED");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_ENGINE_PREVIEW,              "AI_ET_ENGINE_PREVIEW");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_COMPANY_NEW,                 "AI_ET_COMPANY_NEW");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_COMPANY_IN_TROUBLE,          "AI_ET_COMPANY_IN_TROUBLE");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_COMPANY_ASK_MERGER,          "AI_ET_COMPANY_ASK_MERGER");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_COMPANY_MERGER,              "AI_ET_COMPANY_MERGER");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_COMPANY_BANKRUPT,            "AI_ET_COMPANY_BANKRUPT");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_VEHICLE_CRASHED,             "AI_ET_VEHICLE_CRASHED");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_VEHICLE_LOST,                "AI_ET_VEHICLE_LOST");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_VEHICLE_WAITING_IN_DEPOT,    "AI_ET_VEHICLE_WAITING_IN_DEPOT");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_VEHICLE_UNPROFITABLE,        "AI_ET_VEHICLE_UNPROFITABLE");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_INDUSTRY_OPEN,               "AI_ET_INDUSTRY_OPEN");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_INDUSTRY_CLOSE,              "AI_ET_INDUSTRY_CLOSE");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_ENGINE_AVAILABLE,            "AI_ET_ENGINE_AVAILABLE");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_STATION_FIRST_VEHICLE,       "AI_ET_STATION_FIRST_VEHICLE");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_DISASTER_ZEPPELINER_CRASHED, "AI_ET_DISASTER_ZEPPELINER_CRASHED");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_DISASTER_ZEPPELINER_CLEARED, "AI_ET_DISASTER_ZEPPELINER_CLEARED");
 
	SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_TOWN_FOUNDED,                "AI_ET_TOWN_FOUNDED");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_INVALID,                     "AI_ET_INVALID");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_TEST,                        "AI_ET_TEST");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_SUBSIDY_OFFER,               "AI_ET_SUBSIDY_OFFER");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_SUBSIDY_OFFER_EXPIRED,       "AI_ET_SUBSIDY_OFFER_EXPIRED");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_SUBSIDY_AWARDED,             "AI_ET_SUBSIDY_AWARDED");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_SUBSIDY_EXPIRED,             "AI_ET_SUBSIDY_EXPIRED");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_ENGINE_PREVIEW,              "AI_ET_ENGINE_PREVIEW");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_COMPANY_NEW,                 "AI_ET_COMPANY_NEW");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_COMPANY_IN_TROUBLE,          "AI_ET_COMPANY_IN_TROUBLE");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_COMPANY_ASK_MERGER,          "AI_ET_COMPANY_ASK_MERGER");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_COMPANY_MERGER,              "AI_ET_COMPANY_MERGER");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_COMPANY_BANKRUPT,            "AI_ET_COMPANY_BANKRUPT");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_VEHICLE_CRASHED,             "AI_ET_VEHICLE_CRASHED");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_VEHICLE_LOST,                "AI_ET_VEHICLE_LOST");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_VEHICLE_WAITING_IN_DEPOT,    "AI_ET_VEHICLE_WAITING_IN_DEPOT");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_VEHICLE_UNPROFITABLE,        "AI_ET_VEHICLE_UNPROFITABLE");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_INDUSTRY_OPEN,               "AI_ET_INDUSTRY_OPEN");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_INDUSTRY_CLOSE,              "AI_ET_INDUSTRY_CLOSE");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_ENGINE_AVAILABLE,            "AI_ET_ENGINE_AVAILABLE");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_STATION_FIRST_VEHICLE,       "AI_ET_STATION_FIRST_VEHICLE");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_DISASTER_ZEPPELINER_CRASHED, "AI_ET_DISASTER_ZEPPELINER_CRASHED");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_DISASTER_ZEPPELINER_CLEARED, "AI_ET_DISASTER_ZEPPELINER_CLEARED");
 
	SQAIEvent.DefSQConst(engine, ScriptEvent::AI_ET_TOWN_FOUNDED,                "AI_ET_TOWN_FOUNDED");
 

	
 
	SQAIEvent.DefSQMethod(engine, &AIEvent::GetEventType, "GetEventType", 1, "x");
 
	SQAIEvent.DefSQMethod(engine, &ScriptEvent::GetEventType, "GetEventType", 1, "x");
 

	
 
	SQAIEvent.PostRegister(engine);
 
}
 

	
 
namespace SQConvert {
 
	/* Allow AIEventController to be used as Squirrel parameter */
 
	template <> inline AIEventController *GetParam(ForceType<AIEventController *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIEventController *)instance; }
 
	template <> inline AIEventController &GetParam(ForceType<AIEventController &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIEventController *)instance; }
 
	template <> inline const AIEventController *GetParam(ForceType<const AIEventController *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIEventController *)instance; }
 
	template <> inline const AIEventController &GetParam(ForceType<const AIEventController &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIEventController *)instance; }
 
	template <> inline int Return<AIEventController *>(HSQUIRRELVM vm, AIEventController *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "EventController", res, NULL, DefSQDestructorCallback<AIEventController>, true); return 1; }
 
	/* Allow ScriptEventController to be used as Squirrel parameter */
 
	template <> inline ScriptEventController *GetParam(ForceType<ScriptEventController *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptEventController *)instance; }
 
	template <> inline ScriptEventController &GetParam(ForceType<ScriptEventController &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptEventController *)instance; }
 
	template <> inline const ScriptEventController *GetParam(ForceType<const ScriptEventController *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptEventController *)instance; }
 
	template <> inline const ScriptEventController &GetParam(ForceType<const ScriptEventController &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptEventController *)instance; }
 
	template <> inline int Return<ScriptEventController *>(HSQUIRRELVM vm, ScriptEventController *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "EventController", res, NULL, DefSQDestructorCallback<ScriptEventController>, true); return 1; }
 
} // namespace SQConvert
 

	
 
template <> const char *GetClassName<AIEventController, ST_AI>() { return "AIEventController"; }
 
template <> const char *GetClassName<ScriptEventController, ST_AI>() { return "AIEventController"; }
 

	
 
void SQAIEventController_Register(Squirrel *engine)
 
{
 
	DefSQClass<AIEventController, ST_AI> SQAIEventController("AIEventController");
 
	DefSQClass<ScriptEventController, ST_AI> SQAIEventController("AIEventController");
 
	SQAIEventController.PreRegister(engine);
 
	SQAIEventController.AddConstructor<void (AIEventController::*)(), 1>(engine, "x");
 
	SQAIEventController.AddConstructor<void (ScriptEventController::*)(), 1>(engine, "x");
 

	
 
	SQAIEventController.DefSQStaticMethod(engine, &AIEventController::IsEventWaiting, "IsEventWaiting", 1, ".");
 
	SQAIEventController.DefSQStaticMethod(engine, &AIEventController::GetNextEvent,   "GetNextEvent",   1, ".");
 
	SQAIEventController.DefSQStaticMethod(engine, &ScriptEventController::IsEventWaiting, "IsEventWaiting", 1, ".");
 
	SQAIEventController.DefSQStaticMethod(engine, &ScriptEventController::GetNextEvent,   "GetNextEvent",   1, ".");
 

	
 
	SQAIEventController.PostRegister(engine);
 
}

Changeset was too big and was cut off... Show full diff anyway

0 comments (0 inline, 0 general)