mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:47:44 +00:00
Everywhere: Run clang-format
This commit is contained in:
parent
0376c127f6
commit
086969277e
1665 changed files with 8479 additions and 8479 deletions
|
@ -148,7 +148,7 @@ void Card::draw(GUI::Painter& painter) const
|
|||
painter.blit(position(), m_upside_down ? *s_background : *m_front, m_front->rect());
|
||||
}
|
||||
|
||||
void Card::clear(GUI::Painter& painter, const Color& background_color) const
|
||||
void Card::clear(GUI::Painter& painter, Color const& background_color) const
|
||||
{
|
||||
painter.fill_rect({ old_position(), { width, height } }, background_color);
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ void Card::save_old_position()
|
|||
m_old_position_valid = true;
|
||||
}
|
||||
|
||||
void Card::clear_and_draw(GUI::Painter& painter, const Color& background_color)
|
||||
void Card::clear_and_draw(GUI::Painter& painter, Color const& background_color)
|
||||
{
|
||||
if (is_old_position_valid())
|
||||
clear(painter, background_color);
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
|
||||
Gfx::IntRect& rect() { return m_rect; }
|
||||
Gfx::IntPoint position() const { return m_rect.location(); }
|
||||
const Gfx::IntPoint& old_position() const { return m_old_position; }
|
||||
Gfx::IntPoint const& old_position() const { return m_old_position; }
|
||||
uint8_t value() const { return m_value; };
|
||||
Suit suit() const { return m_suit; }
|
||||
|
||||
|
@ -59,8 +59,8 @@ public:
|
|||
void save_old_position();
|
||||
|
||||
void draw(GUI::Painter&) const;
|
||||
void clear(GUI::Painter&, const Color& background_color) const;
|
||||
void clear_and_draw(GUI::Painter&, const Color& background_color);
|
||||
void clear(GUI::Painter&, Color const& background_color) const;
|
||||
void clear_and_draw(GUI::Painter&, Color const& background_color);
|
||||
|
||||
private:
|
||||
Card(Suit suit, uint8_t value);
|
||||
|
|
|
@ -15,7 +15,7 @@ CardStack::CardStack()
|
|||
{
|
||||
}
|
||||
|
||||
CardStack::CardStack(const Gfx::IntPoint& position, Type type)
|
||||
CardStack::CardStack(Gfx::IntPoint const& position, Type type)
|
||||
: m_position(position)
|
||||
, m_type(type)
|
||||
, m_rules(rules_for_type(type))
|
||||
|
@ -25,7 +25,7 @@ CardStack::CardStack(const Gfx::IntPoint& position, Type type)
|
|||
calculate_bounding_box();
|
||||
}
|
||||
|
||||
CardStack::CardStack(const Gfx::IntPoint& position, Type type, NonnullRefPtr<CardStack> associated_stack)
|
||||
CardStack::CardStack(Gfx::IntPoint const& position, Type type, NonnullRefPtr<CardStack> associated_stack)
|
||||
: m_associated_stack(move(associated_stack))
|
||||
, m_position(position)
|
||||
, m_type(type)
|
||||
|
@ -42,7 +42,7 @@ void CardStack::clear()
|
|||
m_stack_positions.clear();
|
||||
}
|
||||
|
||||
void CardStack::draw(GUI::Painter& painter, const Gfx::Color& background_color)
|
||||
void CardStack::draw(GUI::Painter& painter, Gfx::Color const& background_color)
|
||||
{
|
||||
auto draw_background_if_empty = [&]() {
|
||||
size_t number_of_moving_cards = 0;
|
||||
|
@ -108,7 +108,7 @@ void CardStack::rebound_cards()
|
|||
card.set_position(m_stack_positions.at(card_index++));
|
||||
}
|
||||
|
||||
void CardStack::add_all_grabbed_cards(const Gfx::IntPoint& click_location, NonnullRefPtrVector<Card>& grabbed, MovementRule movement_rule)
|
||||
void CardStack::add_all_grabbed_cards(Gfx::IntPoint const& click_location, NonnullRefPtrVector<Card>& grabbed, MovementRule movement_rule)
|
||||
{
|
||||
VERIFY(grabbed.is_empty());
|
||||
|
||||
|
@ -187,7 +187,7 @@ void CardStack::add_all_grabbed_cards(const Gfx::IntPoint& click_location, Nonnu
|
|||
}
|
||||
}
|
||||
|
||||
bool CardStack::is_allowed_to_push(const Card& card, size_t stack_size, MovementRule movement_rule) const
|
||||
bool CardStack::is_allowed_to_push(Card const& card, size_t stack_size, MovementRule movement_rule) const
|
||||
{
|
||||
if (m_type == Type::Stock || m_type == Type::Waste || m_type == Type::Play)
|
||||
return false;
|
||||
|
|
|
@ -31,17 +31,17 @@ public:
|
|||
};
|
||||
|
||||
CardStack();
|
||||
CardStack(const Gfx::IntPoint& position, Type type);
|
||||
CardStack(const Gfx::IntPoint& position, Type type, NonnullRefPtr<CardStack> associated_stack);
|
||||
CardStack(Gfx::IntPoint const& position, Type type);
|
||||
CardStack(Gfx::IntPoint const& position, Type type, NonnullRefPtr<CardStack> associated_stack);
|
||||
|
||||
bool is_empty() const { return m_stack.is_empty(); }
|
||||
bool is_focused() const { return m_focused; }
|
||||
Type type() const { return m_type; }
|
||||
const NonnullRefPtrVector<Card>& stack() const { return m_stack; }
|
||||
NonnullRefPtrVector<Card> const& stack() const { return m_stack; }
|
||||
size_t count() const { return m_stack.size(); }
|
||||
const Card& peek() const { return m_stack.last(); }
|
||||
Card const& peek() const { return m_stack.last(); }
|
||||
Card& peek() { return m_stack.last(); }
|
||||
const Gfx::IntRect& bounding_box() const { return m_bounding_box; }
|
||||
Gfx::IntRect const& bounding_box() const { return m_bounding_box; }
|
||||
|
||||
void set_focused(bool focused) { m_focused = focused; }
|
||||
|
||||
|
@ -50,9 +50,9 @@ public:
|
|||
void move_to_stack(CardStack&);
|
||||
void rebound_cards();
|
||||
|
||||
bool is_allowed_to_push(const Card&, size_t stack_size = 1, MovementRule movement_rule = MovementRule::Alternating) const;
|
||||
void add_all_grabbed_cards(const Gfx::IntPoint& click_location, NonnullRefPtrVector<Card>& grabbed, MovementRule movement_rule = MovementRule::Alternating);
|
||||
void draw(GUI::Painter&, const Gfx::Color& background_color);
|
||||
bool is_allowed_to_push(Card const&, size_t stack_size = 1, MovementRule movement_rule = MovementRule::Alternating) const;
|
||||
void add_all_grabbed_cards(Gfx::IntPoint const& click_location, NonnullRefPtrVector<Card>& grabbed, MovementRule movement_rule = MovementRule::Alternating);
|
||||
void draw(GUI::Painter&, Gfx::Color const& background_color);
|
||||
void clear();
|
||||
|
||||
private:
|
||||
|
@ -125,7 +125,7 @@ struct AK::Formatter<Cards::CardStack> : Formatter<FormatString> {
|
|||
StringBuilder cards;
|
||||
bool first_card = true;
|
||||
|
||||
for (const auto& card : stack.stack()) {
|
||||
for (auto const& card : stack.stack()) {
|
||||
cards.appendff("{}{}", (first_card ? "" : " "), card);
|
||||
first_card = false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue