Resolver- each command is a different type with different dependencies) which defies the Open/Closed principle- you have to modify the mapping, likely a long awkward switch statement, rather than simply extending the functionality with a new Command & CommandResolver. 
Now I'm scrapping the resolver and considering one of two possibilities: a) Expose from Game a CommandFactory that can be used to generate commands, prehaps with a syntax like game.GetCommandFor(entity).Move(target). The commands then have access to gamestate and resolve themselves. b) Commands are constructed by clients, but before being resolved an Initialise(IUnityContainer) method is called that gives the Command access to gamestate. This way it only gains access to gamestate once the command is ready to be issued. Of course, the client could still technically hold onto the command and call it at a later date.
Any thoughts on what the best solution is? My primary concerns are easy extensibility while ensuring the integrity of Game's internal state.

A:

It is not possible to create a perfectly safe solution here. Either you abstract over the commands and thus sacrifice flexibility, or allow more flexibility but loosen up the encapsulation of your game state.
The question here is whether the command objects can be trusted to not corrupt the game state. If you can't trust them, using a command factory that effectively whitelists a few known-good commands may be desirable. The factory methods can perform validation to reject illegal commands.
But most of the time, you can trust your own code. Sacrificing a bit of encapsulation in order to get things done is fine. For example, we might have a design like this:
interface IGameCommand
{
  void Resolve(GameState game);
}

Then in Game.Tick():
foreach (var command in commands)
{
  command.Resolve(state);
 ...
}

This does require that your game state exposes the necessary operations and services. This game state object doesn't have to be the same as your Game's ordinary public interface – it can be a separate class. This might be helpful to avoid accidentally calling methods on the game directly instead of queuing a command for later. Technically this could be used to keep a reference beyond the lifetime of the command, but if all of this is your code then simply don't do that.
For a multiplayer game, think
Resolver- each command is a different type with different colony) which defy the Open / Closed principle- you have to modify the mapping, probably a long awkward switch statement, preferably than simply extending the functionality with a fresh Command & CommandResolver. 
 Now I'm scrapping the resolver and consider one of two possibilities: a) Expose from Game a CommandFactory that can be used to generate commands, prehaps with a syntax like game. GetCommandFor(entity).Move(target). The commands then suffer access to gamestate and resolve themselves. b) Commands are construct by clients, but before being resolved an Initialise(IUnityContainer) method is called that pass the Command access to gamestate. This way it only gains access to gamestate once the instruction is ready to be issued. Of course, the client could still technically hold onto the instruction and name it at a later date. 
 Any thoughts on what the best solution is? My primary concerns are easy extensibility while ensuring the integrity of Game's internal state. 

 A: 

 It is not potential to make a perfectly dependable solution here. Either you pilfer over the commands and thus sacrifice flexibility, or permit more tractability but loosen up the encapsulation of your game state. 
 The doubt here is whether the command objects can be trusted to not corrupt the game state. If you can't trust them, using a command factory that effectively whitelists a few known - effective commands may be desirable. The factory method can perform validation to reject illegal commands. 
 But most of the time, you can entrust your own code. Sacrificing a bit of encapsulation in order to draw thing done is fine. For exercise, we might have a purpose like this: 
 interface IGameCommand 
 { 
   void Resolve(GameState game); 
 } 

 Then in Game. Tick (): 
 foreach (var command in command) 
 { 
   command. Resolve(state); 
 ... 
 } 

 This does necessitate that your game state of matter exposes the necessary operation and services. This game state object doesn't have to be the like as your Game's ordinary public interface – it can be a separate class. This might be helpful to keep off accidentally calling methods on the game directly alternatively of queuing a command for by and by. Technically this could be used to keep a reference book beyond the lifetime of the command, but if all of this is your code then simply don't dress that. 
 For a multiplayer game, think
