-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDESIGN.txt
38 lines (22 loc) · 2.07 KB
/
DESIGN.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"Second, in a plain text file (named DESIGN.txt) list each of the methods that was left in the Functions class and give a brief justification for why this method was not moved. You should also list each method that you feel could be reasonably placed in multiple classes and note 1) the class you selected and 2) the reason for that selection. You do not need to add many functions to this file - I will go over which ones you may want to include in class."
getCurrentImage: split between Background and Entity because accessed from both types
load + processLine + processImageLine + parse*: In Functions because world isn't doing the action or has any data needed, the
functions are just reading text to parse into the game world
addEntity + removeEntity + moveEntity: In world instead of entity because it's changing a property in world,
putting in Entity would be confusing whether it was constructing an entity object or adding to world
withinBounds: in Point instead of World because it's checking if the point is in the world
shiftView: has to be static because cannot call non-static function from static VirtualWorld (had to add getters
to reference viewport and world attributes)
getImages + setAlpha: has no reference to any other class methods or data, so just kept in Functions
findNearest + nearestEntity: could be in WorldModel, but in Point because finding nearest entity in the world with respect to the point
clamp: in Functions because static, does not relate directly to any classes
Point attributes left public as interpreted in the project 1.
---------------------------------------------------
Project 2 Changes
Interface for ActiveEntity Entities also has executeActivity method because, although not all actions are activities,
all entities that can schedule actions have some activity behavior (i.e. does not make sense to have entities that can
only schedule actions with no activity).
---------------------------------------------------
Project 3 Changes
Left Action as interface because no data to pull up.
MovableEntity new interface because common no data pulled up.