commit 9ebf3666372806e69a98c2dca4efba4596c7e5dd Author: Kieran Kihn <114803508+kierankihn@users.noreply.github.com> Date: Fri Nov 14 17:43:58 2025 +0800 initial commit diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..cd56e3d --- /dev/null +++ b/.clang-format @@ -0,0 +1,202 @@ +# 语言: None, Cpp, Java, JavaScript, ObjC, Proto, TableGen, TextProto +Language: Cpp + +# 访问说明符(public、private等)的偏移 +AccessModifierOffset: -4 + +# 左括号(左圆括号、左尖括号、左方括号)后的对齐: Align, DontAlign, AlwaysBreak(总是在左括号后换行) +AlignAfterOpenBracket: Align + +# 连续赋值时,对齐所有等号 +AlignConsecutiveAssignments: true + +# 连续声明时,对齐所有声明的变量名 +AlignConsecutiveDeclarations: false + +# 对齐连续位域字段的风格 +AlignConsecutiveBitFields: Consecutive + +# 对齐连续宏定义的风格 +AlignConsecutiveMacros: Consecutive + +# 用于在使用反斜杠换行中对齐反斜杠的选项 +AlignEscapedNewlines: Left + +# 水平对齐二元和三元表达式的操作数 +AlignOperands: AlignAfterOperator + +# 对齐连续的尾随的注释 +AlignTrailingComments: true + +# 如果函数调用或带括号的初始化列表不适合全部在一行时 +# 允许将所有参数放到下一行,即使 BinPackArguments 为 false +AllowAllArgumentsOnNextLine: true + +# 允许构造函数的初始化参数放在下一行 +PackConstructorInitializers: NextLine + +# 允许函数声明的所有参数在放在下一行 +AllowAllParametersOfDeclarationOnNextLine: true + +# 允许短的块放在同一行(Always 总是将短块合并成一行,Empty 只合并空块) +AllowShortBlocksOnASingleLine: Empty + +# 允许短的case标签放在同一行 +AllowShortCaseLabelsOnASingleLine: true + +# 允许短的函数放在同一行: None, InlineOnly(定义在类中), Empty(空函数), Inline(定义在类中,空函数), All +AllowShortFunctionsOnASingleLine: Empty + +# 允许短的if语句保持在同一行 +AllowShortIfStatementsOnASingleLine: AllIfsAndElse + +# 允许短的循环保持在同一行 +AllowShortLoopsOnASingleLine: true + + # 总是在返回类型后换行: None, All, TopLevel(顶级函数,不包括在类中的函数), + # AllDefinitions(所有的定义,不包括声明), TopLevelDefinitions(所有的顶级函数的定义) + +# 函数声明返回类型后是否换行(None 自动,All全部,TopLevel...) +BreakAfterReturnType: Automatic + +# 总是在多行string字面量前换行 +AlwaysBreakBeforeMultilineStrings: false + +# 总是在template声明后换行 +AlwaysBreakTemplateDeclarations: Yes + +# false表示函数实参要么都在同一行,要么都各自一行 +BinPackArguments: false + +# false表示所有形参要么都在同一行,要么都各自一行 +BinPackParameters: OnePerLine + +# 在二元运算符前换行: None(在操作符后换行), NonAssignment(在非赋值的操作符前换行), All(在操作符前换行) +BreakBeforeBinaryOperators: NonAssignment + +# 大括号的换行规则 +BreakBeforeBraces: Stroustrup + +# 三元运算操作符换行位置(?和: 在新行还是尾部) +BreakBeforeTernaryOperators: true + +# 要使用的构造函数初始化式样式 +BreakConstructorInitializers: AfterColon + +# 每行字符的限制,0表示没有限制 +ColumnLimit: 140 + +# 如果为true,则连续的名称空间声明将在同一行上。如果为false,则在新行上声明每个名称空间。 +CompactNamespaces: false + +# 构造函数的初始化列表的缩进宽度 +ConstructorInitializerIndentWidth: 4 + +# 延续的行的缩进宽度 +ContinuationIndentWidth: 4 + +# 去除C++11的列表初始化的大括号{后和}前的空格 +Cpp11BracedListStyle: true + +# 自动检测函数的调用和定义是否被格式为每行一个参数(Experimental) +ExperimentalAutoDetectBinPacking: false + +# 如果为true,则clang格式会为短名称空间添加缺少的名称空间结尾注释,并修复无效的现有名称结束注释 +FixNamespaceComments: true + +# 需要被解读为foreach循环而不是函数调用的宏 +ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] + + # 对#include进行排序,匹配了某正则表达式的#include拥有对应的优先级,匹配不到的则默认优先级为INT_MAX(优先级越小排序越靠前), + # 可以定义负数优先级从而保证某些#include永远在最前面 + # IncludeCategories: + # - Regex: '^"(llvm|llvm-c|clang|clang-c)/' + # Priority: 2 + # - Regex: '^(<|"(gtest|isl|json)/)' + # Priority: 3 + # - Regex: '.*' + # Priority: 1 + +# 缩进case标签 +IndentCaseLabels: true + +# 要使用的预处理器指令缩进样式 +IndentPPDirectives: AfterHash + +# 缩进宽度 +IndentWidth: 4 + +# 函数返回类型换行时,缩进函数声明或函数定义的函数名 +IndentWrappedFunctionNames: true + +# 保留在块开始处的空行 +KeepEmptyLines: + AtEndOfFile: true + AtStartOfBlock: true + AtStartOfFile: false + +# 连续空行的最大数量 +MaxEmptyLinesToKeep: 2 + +# 命名空间的缩进: None, Inner(缩进嵌套的命名空间中的内容), All +NamespaceIndentation: All + +# 指针和引用的对齐: Left, Right, Middle +PointerAlignment: Right + +# 允许重新排版注释 +ReflowComments: Always + +# 允许排序#include +SortIncludes: true + +# 允许排序 using 声明顺序 +SortUsingDeclarations: true + +# 在C风格类型转换后添加空格 +SpaceAfterCStyleCast: false + +# 在逻辑非操作符(!)之后插入一个空格 +SpaceAfterLogicalNot: false + +# 在 template 关键字后插入一个空格 +SpaceAfterTemplateKeyword: false + +# 定义在什么情况下在指针限定符之前或之后放置空格 +SpaceAroundPointerQualifiers: Default + +# 在赋值运算符之前添加空格 +SpaceBeforeAssignmentOperators: true + +# 左圆括号之前添加一个空格: Never, ControlStatements, Always +SpaceBeforeParens: ControlStatements + +# 空格将在基于范围的for循环冒号之前被删除 +SpaceBeforeRangeBasedForLoopColon: true + +# [ 前是否添加空格(数组名和[之间,Lambdas不会受到影响) +# 连续多个 [ 只考虑第一个(嵌套数组,多维数组) +SpaceBeforeSquareBrackets: false + +# 在尾随的评论前添加的空格数(只适用于//) +SpacesBeforeTrailingComments: 3 + +# 在尖括号的<后和>前添加空格 +SpacesInAngles: Never + +SpacesInParens: Never + +# 在容器(ObjC和JavaScript的数组和字典等)字面量中添加空格 +SpacesInContainerLiterals: false + +# 在方括号的[后和]前添加空格,lamda表达式和未指明大小的数组的声明不受影响 +SpacesInSquareBrackets: false + +# 标准: Cpp03, Cpp11, Auto +Standard: Latest + +# tab宽度 +TabWidth: 4 + +# 使用tab字符: Never, ForIndentation, ForContinuationAndIndentation, Always +UseTab: Never \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.idea/.idea.iml b/.idea/.idea/.idea.iml new file mode 100644 index 0000000..bc2cd87 --- /dev/null +++ b/.idea/.idea/.idea.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea/modules.xml b/.idea/.idea/modules.xml new file mode 100644 index 0000000..08f54a6 --- /dev/null +++ b/.idea/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea/workspace.xml b/.idea/.idea/workspace.xml new file mode 100644 index 0000000..34a1af2 --- /dev/null +++ b/.idea/.idea/workspace.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + 1763096588353 + + + + + + \ No newline at end of file diff --git a/.idea/dictionaries/project.xml b/.idea/dictionaries/project.xml new file mode 100644 index 0000000..51a2dd0 --- /dev/null +++ b/.idea/dictionaries/project.xml @@ -0,0 +1,8 @@ + + + + ftxui + yuzhe + + + \ No newline at end of file diff --git a/.idea/editor.xml b/.idea/editor.xml new file mode 100644 index 0000000..963c96f --- /dev/null +++ b/.idea/editor.xml @@ -0,0 +1,344 @@ + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..e479d63 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,8 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..77b6e72 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/uno-game.iml b/.idea/uno-game.iml new file mode 100644 index 0000000..f08604b --- /dev/null +++ b/.idea/uno-game.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..8306744 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..6c3d0d9 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 4.0) +project(uno-game) + +set(CMAKE_CXX_STANDARD 26) + +find_package(ftxui CONFIG REQUIRED) + +add_executable(uno-game src/main.cpp) +target_link_libraries(uno-game + PRIVATE ftxui::screen + PRIVATE ftxui::dom + PRIVATE ftxui::component +) \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e766468 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2025 Yuzhe Guo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29