diff options
author | Linus Groh <mail@linusgroh.de> | 2022-12-04 18:02:33 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-12-06 08:54:33 +0100 |
commit | 6e19ab2bbce0b113b628e6f8e9b5c0640053933e (patch) | |
tree | 372d21b2f5dcff112f5d0089559c6af5798680d4 /Userland/Games/GameOfLife | |
parent | f74251606d74b504a1379ebb893fdb5529054ea5 (diff) | |
download | serenity-6e19ab2bbce0b113b628e6f8e9b5c0640053933e.zip |
AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
Diffstat (limited to 'Userland/Games/GameOfLife')
-rw-r--r-- | Userland/Games/GameOfLife/BoardWidget.cpp | 30 | ||||
-rw-r--r-- | Userland/Games/GameOfLife/Pattern.cpp | 6 | ||||
-rw-r--r-- | Userland/Games/GameOfLife/Pattern.h | 6 |
3 files changed, 21 insertions, 21 deletions
diff --git a/Userland/Games/GameOfLife/BoardWidget.cpp b/Userland/Games/GameOfLife/BoardWidget.cpp index 6daffc5390..0dc944f050 100644 --- a/Userland/Games/GameOfLife/BoardWidget.cpp +++ b/Userland/Games/GameOfLife/BoardWidget.cpp @@ -255,7 +255,7 @@ void BoardWidget::place_pattern(size_t row, size_t column) void BoardWidget::setup_patterns() { - auto add_pattern = [&](String name, NonnullOwnPtr<Pattern> pattern) { + auto add_pattern = [&](DeprecatedString name, NonnullOwnPtr<Pattern> pattern) { auto action = GUI::Action::create(move(name), [this, pattern = pattern.ptr()](const GUI::Action&) { on_pattern_selection(pattern); }); @@ -263,29 +263,29 @@ void BoardWidget::setup_patterns() m_patterns.append(move(pattern)); }; - Vector<String> blinker = { + Vector<DeprecatedString> blinker = { "OOO" }; - Vector<String> toad = { + Vector<DeprecatedString> toad = { ".OOO", "OOO." }; - Vector<String> glider = { + Vector<DeprecatedString> glider = { ".O.", "..O", "OOO", }; - Vector<String> lightweight_spaceship = { + Vector<DeprecatedString> lightweight_spaceship = { ".OO..", "OOOO.", "OO.OO", "..OO." }; - Vector<String> middleweight_spaceship = { + Vector<DeprecatedString> middleweight_spaceship = { ".OOOOO", "O....O", ".....O", @@ -293,7 +293,7 @@ void BoardWidget::setup_patterns() "..O..." }; - Vector<String> heavyweight_spaceship = { + Vector<DeprecatedString> heavyweight_spaceship = { "..OO...", "O....O.", "......O", @@ -301,9 +301,9 @@ void BoardWidget::setup_patterns() ".OOOOOO" }; - Vector<String> infinite_1 = { "OOOOOOOO.OOOOO...OOO......OOOOOOO.OOOOO" }; + Vector<DeprecatedString> infinite_1 = { "OOOOOOOO.OOOOO...OOO......OOOOOOO.OOOOO" }; - Vector<String> infinite_2 = { + Vector<DeprecatedString> infinite_2 = { "......O.", "....O.OO", "....O.O.", @@ -312,7 +312,7 @@ void BoardWidget::setup_patterns() "O.O....." }; - Vector<String> infinite_3 = { + Vector<DeprecatedString> infinite_3 = { "OOO.O", "O....", "...OO", @@ -320,7 +320,7 @@ void BoardWidget::setup_patterns() "O.O.O" }; - Vector<String> simkin_glider_gun = { + Vector<DeprecatedString> simkin_glider_gun = { "OO.....OO........................", "OO.....OO........................", ".................................", @@ -343,7 +343,7 @@ void BoardWidget::setup_patterns() ".....................OOO.........", ".......................O........." }; - Vector<String> gosper_glider_gun = { + Vector<DeprecatedString> gosper_glider_gun = { "........................O...........", "......................O.O...........", "............OO......OO............OO", @@ -355,19 +355,19 @@ void BoardWidget::setup_patterns() "............OO......................" }; - Vector<String> r_pentomino = { + Vector<DeprecatedString> r_pentomino = { ".OO", "OO.", ".O." }; - Vector<String> diehard = { + Vector<DeprecatedString> diehard = { "......O.", "OO......", ".O...OOO" }; - Vector<String> acorn = { + Vector<DeprecatedString> acorn = { ".O.....", "...O...", "OO..OOO" diff --git a/Userland/Games/GameOfLife/Pattern.cpp b/Userland/Games/GameOfLife/Pattern.cpp index 5c26c6dc84..e2a2c32d6f 100644 --- a/Userland/Games/GameOfLife/Pattern.cpp +++ b/Userland/Games/GameOfLife/Pattern.cpp @@ -6,13 +6,13 @@ */ #include "Pattern.h" -#include <AK/String.h> +#include <AK/DeprecatedString.h> #include <AK/StringBuilder.h> #include <AK/Vector.h> #include <LibGUI/Action.h> #include <stdio.h> -Pattern::Pattern(Vector<String> pattern) +Pattern::Pattern(Vector<DeprecatedString> pattern) { m_pattern = move(pattern); } @@ -24,7 +24,7 @@ void Pattern::set_action(GUI::Action* action) void Pattern::rotate_clockwise() { - Vector<String> rotated; + Vector<DeprecatedString> rotated; for (size_t i = 0; i < m_pattern.first().length(); i++) { StringBuilder builder; for (int j = m_pattern.size() - 1; j >= 0; j--) { diff --git a/Userland/Games/GameOfLife/Pattern.h b/Userland/Games/GameOfLife/Pattern.h index c7b1514963..9a445a4d56 100644 --- a/Userland/Games/GameOfLife/Pattern.h +++ b/Userland/Games/GameOfLife/Pattern.h @@ -14,13 +14,13 @@ class Pattern final { public: - Pattern(Vector<String>); - Vector<String> pattern() { return m_pattern; }; + Pattern(Vector<DeprecatedString>); + Vector<DeprecatedString> pattern() { return m_pattern; }; GUI::Action* action() { return m_action; } void set_action(GUI::Action*); void rotate_clockwise(); private: RefPtr<GUI::Action> m_action; - Vector<String> m_pattern; + Vector<DeprecatedString> m_pattern; }; |