Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CSharp 2020 Fall
Course Materials
Commits
5dfd4299
Commit
5dfd4299
authored
Oct 09, 2020
by
Andres Käver
Browse files
slides
parent
7c4d0c94
Changes
5
Hide whitespace changes
Inline
Side-by-side
demos/Demo01/ConsoleApp/Program.cs
View file @
5dfd4299
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics.CodeAnalysis
;
using
System.Runtime.CompilerServices
;
using
GameBrain
;
using
GameConsoleUI
;
...
...
@@ -77,4 +79,33 @@ namespace ConsoleApp
return
(
x
,
y
);
}
}
public
class
Person
{
[
AllowNull
]
public
string
ScreenName
{
get
=>
_screenName
;
set
=>
_screenName
=
value
??
GenerateRandomScreenName
();
}
private
string
_screenName
=
GenerateRandomScreenName
();
[
DisallowNull
]
public
string
?
ReviewComment
{
get
=>
_comment
;
set
=>
_comment
=
value
??
throw
new
ArgumentNullException
(
nameof
(
value
),
"Cannot set to null"
);
}
string
?
_comment
;
[
return
:
MaybeNull
]
public
T
Find
<
T
>(
IEnumerable
<
T
>
sequence
,
Func
<
T
,
bool
>
predicate
)
{
}
public
void
EnsureCapacity
<
T
>([
NotNull
]
ref
T
[]?
storage
,
int
size
)
{
}
}
}
\ No newline at end of file
demos/Demo01/Directory.Build.props
View file @
5dfd4299
...
...
@@ -2,5 +2,6 @@
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<WarningsAsErrors>CS8600;CS8602;CS8603;CS8613;CS8618;CS8625</WarningsAsErrors>
</PropertyGroup>
</Project>
hw/HOMEWORK.md
View file @
5dfd4299
...
...
@@ -16,7 +16,6 @@ Do not allow user to specify user choices that are already taken (including the
And think out more fancy functionalities to implement:
min & max lengths, keyboard based navigation, colors, no duplicate items, default user choice, etc.
## HW02
***Deadline: 2020-10-14 23:59:59**
*
...
...
@@ -25,7 +24,6 @@ Implement basic battleship game boards, allow 2 players to place bombs on them (
Its not mandatory to save ship settings, or even figure out how to keep track of ships. So just board and bombs.
=============================
Battleship initial description
...
...
slides/C# - 04 - Json.pptx
View file @
5dfd4299
No preview for this file type
slides/C# - 05 - Nullable Ref.pptx
0 → 100644
View file @
5dfd4299
File added
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