-
Notifications
You must be signed in to change notification settings - Fork 1
Roguelike #7
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
base: master
Are you sure you want to change the base?
Roguelike #7
Conversation
yurii-litvinov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А ещё по условию требовалось логирование основных событий. А так игра отличная, только код надо привести в порядок.
|
|
||
| class InvalidLabirintException extends Exception {} | ||
|
|
||
| public class Labirint { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Как обычно, нужны ещё комментарии
| List<Drawable> listDraw = new ArrayList<>(); | ||
| List<WithCoordsAndSpeed> listCoord = new ArrayList<>(); | ||
| List<ZombeeBot> listZomb = new ArrayList<>(); | ||
| List<SourceOfLife> listSrc = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
И поля с пакетной видимостью --- это не очень
| } catch (InterruptedException e) { | ||
| } | ||
|
|
||
| //System.out.println("Updating labirint"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Всякую отладочную печать надо убрать, закомментированный код надо уничтожать без жалости
| private List<Drawable> ld; | ||
| private int width, height; | ||
|
|
||
| public Labirint lb; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Паблик-полей вообще быть не должно
| @Override | ||
| public Dimension getPreferredSize() { | ||
| // TODO Auto-generated method stub | ||
| return new Dimension(width*RogueStarter.boxW, height*RogueStarter.boxH); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А бинарные операторы выделяются пробелами
|
|
||
| private static Labirint labirint; | ||
|
|
||
| public static void main( String[] args ) throws IOException, InvalidLabirintException |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут с отступами что-то не так. Табуляции и пробелы смешаны
| } | ||
| } | ||
|
|
||
| class Brick extends WithCoordsAndSpeed implements Drawable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В Java принято по одному классу на файл
| */ | ||
| public void testApp() | ||
| { | ||
| assertTrue( true ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ну как-то да... Надо хоть один нормальный юнит-тест
yurii-litvinov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Хорошо, зачтена
|
|
||
| enum Weapon {Shield, Knife}; | ||
|
|
||
| Weapon weapon = Weapon.Shield; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Поля с пакетной видимостью --- не очень
| @@ -0,0 +1,122 @@ | |||
| package roguelike; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Имена пакетов, кстати, неканоничныЪ
Описание управления в Readme