Tag Info

New answers tagged

0

I'd use a simple base class. That allows you to write commands like this (You didn't specify a language so I'll write something C#-like, using some concepts from Unity): abstract class Command { abstract string Description {get;} //Maybe you want all commands to have a description in your UI abstract string Name {get;}//This is also for the UI. ...


1

There are not so many combinations when you write them all down. We just have a bunch of overloaded methods alike: CmdArmy(cmdType) CmdArmy(cmdType, Unit) CmdArmy(cmdType, Coord) CmdArmy(cmdType, Param) CmdArmy(cmdType, Coord, Param) Where cmdType is a key alike: ctAttack, ctMove, ctStop, ctAbility, ctEtc ... It's not OOP, but it's going along the ...



Top 50 recent answers are included