widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #10718
[Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/doc_type_name into lp:widelands.
Commit message:
Fixed and improved documentation for LuaMapObjectDescription::get_type_name.
Requested reviews:
Widelands Developers (widelands-dev)
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/doc_type_name/+merge/328006
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/doc_type_name into lp:widelands.
=== modified file 'src/logic/map_objects/map_object.cc'
--- src/logic/map_objects/map_object.cc 2017-06-25 08:20:25 +0000
+++ src/logic/map_objects/map_object.cc 2017-07-25 07:00:49 +0000
@@ -619,6 +619,7 @@
}
std::string to_string(const MapObjectType type) {
+ // The types are documented in scripting/lua_map.cc -> LuaMapObjectDescription::get_type_name for the Lua interface, so make sure to change the documentation there when changing anything in this function.
switch (type) {
case MapObjectType::BOB:
return "bob";
=== modified file 'src/scripting/lua_map.cc'
--- src/scripting/lua_map.cc 2017-06-24 08:18:48 +0000
+++ src/scripting/lua_map.cc 2017-07-25 07:00:49 +0000
@@ -1616,9 +1616,18 @@
}
/* RST
- .. attribute:: type
-
- (RO) the name of the building, e.g. building.
+ .. attribute:: type_name
+
+ (RO) the map object's type as a string. Possible values are:
+
+ * Bobs: ``bob``, ``critter``, ``ship``, ``worker``, ``carrier``, ``soldier``
+ * Wares: ``ware``
+ * Immovables: ``immovable``
+
+ * Buildings: ``building``, ``constructionsite``, ``dismantlesite``, ``warehouse``, ``productionsite``, ``militarysite``, ``trainingsite``
+ * Other: ``flag``, ``road``, ``portdock``
+
+ * Other: ``battle``, ``fleet``
*/
int LuaMapObjectDescription::get_type_name(lua_State* L) {
lua_pushstring(L, to_string(get()->type()));
Follow ups
-
[Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: noreply, 2017-08-09
-
Re: [Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: GunChleoc, 2017-08-09
-
[Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: SirVer, 2017-08-04
-
Re: [Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: kaputtnik, 2017-08-03
-
Re: [Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: GunChleoc, 2017-08-03
-
[Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: bunnybot, 2017-08-02
-
Re: [Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: kaputtnik, 2017-08-01
-
Re: [Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: GunChleoc, 2017-08-01
-
Re: [Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: kaputtnik, 2017-07-31
-
[Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: bunnybot, 2017-07-31
-
Re: [Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: GunChleoc, 2017-07-31
-
[Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: bunnybot, 2017-07-31
-
Re: [Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: kaputtnik, 2017-07-30
-
Re: [Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: GunChleoc, 2017-07-30
-
[Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: GunChleoc, 2017-07-30
-
Re: [Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: GunChleoc, 2017-07-30
-
Re: [Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: kaputtnik, 2017-07-28
-
Re: [Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: GunChleoc, 2017-07-27
-
[Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: bunnybot, 2017-07-25
-
Re: [Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: kaputtnik, 2017-07-25
-
Re: [Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: Klaus Halfmann, 2017-07-25
-
Re: [Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: GunChleoc, 2017-07-25
-
Re: [Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: Klaus Halfmann, 2017-07-25
-
Re: [Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: GunChleoc, 2017-07-25
-
Re: [Merge] lp:~widelands-dev/widelands/doc_type_name into lp:widelands
From: kaputtnik, 2017-07-25