package com.red.circle.game.fruit.core.lifecyclev2;

import com.red.circle.game.fruit.core.lifecycle.LifeCycle;
import com.red.circle.game.fruit.core.memory.TimeSecondCounter;

/**
 * 全局阶段.
 *
 * @author pengliang on 2023/12/28
 */
public final class GlobalStage {

  private static final TimeSecondCounter SECOND_COUNTER = new TimeSecondCounter(0);
  private static LifeCycle lifeCycleStage = LifeCycle.START;

  private GlobalStage() {
  }

  public static void setCounterSecond(int second) {
    SECOND_COUNTER.set(second);
  }

  public static int decrementCounter() {
    return SECOND_COUNTER.decrement();
  }

  public static int getCounterSecond() {
    return SECOND_COUNTER.get();
  }

  public static LifeCycle getLifeCycle() {
    return lifeCycleStage;
  }

  public static void setLifeCycle(LifeCycle lifeCycle) {
    lifeCycleStage = lifeCycle;
  }

}