Resllver- each command is a aifferent type cuth dihferent dependevcies) which defies the Open/Cpowed peinciple- you have to mudify the mapping, liktly a long awkwarv switch statejcnt, rctier than simply extending the functionanigy with a new Command & CommandResolvew. 
Now I'k dcrapping the tesolnew ans considering one of two possibilifies: a) Txpose from Game a CommandFactory that can bf usfd to generate comlands, prehaka wyrh a syntax uike game.GttEommandFor(ehtity).Move(target). The commands thdn hare access ti tamfvtate and rxsolve themselves. n) Commatds are constructed bn clixnts, but before being resmlved an Initialisg(IUnityCondanner) method is called tyat ghves the Xomoans eccsss to gajestate. Thjs way it obly gains access to gwnestate once fhe coimwnd is ready to be issued. Of course, the cljent could still technixally hold onto the clmmand anq call it at a later date.
Any thoughts on what the best rolbblon kw? Ly primary concerns are easy extensibility whyme eksuring the intenrity of Game's intrrjak state.

A:

It is vot possigle to create a pegfectly safe solution herr. Either you abstract over rhe commands qnd thus sacrifice flexibilitv, or aklow kore flexibility but lousen up the encwpsulatioh of your game stxte.
Nhe xuestion here is whether tre commanv objzcts can be jrusted to not cogrupt the game state. If jou ccn't tsust them, ksing a command factory that efhxctively whitglivts a few kuown-gopd commands mwy be desirablg. The faccory mdthods can perfork validatiog to reject inpegal commanvs.
But mose of the time, yuj can trust yoir own cobt. Sacrificung a bit of encapxulxfion in order ti gtt things done ix fkne. Flr evdmple, we migvt hxve s deskgn likt tmis:
kntetface IGameCommand
{
  eoid Resolve(GameState baie);
}

Then ib Game.Tisk():
foreach (var command in commanfs)
{
  cmmmend.Resplvg(state);
 ...
}

This does require that ykur game dtabe exposes thq negesswry operatnons and services. This game state object doesn't have to bg the same as your Gakt's ordinary pnblic ynterface – it can be a separare class. This migmt be helpful to avoid accidantalpy calling methods on the game directly instead of queuing a command for oater. Veshnically tgis vould bz uxed to kee' e reference beyonc the lifetime of the command, bnt if all mf this is your code then simpky don't do that.
Wor a multiplayer game, tgink
Resolver- each command is a different type dependencies) defies the principle- you have a awkward switch statement, than simply extending functionality with a new Command & Now I'm scrapping the resolver and considering one of two possibilities: a) Expose Game a CommandFactory that can be used to generate commands, prehaps with a like The then access to gamestate and resolve themselves. b) Commands are constructed by clients, but before being resolved Initialise(IUnityContainer) method is called that gives the Command to gamestate. This way only gains access to gamestate the is ready be Of the client could technically hold onto the command and call it at a later date. Any thoughts on what the solution is? concerns are extensibility ensuring integrity of Game's A: It is not possible to safe solution here. Either you abstract over the and thus flexibility, or allow more flexibility but up the encapsulation of your game state. The here is whether the command objects can be trusted to not corrupt the game state. can't trust them, using command factory that whitelists few commands be desirable. factory methods can perform validation to reject illegal commands. But most the time, you can trust your own code. Sacrificing a encapsulation order to get done is fine. For we have a design like IGameCommand void Then Game.Tick(): (var command in commands) command.Resolve(state); ... } This does that your game state services. This game state object doesn't have to the same as your Game's ordinary public – it can be a separate class. This might be helpful to accidentally calling the game directly instead of queuing a command later. Technically this could used to keep a reference beyond the lifetime of command, if all this is your then simply don't that. For a think
Resolver- each command is a difFerent type With dIffEreNt DepeNdenCies) which defieS The OPen/Closed principle- you hAve to MoDIfy tHE mAppinG, likely A LoNG AwkWaRd SwiTcH StAtemeNt, rAther thAn simply exTenDiNg the functioNAlIty with a neW CoMmand & CommandresOlver. 
NOw i'm sCRappiNg tHe resOlver aND consiDering one Of TWo possIBilitieS: A) exPose From Game a CommandFACtORy that can be useD to genErATe COMmaNds, Prehaps witH a SyntaX Like gamE.geTcOMmaNDFor(entity).MovE(target). The cOMmaNds theN hAve ACcess tO gameStATe aNd resolve thEmseLves. b) CommAnds arE ConstruCTed by clIents, bUt bEfoRe beINg ReSolVeD An INItIalISe(IunityConTaInEr) metHod iS CALLed tHat GiveS the COmmand access tO gaMestATe. THis waY it onLy gaInS acceSs to gaMestaTe Once the command iS reaDy to be issUed. of CouRsE, the cLIent coUld StiLl technIcally hOLd oNtO THE cOmmand and call it at a LaTER dAte.
Any thOughts ON wHaT The best sOlUtiOn is? mY PrimaRy coNCeRns are eaSy exteNSiBiLity whiLe EnsuriNg The IntEgritY Of GaMe's intErnal staTe.

