public IronElement(Point pos, Logic model) { _model = model; Rect = new Rectangle(0, 0, ElementSize, ElementSize); SetPixelPositon(pos); StandState stand = new StandState(this, Properties.Resources.iron); DestroingState destroing = new DestroingState(this, _model, this); stand.transitions.Add(0, stand); stand.transitions.Add(1, destroing); State = stand; State.Direct = Direction.Right; }
public WallElement(Point pos, Logic model) { _model = model; Rect = new Rectangle(0, 0, ElementSize, ElementSize); SetPixelPositon(pos); StandState stand = new StandState(this, Properties.Resources.wall); FirstDamageState firstDamage = new FirstDamageState(this, stand.Anim); SecondDamageState secondDamage = new SecondDamageState(this, stand.Anim); DestroingState destroing = new DestroingState(this, _model, this); stand.transitions.Add(5, firstDamage); firstDamage.transitions.Add(5, secondDamage); secondDamage.transitions.Add(5, destroing); State = stand; State.Direct = Direction.Right; }