package zustand;

public class Machine {

private AbstractState state;
private int count;

  public Machine() {
    state = new StateEmpty(this);
    count = 0;
  }

  public void set_state(AbstractState s) {
    state = s;
  }

  public void show_state() {
    state.show_state();
  }

  public void abort() {
    state.abort();
  }

  public void finish() {
    state.finish();
  }

  public void add_money(int m) {
    state.add_money(m);
  }

  public void insert_card(Card c) {
    if(state.insert_card(c)) {
      count++;
    }
  }

  public Card get_card() {
    return state.get_card();
  }

  public int money() {
    return state.get_money();
  }
  
}