using Sprint3_actual.Collision_Detection; namespace Sprint3_actual.StateFiles { public class LinkStateUpIdle : ILinkState // put this in a separate file { private Link link; public LinkStateUpIdle(Link link) { this.link = link; link.linkSprite = new LinkSpriteUpIdle(link); } public void Update() { //NO-OP //Variables in idle state does not need to update } public void MoveLeft() { link.state = new LinkStateLeftMoving(link); //set link's state to the moving left state, which has different updating instructions for the sprite //and different implementations of the functions, as what needs to happen in that state is differnet than this one } public void TakeDamage(ICollision side) { link.game.Player = new DamagedLink(link, side); //TO-DO: How does game get in here? Is there any alternative to passing game? } public void MoveRight() { link.state = new LinkStateRightMoving(link); } public void MoveUp() { link.state = new LinkStateUpMoving(link); } public void MoveDown() { link.state = new LinkStateDownMoving(link); } public void Idle() { //NO-OP //Link is already stopped } public void Attack() { link.state = new LinkStateUpAttack(link); } public void UseItem() { link.state = new LinkStateUpUseItem(link); //should item type be made here? if not, we need to make a Use____() for each item and state for each item link could use. May be more practical to do the latter } } }