Skip to main content
17 events
when toggle format what by license comment
Aug 27, 2017 at 15:34 vote accept David Tamrazov
Aug 26, 2017 at 14:06 answer added Stingy timeline score: 1
Aug 25, 2017 at 14:37 history edited David Tamrazov CC BY-SA 3.0
Included full code of the composition class
Aug 25, 2017 at 14:33 comment added David Tamrazov @ChrisWue I've added all of the code for the "Composition" class minus the property getters, and included a brief description of the program in my body in a new edit.
Aug 25, 2017 at 14:32 history edited David Tamrazov CC BY-SA 3.0
Included full code of the composition class
Aug 25, 2017 at 4:39 history reopened forsvarir
ChrisWue
t3chb0t
mdfst13
alecxe
Aug 25, 2017 at 3:31 history edited Jamal CC BY-SA 3.0
deleted 46 characters in body
Aug 25, 2017 at 2:52 comment added ChrisWue btw: Adding the code for the composite would be useful since that's where some of the problems stem from
Aug 25, 2017 at 2:52 comment added ChrisWue It's difficult to say what exact role the composition class plays. I'm going to guess it's some sort of "battle group" to which the individual units contribute and the overall battle group properties are based on the individual units within. So one option is to add a updateGroupContribution(Group groupToContributeTo) method to the Role class. Then each role can update the group it's being added to by adding to its properties. Adding a role to the composite class is then as easy as addContribution(Role r) { r.updateGroupContribution(this); }
Aug 24, 2017 at 23:17 review Reopen votes
Aug 25, 2017 at 4:39
Aug 24, 2017 at 23:02 comment added David Tamrazov @t3chb0t noted! I've edited my question to include all of the code relevant to the classes I'm trying to refactor.
Aug 24, 2017 at 23:00 history edited David Tamrazov CC BY-SA 3.0
Fleshed out code to include everything relevant to the abstract and subclasses in question
Aug 24, 2017 at 7:15 history closed mdfst13
alecxe
t3chb0t
ChrisWue
Abbas
Not suitable for this site
Aug 23, 2017 at 19:08 answer added Ralf Kleberhoff timeline score: 3
Aug 23, 2017 at 17:50 comment added t3chb0t How could I make my code well-formed and polymorphic to suit my needs? I suggest posting your complete and real code. We cannot give you advice for code that isn't there.
Aug 23, 2017 at 17:28 review Close votes
Aug 24, 2017 at 7:15
Aug 23, 2017 at 14:33 history asked David Tamrazov CC BY-SA 3.0