I have following error./home/postep2/src/posteppkg/common/includes-from-c/nation.nim(144, 40) Error: object constructor needs an object type; for named arguments use '=' instead of ':'| ---|--- I think I correctly bisect code that I should show to receive a help. Sources of this project (port my Freeciv fork to nim) is big enought to not put there ;-) . ## ********************************************************************* ## Progress - Copyright (C) 2017 - Sławomir Lach <sla...@lach.art.pl> ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (at your option) ## any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ********************************************************************* ## common import fc_types except unit, m_unit import "includes-from-c/unit" as m_unit #from "includes-from-c/unit" as m_unit import unit import name_translation as m2_name_translation except unit import rgbcolor except unit import terrain except unit import traits except unit const ## MAX_NUM_TERRAINS NO_NATION_SELECTED* = (nil) ## Changing this value will break network compatibility. const NATION_NONE* = -1 NATION_ANY* = -2 ## Nation city (server only). type nation_city* {.bycopy.} = object nation_city_list {.bycopy.} = seq[nation_city] nation_city_preference* = enum NCP_DISLIKE = -1, NCP_NONE = 0, NCP_LIKE = 1 ## Nation leader. type nation_leader* {.bycopy.} = object nation_leader_list* = seq[nation_leader] ## Nation set. type nation_set* {.bycopy.} = object nation_set_list* = seq[nation_set] ## Nation list. ## Nation hash. ## Pointer values are allocated on load then freed in free_nations(). type INNER_C_STRUCT_nation_109* {.bycopy.} = object default_cities*: ptr nation_city_list ## Only used in the server (./ai/ and ./server/). ## 'civilwar_nations' is a list of the nations that can fork from ## this one. 'parent_nations' is the inverse of this list. civilwar_nations*: ptr nation_list parent_nations*: ptr nation_list ## Nations which we don't want in the same game. For example, ## British and English. conflicts_with*: ptr nation_list ## Nation's associated player color (NULL if none). rgb*: ptr rgbcolor.rgbcolor traits*: ptr trait_limits ## This nation has no start position in the current scenario. no_startpos*: bool INNER_C_STRUCT_nation_139* {.bycopy.} = object is_pickable*: bool ## Only used at the client. ## Whether the client is allowed to try to pick the nation at game ## start. Reasons for restricting this include lack of start positions ## in a scenario, or a nation outside the current nationset. However, ## in some circumstances the server may decide to put a nation with this ## flag in the game anyway, so the client can't rely on its absence. ## (On the server this is calculated on the fly from other values. ## Use is_nation_pickable() to get the answer on client or server.) INNER_C_UNION_nation_106* {.bycopy.} = object {.union.} server*: INNER_C_STRUCT_nation_109 client*: INNER_C_STRUCT_nation_139 nation_type* {.bycopy.} = object item_number*: Nation_type_id translation_domain*: cstring adjective*: name_translation noun_plural*: name_translation flag_graphic_str*: array[MAX_LEN_NAME, char] flag_graphic_alt*: array[MAX_LEN_NAME, char] leaders*: ptr nation_leader_list style*: ptr nation_style legend*: cstring ## may be empty is_playable*: bool sets*: ptr nation_set_list ## Groups which this nation is assigned to groups*: ptr nation_group_list player*: ptr player ## Who's using the nation, or NULL. ## Items given to this nation at game start. ## (Only used in the client for documentation purposes.) init_techs*: array[MAX_NUM_TECH_LIST, cint] init_buildings*: array[MAX_NUM_BUILDING_LIST, cint] init_government*: ptr government ## use game default_government if NULL init_units*: array[MAX_NUM_UNIT_LIST, ptr unit_type] ano_nation_141*: INNER_C_UNION_nation_106 nation_list = seq[nation_type] INNER_C_STRUCT_nation_154* {.bycopy.} = object match*: cint ## Only used in the server (./server/). ## How much the AI will try to select a nation in the same group INNER_C_UNION_nation_150* {.bycopy.} = object {.union.} server*: INNER_C_STRUCT_nation_154 ## Add client side when needed nation_group* {.bycopy.} = object name*: name_translation hidden*: bool ano_nation_158*: INNER_C_UNION_nation_150 nation_group_list * = seq[nation_group] ## General nation accessor functions. proc nation_count*(): Nation_type_id proc nation_index*(pnation: ptr nation_type): Nation_type_id proc nation_number*(pnation: ptr nation_type): Nation_type_id proc nation_by_number*(nation: Nation_type_id): ptr nation_type proc nation_of_player*(pplayer: ptr player): ptr nation_type proc nation_of_city*(pcity: ptr city): ptr nation_type proc nation_of_unit*(punit: ptr m_unit.unit): ptr nation_type proc nation_by_rule_name*(name: cstring): ptr nation_type proc nation_by_translated_plural*(name: cstring): ptr nation_type proc nation_rule_name*(pnation: ptr nation_type): cstring proc nation_adjective_translation*(pnation: ptr nation_type): cstring proc nation_adjective_for_player*(pplayer: ptr player): cstring proc nation_plural_translation*(pnation: ptr nation_type): cstring proc nation_plural_for_player*(pplayer: ptr player): cstring proc init_government_of_nation*(pnation: ptr nation_type): ptr government proc style_of_nation*(pnation: ptr nation_type): ptr nation_style proc nation_color*(pnation: ptr nation_type): ptr rgbcolor ## Ancillary nation routines proc is_nation_pickable*(nation: ptr nation_type): bool proc is_nation_playable*(nation: ptr nation_type): bool proc nation_barbarian_type*(nation: ptr nation_type): barbarian_type proc can_conn_edit_players_nation*(pconn: ptr connection; pplayer: ptr player): bool ## General nation leader accessor functions. proc nation_leaders*(pnation: ptr nation_type): ptr nation_leader_list proc nation_leader_new*(pnation: ptr nation_type; name: cstring; is_male: bool): ptr nation_leader proc nation_leader_by_name*(pnation: ptr nation_type; name: cstring): ptr nation_leader proc nation_leader_name*(pleader: ptr nation_leader): cstring proc nation_leader_is_male*(pleader: ptr nation_leader): bool proc nation_legend_translation*(pnation: ptr nation_type; legend: cstring): cstring ## General nation city accessor functions. type terrain* {.bycopy.} = object proc nation_cities*(pnation: ptr nation_type): ptr nation_city_list proc nation_city_new*(pnation: ptr nation_type; name: cstring): ptr nation_city proc nation_city_name*(pncity: ptr nation_city): cstring proc nation_city_preference_revert*(prefer: nation_city_preference): nation_city_preference proc nation_city_set_terrain_preference*(pncity: ptr nation_city; pterrain: ptr terrain; prefer: nation_city_preference) proc nation_city_set_river_preference*(pncity: ptr nation_city; prefer: nation_city_preference) proc nation_city_terrain_preference*(pncity: ptr nation_city; pterrain: ptr terrain): nation_city_preference proc nation_city_river_preference*(pncity: ptr nation_city): nation_city_preference ## General nation set accessor routines proc nation_set_count*(): cint proc nation_set_index*(pset: ptr nation_set): cint proc nation_set_number*(pset: ptr nation_set): cint proc nation_set_new*(set_name: cstring; set_rule_name: cstring; set_description: cstring): ptr nation_set proc nation_set_by_number*(id: cint): ptr nation_set proc nation_set_by_rule_name*(name: cstring): ptr nation_set proc nation_set_untranslated_name*(pset: ptr nation_set): cstring proc nation_set_rule_name*(pset: ptr nation_set): cstring proc nation_set_name_translation*(pset: ptr nation_set): cstring proc nation_set_description*(pset: ptr nation_set): cstring proc nation_is_in_set*(pnation: ptr nation_type; pset: ptr nation_set): bool proc nation_set_by_setting_value*(setting: cstring): ptr nation_set ## General nation group accessor routines proc nation_group_count*(): cint proc nation_group_index*(pgroup: ptr nation_group): cint proc nation_group_number*(pgroup: ptr nation_group): cint proc nation_group_new*(name: cstring): ptr nation_group proc nation_group_by_number*(id: cint): ptr nation_group proc nation_group_by_rule_name*(name: cstring): ptr nation_group proc nation_group_set_hidden*(pgroup: ptr nation_group; hidden: bool) proc nation_group_set_match*(pgroup: ptr nation_group; match: cint) proc is_nation_group_hidden*(pgroup: ptr nation_group): bool proc nation_group_untranslated_name*(pgroup: ptr nation_group): cstring proc nation_group_rule_name*(pgroup: ptr nation_group): cstring proc nation_group_name_translation*(pgroup: ptr nation_group): cstring proc nation_is_in_group*(pnation: ptr nation_type; pgroup: ptr nation_group): bool ## Initialization and iteration proc nation_sets_groups_init*() proc nation_sets_groups_free*() type nation_set_iter* {.bycopy.} = object proc nation_set_iter_sizeof*(): csize proc nation_set_iter_init*(it: ptr nation_set_iter): ptr `iterator` type nation_group_iter* {.bycopy.} = object proc nation_group_iter_sizeof*(): csize proc nation_group_iter_init*(it: ptr nation_group_iter): ptr `iterator` ## Initialization and iteration proc nations_alloc*(num: cint) proc nations_free*() proc nations_match*(pnation1: ptr nation_type; pnation2: ptr nation_type; ignore_conflicts: bool): cint type nation_iter* {.bycopy.} = object proc nation_iter_sizeof*(): csize proc nation_iter_init*(it: ptr nation_iter): ptr `iterator` ## Iterate over nations. This iterates over _all_ nations, including ## unplayable ones (use is_nation_playable to filter if necessary). ## This does not take account of the current nationset! -- on the ## server, use allowed_nations_iterate() for that. Run
I tries import module with different name. Reason I prefix unit with module name was it complains unit symbol exists both in fc_types and unit modules.