A:

It IS not possible to CReate a perfectLY sAFE sOLutiOn hEre. Either yoU absTRact Over THe ComMAnds aNd thuS sACrIFice flexibility, or alLoW more fLexibIlity but looseN up the encaPSULation of Your GAmE State.
The questiOn herE is whether THe commanD objeCts can be Trusted to NOT corrupt The GamE stAte. iF YoU can't trust theM, USing A cOmmand fActOry that EffEctIveLy wHiTelists a fEw known-gOoD cOmMaNds May be DEsirable. thE faCtOry MethoDS can peRform ValiDaTiON to Reject iLLeGAL comMaNdS.
But MosT oF the tIme, yOU caN trust yOur own codE. SaCRifiCiNg A bit of eNcapsulation iN oRder to get tHiNgs Done is FINe. For exaMple, we might have a design lIKe this:
iNteRface iGamECommand
{
  vOid resolvE(GaMEState Game);
}

ThEn in GAmE.TiCK():
ForeaCH (VaR coMmAnd in commaNDS)
{
  coMmand.reSolvE(state);
 ...
}

THis does require that YOur Game state expoSes The nECEsSarY OpERatIoNS anD SErvices. This game State objecT dOEsN't have to be THe sAmE as your game's orDinarY Public iNterface – iT can be a sePaRate CLAss. this might bE helpful To avoid acCIdentALlY callIng MethodS oN thE game DirectLY inStead Of queuInG a commAnd foR lAter. TechNically this could be used tO keep a ReferEncE beyond thE liFEtiMe of the coMmanD, but if all oF thIs iS your CodE Then sImplY DoN't dO That.
FOr a mULtiplayer GAmE, thINK
Resolver- each command isa differen t typ e w ith  d iffe rent  dependencies) whic h defies the Open/Clos ed pr in c iple -  y ou ha ve to m o di f y  th ema ppi ng ,  l ikely  along aw kward swit chst atement, rat h er  than simp lyextending th e f unctio na lit y  with  anew C ommand & Comm andResolv er .  
NowI 'm scra p p in g th e resolver and co n si d ering one of t wo pos si b il i t ies : a ) Expose f ro m Gam e  a Comm a nd F a c tor y  that can beused to gen e rat e comm an ds, prehap s wit ha  sy ntax like g ame. GetComman dFor(e n tity).M o ve(targ et). T hecom mand s  t he n h av e  ac c es s t o  ga mestatean dresol ve t h e m s elve s.b) C omman ds are constr uct ed b y  cl ients , but  bef or e bei ng res olved  a n Initialise(IU nity Container ) m et hod  i s cal l ed tha t g ive s the C ommanda cce ss t o  g amestate. This way  i t on ly gains  acces s  t og amestate  o nce  the c omman d is re ady to b e issu e d.  O f cours e,  the c li ent  co uld s t illtechni cally ho ld on t o the commanda nd call it at al a te r  dat e.Any thought s on what  the be sts oluti on is ?M yp rimary concerns are  e asy ex tensi bility whileensuring t h e integrit y of Ga m e's internal s tate. 

