Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Thomas Corbat
CPPAdvanced
Commits
1bad3b18
Commit
1bad3b18
authored
Apr 25, 2019
by
Hansruedi Patzen
Browse files
connectfour: merge cleanup
parent
ca0c4d35
Changes
5
Hide whitespace changes
Inline
Side-by-side
week10/exercise_solution/w10_solution_03_ConnectFour/.cproject
View file @
1bad3b18
...
...
@@ -321,9 +321,7 @@
<listOptionValue
builtIn=
"false"
value=
""${workspace_loc:/SFML/include}""
/>
<listOptionValue
builtIn=
"false"
value=
""${workspace_loc:/ConnectFourGui/include}""
/>
<listOptionValue
builtIn=
"false"
value=
""C:\Program Files\MinGW\include""
/>
<listOptionValue
builtIn=
"false"
value=
""${workspace_loc:/w10_solution_03_ConnectFour/include}""
/>
</option>
...
...
@@ -357,9 +355,7 @@
<listOptionValue
builtIn=
"false"
value=
""${workspace_loc:/SFML/include}""
/>
<listOptionValue
builtIn=
"false"
value=
""${workspace_loc:/ConnectFourGui/include}""
/>
<listOptionValue
builtIn=
"false"
value=
""C:\Program Files\MinGW\include""
/>
<listOptionValue
builtIn=
"false"
value=
""${workspace_loc:/w10_solution_03_ConnectFour/include}""
/>
</option>
...
...
@@ -421,9 +417,7 @@
<listOptionValue
builtIn=
"false"
value=
""${workspace_loc:/SFML/include}""
/>
<listOptionValue
builtIn=
"false"
value=
""${workspace_loc:/ConnectFourGui/include}""
/>
<listOptionValue
builtIn=
"false"
value=
""C:\Program Files\MinGW\include""
/>
<listOptionValue
builtIn=
"false"
value=
""${workspace_loc:/w10_solution_03_ConnectFour/include}""
/>
</option>
...
...
week10/exercise_solution/ConnectFour
Gui
/game/GameCommand.hpp
→
week10/exercise_solution/
w10_solution_03_
ConnectFour/game/GameCommand.hpp
View file @
1bad3b18
File moved
week10/exercise_solution/w10_solution_03_ConnectFour/peer/GameCommand.hpp
deleted
100644 → 0
View file @
ca0c4d35
#ifndef GAMECOMMAND_HPP_
#define GAMECOMMAND_HPP_
#include "Board.h"
#include "asio/buffer.hpp"
#include <array>
#include <charconv>
#include <cmath>
#include <limits>
#include <iterator>
struct
GameCommand
{
constexpr
static
int
dataSize
{
static_cast
<
int
>
(
std
::
log10
(
std
::
numeric_limits
<
Column
::
value_type
>::
max
()))
+
2
};
using
dataType
=
std
::
array
<
char
,
dataSize
>
;
GameCommand
()
=
default
;
explicit
GameCommand
(
Column
column
)
:
data
{
}
{
std
::
to_chars
(
std
::
begin
(
data
),
std
::
end
(
data
),
column
.
value
);
}
Column
decode
()
const
{
int
value
{
};
std
::
from_chars
(
std
::
begin
(
data
),
std
::
end
(
data
),
value
);
return
Column
{
value
};
}
auto
asBuffer
()
{
return
asio
::
buffer
(
data
.
begin
(),
dataSize
);
}
private:
dataType
data
{
};
};
#endif
/* GAMECOMMAND_HPP_ */
week10/exercise_solution/ConnectFour
Gui
/state/GameState.hpp
→
week10/exercise_solution/
w10_solution_03_
ConnectFour/state/GameState.hpp
View file @
1bad3b18
File moved
week10/exercise_solution/ConnectFour
Gui
/state/PeerState.hpp
→
week10/exercise_solution/
w10_solution_03_
ConnectFour/state/PeerState.hpp
View file @
1bad3b18
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment