Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game #11

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Game #11

wants to merge 10 commits into from

Conversation

artemiipatov
Copy link
Owner

No description provided.

@@ -0,0 +1,29 @@
namespace ConsoleWrapper;

public class ConsoleWrapper : IConsoleWrapper

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Надо ещё комментарии

Comment on lines 5 to 8
public void WriteLine(string data)
{
Console.WriteLine(data);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public void WriteLine(string data)
{
Console.WriteLine(data);
}
public void WriteLine(string data)
=> Console.WriteLine(data);

Делегация же.

@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

И это не должно быть отдельным проектом :)

/// <summary>
/// Starts the event loop
/// </summary>
/// <exception cref="ArgumentOutOfRangeException"></exception>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Комментарии ко всему классу и его public event-ам нужны, а пустые тэги — нет

Position = (Position.Item1, Position.Item2 + 1);
console.SetCursorPosition(Position.Item1, Position.Item2);
WriteAtSign();
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Копипаст. Можно реализовать логику один раз, просто передавать ей разное изменение позиции

using Game;
using IConsoleWrapper = ConsoleWrapper.IConsoleWrapper;

IConsoleWrapper console = new ConsoleWrapper.ConsoleWrapper();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
IConsoleWrapper console = new ConsoleWrapper.ConsoleWrapper();
var console = new ConsoleWrapper.ConsoleWrapper();

Вам тут не важно, что это именно интерфейс, он при вызове Game.Game(console) сам скастается

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants