Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(6536)

Issue 233370043: ShadPython - 4 - Dmitrii Ivanovskii - student FIVT

Can't Edit
Can't Publish+Mail
Start Review
Created:
8 years, 11 months ago by ivanovskiy.dmitriy
Modified:
8 years, 11 months ago
Reviewers:
shad.python
Visibility:
Public.

Patch Set 1 #

Patch Set 2 : Pep8 remarks #

Total comments: 1

Patch Set 3 : Improve cells inheritance #

Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -64 lines) Patch
M ocean.py View 1 2 7 chunks +65 lines, -64 lines 0 comments Download

Messages

Total messages: 2
ivanovskiy.dmitriy
8 years, 11 months ago (2015-05-12 20:51:18 UTC) #1
shad.python
8 years, 11 months ago (2015-05-21 14:26:09 UTC) #2
Единственный комментарий очень важен.

https://codereview.appspot.com/233370043/diff/20001/ocean.py
File ocean.py (right):

https://codereview.appspot.com/233370043/diff/20001/ocean.py#newcode129
ocean.py:129: if cell.__class__ == Predator:
Вместо того, чтобы проверять это, можно полиморфно вызывать метод типа do() в
классе-наследнике Animal (лучше сделать единую иерархию классов, начиная от
Cell) и передавать туда объект ocean.
Тогда сразу кода в этой функции станет в 5 раз меньше.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b