| 919 | } |
| 920 | |
| 921 | static const char * get_build_keys(const df::coord &pos, |
| 922 | const tile_context &ctx, |
| 923 | bool &add_size) { |
| 924 | bool at_nw_corner = static_cast<int32_t>(pos.x) == ctx.b->x1 |
| 925 | && static_cast<int32_t>(pos.y) == ctx.b->y1; |
| 926 | bool at_se_corner = static_cast<int32_t>(pos.x) == ctx.b->x2 |
| 927 | && static_cast<int32_t>(pos.y) == ctx.b->y2; |
| 928 | bool at_center = static_cast<int32_t>(pos.x) == ctx.b->centerx |
| 929 | && static_cast<int32_t>(pos.y) == ctx.b->centery; |
| 930 | |
| 931 | // building_type::Construction is handled by the construction phase |
| 932 | switch(ctx.b->getType()) { |
| 933 | case building_type::Armorstand: |
| 934 | return "a"; |
| 935 | case building_type::Bed: |
| 936 | return "b"; |
| 937 | case building_type::Chair: |
| 938 | return "c"; |
| 939 | case building_type::Door: |
| 940 | return "d"; |
| 941 | case building_type::Floodgate: |
| 942 | return "x"; |
| 943 | case building_type::Cabinet: |
| 944 | return "f"; |
| 945 | case building_type::Box: |
| 946 | return "h"; |
| 947 | case building_type::FarmPlot: |
| 948 | return do_extent_building(ctx, "p", at_nw_corner, &add_size); |
| 949 | case building_type::Weaponrack: |
| 950 | return "r"; |
| 951 | case building_type::Statue: |
| 952 | return "s"; |
| 953 | case building_type::Table: |
| 954 | return "t"; |
| 955 | case building_type::Coffin: |
| 956 | return "n"; |
| 957 | case building_type::RoadPaved: |
| 958 | return do_extent_building(ctx, "o", at_nw_corner, &add_size); |
| 959 | case building_type::RoadDirt: |
| 960 | return do_extent_building(ctx, "O", at_nw_corner, &add_size); |
| 961 | case building_type::Bridge: |
| 962 | return do_block_building(ctx, get_bridge_str(ctx.b), at_nw_corner, |
| 963 | &add_size); |
| 964 | case building_type::Well: |
| 965 | return "l"; |
| 966 | case building_type::SiegeEngine: |
| 967 | return do_block_building(ctx, get_siege_str(ctx.b), at_center); |
| 968 | case building_type::Workshop: |
| 969 | return do_block_building(ctx, get_workshop_str(ctx.b), at_center); |
| 970 | case building_type::Furnace: |
| 971 | return do_block_building(ctx, get_furnace_str(ctx.b), at_center); |
| 972 | case building_type::WindowGlass: |
| 973 | return "y"; |
| 974 | case building_type::WindowGem: |
| 975 | return "Y"; |
| 976 | case building_type::Shop: |
| 977 | return do_block_building(ctx, "z", at_center); |
| 978 | case building_type::AnimalTrap: |
no test coverage detected