Tuesday, 6 September 2011

Let's throw some UML at that...

So, let's look at how some of that breaks down into classes.

 

Nothing particularly earth shattering there. We have TrainingCamp as a top level class (at least as far as training is concerned) which contains a GirlList which abstracts a list of Girls in training. Eventually TrainingCamp is going to have a bit more to it, since it will need to manage available training equipment, training schedules and the like. But for now, it just keeps a list of girls.

The do_turn method in TrainingCamp executes one turn (which is to say one day) of training. That gets passed down to GirlList, which passes it on to each of the girls in the list. Thinking about it, I think I'll probably change to do_turn to do_shift or do_hour in Girl and GirlList. There are places we'll want to manage simultaneous actions - like two girls competing for the same resource, or sparring, or sex training for that matter. And the PC needs to be in the TrainingCamp as well, thinking about it ... but that can wait.


Anyway...





You'll note I'm not addressing mood state at all here. This is in the interests of starting simple. For now, I'm going to have a default, neutral mood and a single task - sleeping.

Some things to note

Each Action has a resistance. The basic rule is that if Girl.obedience > Action.resistance then the thing gets done. Every time a girl performs an action on demand, there's a chance that her resistance to that action will go down. And if she successfully refuses, it should probably have a chance to go up

I had thought of using the resistance value to model a girl's like or dislike of an action, but that's not going to work. Over time, resistance is going to drop to zero for everything she does, but I'd quite like there still to be things she liked and disliked. I'll need to think about that a bit.

The possible actions are stored in a hash called actions_list. Each girl will probably have the same actions (assuming no mutants, monstergirls or whatever) but they each get their own copy of the action table so we they can have their own resistance value. If the Action object gets too bit we'll need to split it to a global action table, and smaller one containing the girl-specific data. For now we'll just copy it.

Next thing, we'll try some code.

I'll finish this up tomorrow. I'm getting tired and Blogger is giving me a ten second lag on keyboard input at the moment. Ajax for the win.

No comments: