Question

In my game, there is are ActionFactory (makes AbstractActions), AbstractAction (actions that could exist), PotentialAction (actions that a being could do, which are assosietted with a specific being) classes. I need a name for a class that reperessents an actual, choosen action which was done by a specific being, has specific targets, and possibly arguments.

Was it helpful?

Solution 3

I went with RealAction, mainly because of API consistency - all actual, specific real-world classes are prefixed with Real (and have an associated Potential class)

OTHER TIPS

Would CompletedAction, FinishedAction, ClosedAction, or PastAction be of any use?

Without more information about the actions and how they work, all I can say is it seems your actions are all the same but have different properties.

How are the actions handled after they're returned from the factory? Are they passed to the being and then run?

Maybe a factory isn't the best option for what you're trying to do and the categorization of the action type is better placed as a property on the class.

My Python is a bit rusty, but something like this:

class action(object):
    executeTime = None
    targets = []
    arguments = []

    def actionType():
        if executeTime = None:
            return "Potential"
        else if executeTime < datetime.now():
            return "Complete"
        else executeTime > datetime.now():
            return "Potential"  
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top