Skip to content

Commit c3020a0

Browse files
committed
chore: add pw04
1 parent 7f649bb commit c3020a0

35 files changed

+2180
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
- [Practical Work 1 - Matrix](pw01)
99
- [Practical Work 2 - Squadron](pw02)
1010
- [Practical Work 3 - River](pw03)
11+
- [Practical Work 4 - Buffy](pw04)

pw04/.clang-format

+269
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,269 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: Chromium
4+
AccessModifierOffset: -4
5+
AlignAfterOpenBracket: Align
6+
AlignArrayOfStructures: None
7+
AlignConsecutiveAssignments:
8+
Enabled: false
9+
AcrossEmptyLines: false
10+
AcrossComments: false
11+
AlignCompound: false
12+
PadOperators: true
13+
AlignConsecutiveBitFields:
14+
Enabled: false
15+
AcrossEmptyLines: false
16+
AcrossComments: false
17+
AlignCompound: false
18+
PadOperators: false
19+
AlignConsecutiveDeclarations:
20+
Enabled: false
21+
AcrossEmptyLines: false
22+
AcrossComments: false
23+
AlignCompound: false
24+
PadOperators: false
25+
AlignConsecutiveMacros:
26+
Enabled: false
27+
AcrossEmptyLines: false
28+
AcrossComments: false
29+
AlignCompound: false
30+
PadOperators: false
31+
AlignConsecutiveShortCaseStatements:
32+
Enabled: false
33+
AcrossEmptyLines: false
34+
AcrossComments: false
35+
AlignCaseColons: false
36+
AlignEscapedNewlines: Left
37+
AlignOperands: Align
38+
AlignTrailingComments:
39+
Kind: Always
40+
OverEmptyLines: 0
41+
AllowAllArgumentsOnNextLine: true
42+
AllowAllParametersOfDeclarationOnNextLine: false
43+
AllowShortBlocksOnASingleLine: Never
44+
AllowShortCaseLabelsOnASingleLine: false
45+
AllowShortEnumsOnASingleLine: true
46+
AllowShortFunctionsOnASingleLine: Inline
47+
AllowShortIfStatementsOnASingleLine: Never
48+
AllowShortLambdasOnASingleLine: All
49+
AllowShortLoopsOnASingleLine: false
50+
AlwaysBreakAfterDefinitionReturnType: None
51+
AlwaysBreakAfterReturnType: None
52+
AlwaysBreakBeforeMultilineStrings: true
53+
AlwaysBreakTemplateDeclarations: Yes
54+
AttributeMacros:
55+
- __capability
56+
BinPackArguments: true
57+
BinPackParameters: false
58+
BitFieldColonSpacing: Both
59+
BraceWrapping:
60+
AfterCaseLabel: false
61+
AfterClass: false
62+
AfterControlStatement: Never
63+
AfterEnum: false
64+
AfterExternBlock: false
65+
AfterFunction: false
66+
AfterNamespace: false
67+
AfterObjCDeclaration: false
68+
AfterStruct: false
69+
AfterUnion: false
70+
BeforeCatch: false
71+
BeforeElse: false
72+
BeforeLambdaBody: false
73+
BeforeWhile: false
74+
IndentBraces: false
75+
SplitEmptyFunction: true
76+
SplitEmptyRecord: true
77+
SplitEmptyNamespace: true
78+
BreakAfterAttributes: Never
79+
BreakAfterJavaFieldAnnotations: false
80+
BreakArrays: true
81+
BreakBeforeBinaryOperators: None
82+
BreakBeforeConceptDeclarations: Always
83+
BreakBeforeBraces: Attach
84+
BreakBeforeInlineASMColon: OnlyMultiline
85+
BreakBeforeTernaryOperators: true
86+
BreakConstructorInitializers: BeforeColon
87+
BreakInheritanceList: BeforeColon
88+
BreakStringLiterals: true
89+
ColumnLimit: 90
90+
CommentPragmas: '^ IWYU pragma:'
91+
CompactNamespaces: false
92+
ConstructorInitializerIndentWidth: 4
93+
ContinuationIndentWidth: 4
94+
Cpp11BracedListStyle: true
95+
DerivePointerAlignment: false
96+
DisableFormat: false
97+
EmptyLineAfterAccessModifier: Never
98+
EmptyLineBeforeAccessModifier: LogicalBlock
99+
ExperimentalAutoDetectBinPacking: false
100+
FixNamespaceComments: true
101+
ForEachMacros:
102+
- foreach
103+
- Q_FOREACH
104+
- BOOST_FOREACH
105+
IfMacros:
106+
- KJ_IF_MAYBE
107+
IncludeBlocks: Preserve
108+
IncludeCategories:
109+
- Regex: '^<ext/.*\.h>'
110+
Priority: 2
111+
SortPriority: 0
112+
CaseSensitive: false
113+
- Regex: '^<.*\.h>'
114+
Priority: 1
115+
SortPriority: 0
116+
CaseSensitive: false
117+
- Regex: '^<.*'
118+
Priority: 2
119+
SortPriority: 0
120+
CaseSensitive: false
121+
- Regex: '.*'
122+
Priority: 3
123+
SortPriority: 0
124+
CaseSensitive: false
125+
IncludeIsMainRegex: '([-_](test|unittest))?$'
126+
IncludeIsMainSourceRegex: ''
127+
IndentAccessModifiers: false
128+
IndentCaseBlocks: false
129+
IndentCaseLabels: true
130+
IndentExternBlock: AfterExternBlock
131+
IndentGotoLabels: true
132+
IndentPPDirectives: None
133+
IndentRequiresClause: true
134+
IndentWidth: 4
135+
IndentWrappedFunctionNames: false
136+
InsertBraces: false
137+
InsertNewlineAtEOF: false
138+
InsertTrailingCommas: None
139+
IntegerLiteralSeparator:
140+
Binary: 0
141+
BinaryMinDigits: 0
142+
Decimal: 0
143+
DecimalMinDigits: 0
144+
Hex: 0
145+
HexMinDigits: 0
146+
JavaScriptQuotes: Leave
147+
JavaScriptWrapImports: true
148+
KeepEmptyLinesAtTheStartOfBlocks: false
149+
KeepEmptyLinesAtEOF: false
150+
LambdaBodyIndentation: Signature
151+
LineEnding: DeriveLF
152+
MacroBlockBegin: ''
153+
MacroBlockEnd: ''
154+
MaxEmptyLinesToKeep: 1
155+
NamespaceIndentation: None
156+
ObjCBinPackProtocolList: Never
157+
ObjCBlockIndentWidth: 2
158+
ObjCBreakBeforeNestedBlockParam: true
159+
ObjCSpaceAfterProperty: false
160+
ObjCSpaceBeforeProtocolList: true
161+
PackConstructorInitializers: NextLine
162+
PenaltyBreakAssignment: 2
163+
PenaltyBreakBeforeFirstCallParameter: 1
164+
PenaltyBreakComment: 300
165+
PenaltyBreakFirstLessLess: 120
166+
PenaltyBreakOpenParenthesis: 0
167+
PenaltyBreakString: 1000
168+
PenaltyBreakTemplateDeclaration: 10
169+
PenaltyExcessCharacter: 1000000
170+
PenaltyIndentedWhitespace: 0
171+
PenaltyReturnTypeOnItsOwnLine: 200
172+
PointerAlignment: Left
173+
PPIndentWidth: -1
174+
QualifierAlignment: Leave
175+
RawStringFormats:
176+
- Language: Cpp
177+
Delimiters:
178+
- cc
179+
- CC
180+
- cpp
181+
- Cpp
182+
- CPP
183+
- 'c++'
184+
- 'C++'
185+
CanonicalDelimiter: ''
186+
BasedOnStyle: google
187+
- Language: TextProto
188+
Delimiters:
189+
- pb
190+
- PB
191+
- proto
192+
- PROTO
193+
EnclosingFunctions:
194+
- EqualsProto
195+
- EquivToProto
196+
- PARSE_PARTIAL_TEXT_PROTO
197+
- PARSE_TEST_PROTO
198+
- PARSE_TEXT_PROTO
199+
- ParseTextOrDie
200+
- ParseTextProtoOrDie
201+
- ParseTestProto
202+
- ParsePartialTestProto
203+
CanonicalDelimiter: pb
204+
BasedOnStyle: google
205+
ReferenceAlignment: Pointer
206+
ReflowComments: true
207+
RemoveBracesLLVM: false
208+
RemoveParentheses: Leave
209+
RemoveSemicolon: false
210+
RequiresClausePosition: OwnLine
211+
RequiresExpressionIndentation: OuterScope
212+
SeparateDefinitionBlocks: Leave
213+
ShortNamespaceLines: 1
214+
SortIncludes: CaseSensitive
215+
SortJavaStaticImport: Before
216+
SortUsingDeclarations: LexicographicNumeric
217+
SpaceAfterCStyleCast: false
218+
SpaceAfterLogicalNot: false
219+
SpaceAfterTemplateKeyword: true
220+
SpaceAroundPointerQualifiers: Default
221+
SpaceBeforeAssignmentOperators: true
222+
SpaceBeforeCaseColon: false
223+
SpaceBeforeCpp11BracedList: false
224+
SpaceBeforeCtorInitializerColon: true
225+
SpaceBeforeInheritanceColon: true
226+
SpaceBeforeJsonColon: false
227+
SpaceBeforeParens: ControlStatements
228+
SpaceBeforeParensOptions:
229+
AfterControlStatements: true
230+
AfterForeachMacros: true
231+
AfterFunctionDefinitionName: false
232+
AfterFunctionDeclarationName: false
233+
AfterIfMacros: true
234+
AfterOverloadedOperator: false
235+
AfterRequiresInClause: false
236+
AfterRequiresInExpression: false
237+
BeforeNonEmptyParentheses: false
238+
SpaceBeforeRangeBasedForLoopColon: true
239+
SpaceBeforeSquareBrackets: false
240+
SpaceInEmptyBlock: false
241+
SpacesBeforeTrailingComments: 2
242+
SpacesInAngles: Never
243+
SpacesInContainerLiterals: true
244+
SpacesInLineCommentPrefix:
245+
Minimum: 1
246+
Maximum: -1
247+
SpacesInParens: Never
248+
SpacesInParensOptions:
249+
InCStyleCasts: false
250+
InConditionalStatements: false
251+
InEmptyParentheses: false
252+
Other: false
253+
SpacesInSquareBrackets: false
254+
Standard: Auto
255+
StatementAttributeLikeMacros:
256+
- Q_EMIT
257+
StatementMacros:
258+
- Q_UNUSED
259+
- QT_REQUIRE_VERSION
260+
TabWidth: 8
261+
UseTab: Never
262+
VerilogBreakBetweenInstancePorts: true
263+
WhitespaceSensitiveMacros:
264+
- BOOST_PP_STRINGIZE
265+
- CF_SWIFT_NAME
266+
- NS_SWIFT_NAME
267+
- PP_STRINGIZE
268+
- STRINGIZE
269+
...

