• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Return-To-The-Roots / s25client / 21283273387

23 Jan 2026 10:39AM UTC coverage: 50.757% (+0.09%) from 50.663%
21283273387

Pull #1679

github

web-flow
Merge c392aa0ea into 12da8bf44
Pull Request #1679: Add all classic S2 cheats and a few more

94 of 155 new or added lines in 12 files covered. (60.65%)

7 existing lines in 5 files now uncovered.

22798 of 44916 relevant lines covered (50.76%)

41539.59 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
/libs/s25main/gameTypes/BuildingTypes.h
1
// Copyright (C) 2005 - 2021 Settlers Freaks (sf-team at siedler25.org)
2
//
3
// SPDX-License-Identifier: GPL-2.0-or-later
4

5
#pragma once
6

7
#include "BuildingQuality.h"
8
#include "GoodTypes.h"
9
#include "JobTypes.h"
10
#include "Point.h"
11
#include "helpers/OptionalEnum.h"
12
#include "variant.h"
13
#include <cassert>
14

15
struct BuildingCost
16
{
17
    uint8_t boards;
18
    uint8_t stones;
19
};
20

21
class WaresNeeded
22
{
23
    GoodType elems_[3];
24
    unsigned size_;
25

UNCOV
26
public:
×
27
    constexpr WaresNeeded() : elems_{}, size_(0) {}
1,834✔
28
    constexpr explicit WaresNeeded(GoodType good1) : elems_{good1}, size_(1) {}
29
    constexpr WaresNeeded(GoodType good1, GoodType good2) : elems_{good1, good2}, size_(2) {}
30
    constexpr WaresNeeded(GoodType good1, GoodType good2, GoodType good3) : elems_{good1, good2, good3}, size_(3) {}
31
    constexpr unsigned size() const { return size_; }
559✔
32
    constexpr bool empty() const { return size_ == 0u; }
10✔
33
    constexpr GoodType operator[](unsigned i) const
319✔
34
    {
35
        assert(i < size_);
319✔
36
        return elems_[i];
319✔
37
    }
38
    constexpr const GoodType* begin() const { return elems_; }
39
    constexpr const GoodType* end() const { return elems_ + size_; }
40
};
41

42
/// Describes the work the building does
43
struct BldWorkDescription
44
{
45
    /// Worker belonging to the building, if any
46
    helpers::OptionalEnum<Job> job = boost::none;
47
    /// Ware produced, if any
48
    boost_variant2<GoodType, Job, boost::none_t> producedWare = boost::none;
49
    // Required for use in aggregate initialization
50
    // NOLINTBEGIN(readability-redundant-member-init)
51
    /// Wares the building needs, if any
52
    WaresNeeded waresNeeded = {};
53
    // NOLINTEND(readability-redundant-member-init)
54
    /// How many wares of each type can be stored
55
    uint8_t numSpacesPerWare = 6;
56
    /// True if one of each waresNeeded is used per production cycle
57
    /// False if the ware type is used, that the building has the most of
58
    bool useOneWareEach = true;
59
};
60

61
/// Smoke definition for buildings
62
struct SmokeConst
63
{
64
    constexpr SmokeConst() = default;
65
    constexpr SmokeConst(uint8_t type, const Point<int8_t>& offset) : type(type), offset(offset) {}
66
    /// Smoke type (1-4), 0 = no smoke
67
    uint8_t type = 0;
68
    /// Position of the smoke relative to the buildings origin
69
    Point<int8_t> offset = {0, 0};
70
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc