-
Notifications
You must be signed in to change notification settings - Fork 31
addProfile() #126
Comments
might be better idea for composition as following levels : {
5: ['something'],
6: '+10',
15: '+17',
20 : [ 'something']
}
will resulting in
levels : {
1: ['default'],
2: ['default'],
3: ['default'],
4: ['default'],
// +10,
5 : ['something'],
6 : ['something'],
7 : ['something'],
8 : ['something'],
9 : ['something'],
10 : ['something'],
// default
11 : ['default again 11'],
12 : ['default again 12'],
13: ['default again 13'],
14: ['default again 14'],
// 15: + 17
15: ['default 15'],
16: ['default 15'],
17: ['default 15'],
// back to defaults
18: ['default 18'],
19: ['default 19'],
//special no +
20 : [ 'something'],
//default
21 : [ 'default'],
22 : [ 'default'],
23: [ 'default'],
24 : [ 'default'],
25 : [ 'default'],
} Tell me what you think. Assign to me pls after |
Few questions:
I like the idea of using the empty line. So perhaps we can combine all of it and have:
And result will be (before extend default):
So we have '+' extend until there is defined level (with tasks), The line that will be replicated will always the one before the sign ('+' , '+n' , n) If there are other suggestions people (those that around), please post. |
I'm still unsure why we need any of the levels : {
5: ['something 5'],
8: null,
9: null,
10: ['something 10'],
15: ['something 15'],
19: null,
20: ['something 20']
} Will be expanded to: levels : {
1: ['default 1'],
2: ['default 2'],
3: ['default 3'],
4: ['default 4'],
5: ['something 5'],
6: ['something 5'],
7: ['something 5'],
8: ['default 8'],
9: ['default 9'],
10: ['something 10'],
11: ['something 10'],
12: ['something 10'],
13: ['something 10'],
14: ['something 10'],
15: ['something 15'],
16: ['something 15'],
17: ['something 15'],
18: ['something 15'],
19: ['default 19'],
20: ['something 20']
} In any case, what if I just want to prepend a task for 15-20 professions? Can we have something like: prepend: true,
levels : {
15: ['something 15'],
19: null,
20: ['something 20']
} Becomes: prepend: true,
levels : {
// ... tasks from default 1-14
15: [/* default 15 tasks added here */, 'something 15'],
16: [/* default 16 tasks added here */, 'something 15'],
17: [/* default 17 tasks added here */, 'something 15'],
18: [/* default 18 tasks added here */, 'something 15'],
19: ['default 19'],
20: [/* default 20 tasks added here */, 'something 20']
} |
This can also work, it depends what we choose as default behavior, in the first examples the default is not to duplicate lines, so you need a special marker to duplicate. About prepend, I'm inclined against profile flags, this are more like preprocessing directives and affect how addProfile works, IMO they shouldn't stay in the profile. If we default to duplicate the lines we can use the + at the end of the level to prepend. It will be clear what it does and removed in the process. so we get 3 'passes', duplicate, prepend, extend. |
@noonereally I like that idea more than mine. Adding For simplicity's sake - I'm inclided to vote on duplicating lines if necessary. And a way to minimize memory footprint you may ask? Load in memory only professions (and their profiles) that are in use. For example if I have all my characters doing only Leadership - load only that profession with it's profiles. If you happen to decide on this you can avoid duplicating lines as you can fetch lines not-defined-in-that-profile from the parent's profile. I'm not really sure if that was clear enough so if it wasn't ask me to clearify. |
Ok, we can use the + just to insert the base profile tasks into that place in the array, put it at the beginning and it's prepend, at the end and it's append, or anyware and it will put it there. Easy to implement to. "For simplicity's sake - I'm inclided to vote on duplicating lines if necessary. " About memory, I don't think it's an issue, to interpret the script it's loaded fully anyway, and it's 290k in whole with spaces and comments. It can even fit in 640k ;) |
this one is wrong in my explanation should be line before as in 6. Agree with your suggestion. This is what i was thinking about as well.
@noonereally do you want to implement it yourself? Just make sure not to mix
|
Was just 'thinking aloud', I'll leave the implementation to you if you are willing. I think the append with the '+' in the level is closed.
Will become
(And the '+' will be removed if there is nothing to insert or no base) Remains to decide if we want to have default duplication of lines:
or use markers to duplicate, like the I think that for now we have only the gathering profiles that are duplicated, in most cases the base extend/override is the more important part and we don't duplicate.
So default duplication shouldn't affect it. |
After looking again at the profiles, we have a lot of gathering and alchemy that can benefit from replication and all the base override is at the high level and come in blocks. |
Here is a plunker to play http://plnkr.co/edit/DwXElakY47SdvIhusxF0?p=preview One thing to note and document For 1st level for situation when
s1 . for 1 I m gonna just put empty list for lvl > 1
|
Looks good to me. Just small question (it's from the old code)
if |
should be string. I don't think so. Will check actually |
I thought it's a string only, but
so I thought to ask. |
when into release. @Phr33d0m close please as done |
To continue noonereally#19
And #122
I think now that the best option is to use '+' from @WloBeb suggestion or a number as a last (or maybe first will be better) member of a level array to denote if it should be replicated, when '+' will replicate until met with a defined level.
And a number can denote until what level to replicate, for example:
Will result in:
Then extending it over default will end like:
The text was updated successfully, but these errors were encountered: