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

import java.util.concurrent.atomic.AtomicInteger;

/**
 * 时间计数器.
 *
 * @author pengliang on 2023/12/6
 */
public class TimeSecondCounter {

  private final AtomicInteger count = new AtomicInteger();

  public TimeSecondCounter(int timeSecond) {
    this.count.set(timeSecond);
  }

  public int increment() {
    return count.incrementAndGet();
  }

  public void set(Integer sec) {
    count.set(sec);
  }

  public int decrement() {
    return count.decrementAndGet();
  }

  public int get() {
    return count.get();
  }

}
