malikhollins / HungerGamesSimulator

A hunger games simulator built using the .net blazor framework
0 stars 1 forks source link

Lock in IActor interface design #21

Closed malikhollins closed 12 months ago

malikhollins commented 1 year ago

Need to really lock in the IActor design, and avoid making changes to it, so that others have an easier time understanding it.

malikhollins commented 1 year ago

Required Properties,

Mutable

Read-only after creation

malikhollins commented 1 year ago

Functions,

// get the next state of the actor, needed but maybe rename (GetNextInput?) public ActorStates GetNewState();

// calculates a direction the user is going to move, could be based on other factors of the class it inherits? public CoordA AttemptMove();

// simulate a hit upon another actor, some actors might have special hitting methods public bool AttemptHit( IActor actor );

// simualte an escape with another actor, I think this is fine public bool AttemptEscape( IActor actor );

// take damage, also fine public void TakeDamage( int damage );

// quick bools for lookups public bool IsDead(); public bool IsInParty();

Removing in favor of c# properties,

public void SetLocation( Coord location ); public void GiveWeapon( IWeapon weapon );

malikhollins commented 1 year ago

Required Properties,

Mutable

  • PartyId
  • Location
  • Health
  • Weapon

Read-only after creation

  • Name
  • ActorId
  • Speed
  • ArmourClass
  • Charisma
  • Wisdom (no design idea yet)
  • Strength
  • Dexterity
  • Intelligence (no design idea yet)

Could be worth moving D&D stats into its own container

malikhollins commented 1 year ago

Functions,

// get the next state of the actor, needed but maybe rename (GetNextInput?) public ActorStates GetNewState();

// calculates a direction the user is going to move, could be based on other factors of the class it inherits? public CoordA AttemptMove();

Both these functions/actor actions could rely on information from the simulation class itself. Do we want tributes to have direct access to the simulation?

malikhollins commented 1 year ago

Might be better to have the function headers have data to help the actor make decisions.

malikhollins commented 1 year ago

GetNextState( SimulationSnapshot )

...Move( SimulationSnapshot )