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

CodeWars, Dog class #16

Open
wants to merge 22 commits into
base: Belov_Stepan_Maksimovich
Choose a base branch
from
Open

Conversation

Fuflick
Copy link

@Fuflick Fuflick commented Oct 11, 2023

No description provided.

@@ -0,0 +1,3 @@
#pragma warning disable SA1200
Copy link
Contributor

Choose a reason for hiding this comment

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

а это зачем?

Copy link
Author

Choose a reason for hiding this comment

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

Линтер указывает на ошибку в том, что using директивы расположены неправильно. Считает, что using должен располагаться после пространства имён. Я поправил, докинул в каждый класс с тестами "using Xuint" и удалил этот файл.
На будущее хотел бы спросить, есть ли какой-то более важный плюс у этого global, чем просто везде не указывать, одинаковые using'и?

Comment on lines +14 to +19
public string Name
{
get => _name;

set => _name = value;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Если вы внутри не меняете поведение - то сделайте стандартно

Suggested change
public string Name
{
get => _name;
set => _name = value;
}
public string Name {get; set; }

Comment on lines 21 to 26
public int Age
{
get => _age;

set => _age = value;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

возраст я могу сделать отрицательным?

set => _flock = value;
}

public void PrintInfo()
Copy link
Contributor

Choose a reason for hiding this comment

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

переопределите ToString

Copy link
Author

Choose a reason for hiding this comment

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

параметр flock? или метод PrintInfo?

}
else
{
enemy.Health -= Damage + 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

а вдруг у него иммунитет на данный вид атаки? почему вы вдруг у него без его ведома меняете здоровье?

set => _health = value;
}

#pragma warning disable SA1201
Copy link
Contributor

Choose a reason for hiding this comment

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

вот так себе идея отключать так предупреждения - если не нужны - отключите в конфигурации

Comment on lines +68 to +71
_name = names[_rand.Next(0, 4)];
_health = _rand.Next(10, 100);
_damage = _rand.Next(5, 30);
_spellUsed = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

и как в этом случае тест написать?

Copy link
Author

Choose a reason for hiding this comment

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

Так герои то должны полностью без участия пользователя создаваться и палками друг в друга кидаться. Разве нет?

while (person1._health > 0 || person2._health > 0)
{
person2 = person1.Attack(person2);
Thread.Sleep(1000);
Copy link
Contributor

Choose a reason for hiding this comment

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

это зачем? не его это дело - можете паузу в самой игре добавлять

Dockerfile Outdated
ENTRYPOINT ["dotnet", "CourseApp.dll"]~
Copy link
Contributor

Choose a reason for hiding this comment

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

что за ~

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