pw04/.gitignore

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Compiled Object files
5+
*.slo
6+
*.lo
7+
*.o
8+
*.obj
9+
10+
# Precompiled Headers
11+
*.gch
12+
*.pch
13+
14+
# Compiled Dynamic libraries
15+
*.so
16+
*.dylib
17+
*.dll
18+
19+
# Fortran module files
20+
*.mod
21+
*.smod
22+
23+
# Compiled Static libraries
24+
*.lai
25+
*.la
26+
*.a
27+
*.lib
28+
29+
# Executables
30+
*.exe
31+
*.out
32+
*.app
33+
34+
cmake-build-*
35+
.idea
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="buffy (50x50 10v 20h) [run]" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="50 50 10 20" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="buffy" TARGET_NAME="buffy" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="buffy" RUN_TARGET_NAME="buffy">
3+
<method v="2">
4+
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
5+
</method>
6+
</configuration>
7+
</component>

pw04/CMakeLists.txt

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
cmake_minimum_required(VERSION 3.15)
2+
project(buffy CXX)
3+
4+
set(CMAKE_CXX_STANDARD 23)
5+
6+
set(SOURCES
7+
src/action/Action.hpp src/action/Action.cpp
8+
src/action/Kill.hpp src/action/Kill.cpp
9+
src/action/Move.hpp src/action/Move.cpp
10+
src/action/Transform.hpp src/action/Transform.cpp
11+
src/actor/Humanoid.hpp src/actor/Humanoid.cpp
12+
src/actor/Human.hpp src/actor/Human.cpp
13+
src/actor/Vampire.hpp src/actor/Vampire.cpp
14+
src/actor/Buffy.hpp src/actor/Buffy.cpp
15+
src/displayer/FieldDisplayer.hpp src/displayer/FieldDisplayer.cpp
16+
src/Field.hpp src/Field.cpp
17+
src/Controller.hpp src/Controller.cpp
18+
src/math/Vector2D.hpp src/math/Vector2D.cpp
19+
)
20+
21+
add_executable(buffy
22+
${SOURCES}
23+
src/main.cpp)
24+
25+
if (MSVC)
26+
target_compile_options(buffy PRIVATE /W4 /WX)
27+
else ()
28+
target_compile_options(buffy PRIVATE -Wall -Wpedantic -Werror -Wextra -Wvla -Wsign-conversion -Wconversion)
29+
endif ()

0 commit comments

Comments
 (0)