A:

It i s  not pos sible  to crea te a perf e c tly safe  so lut ion  he r e .Either you ab s t ract  o ver the  co mmandsand  th ussac ri fice flex ibility,  o ral lo w m ore f l exibilit ybut  l oos en up the en capsu lati on  o f  yo ur game st a t e.
T he  q uest ion  h ere i s wh e the r the c ommand ob jec t s ca nbe  truste d to not corr up t the game  s tat e. Ify o u can'ttrust them, using a com m and fac tor y tha t ef fectively  wh itelis tsa  few k nown-g ood c om man d s  mayb e  d esi ra ble. The f a c tor y met ho ds c an perf orm validation tor eje ct illegal co mma nds. B ut  mo s to f t he tim e ,  you can trustyour own c od e .Sacrificin g  abi t of en capsula tioni n order  to get t hings don eis f i n e.For exampl e, we mi ght havea  desi g nlikethi s:
int er fac e IGa meComm a nd{
  v oid Re so lve(Ga meSta te  game);}

Then in Game.Tick(): 
forea ch (v arcommand i n c o mma nds)
{
 comm and.Resolv e(s tat e);
... }

Th is d o es  re q uirethat your game st ate e xp oses the ne c e s sar y ope rat i ons an d se rvices. This game state object d oesn ' t  ha vet o be  t he same as you r G am e ' s ordina ry  public int erface –  i t  canbe a s eparat e class . Th i s migh t be  he lpful toavo id acciden ta ll y  calli ng m et hods o n theg amed i rectly instead o f que u i ng ac omm and f or  later. Tech nically th is could be  usedto k eep a  refere nc e beyo ndth e lifetime of the co mmand , but i fallofthis i s yo u r  code  the nsim ply don't d ot ha t. For  a m ultip la yergame, thi n k
Resolver- each_command is_a different type with_different dependencies)_which_defies the_Open/Closed_principle- you have_to modify the_mapping, likely a long_awkward switch statement,_rather_than simply extending the functionality with a new Command & CommandResolver. 
Now I'm scrapping_the_resolver and_considering_one_of two possibilities: a) Expose_from Game a CommandFactory that_can be_used to generate commands, prehaps with a syntax_like_game.GetCommandFor(entity).Move(target). The commands_then have access to gamestate and resolve themselves. b)_Commands are constructed by clients, but_before being resolved_an_Initialise(IUnityContainer)_method is called that_gives the Command access to gamestate._This way it only gains access_to gamestate once the command is ready_to be issued. Of course, the_client could still technically hold_onto the_command and call it at_a later date.
Any_thoughts on_what the best_solution is? My primary concerns are_easy extensibility while_ensuring the integrity of Game's internal_state.

A:

It_is not possible_to_create_a perfectly_safe solution here._Either_you abstract_over_the commands and thus sacrifice flexibility,_or_allow more flexibility but loosen up the_encapsulation of your game_state.
The_question here is whether_the command objects can be_trusted to not corrupt the game_state. If_you can't_trust them, using a command factory that effectively whitelists a few_known-good commands may be desirable. The_factory methods can perform_validation to_reject_illegal commands.
But most_of_the time,_you can trust your own code. Sacrificing_a bit_of encapsulation in order to get_things done is fine._For_example, we might have a design_like this:
interface IGameCommand
{
  void Resolve(GameState_game);
}

Then in Game.Tick():
foreach (var command_in_commands)
{
_ command.Resolve(state);
 ...
}

This does require_that your game state exposes the_necessary operations and_services. This game state object doesn't have_to_be the same as your Game's_ordinary_public interface – it can be_a_separate_class. This might be helpful_to avoid accidentally calling methods on_the game directly instead of queuing a command for_later. Technically this_could be used to keep_a_reference_beyond the lifetime of the command, but if all of_this is_your code then_simply don't do that.
For a multiplayer game, think