mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-27 07:32:58 +08:00
24 lines
417 B
Java
24 lines
417 B
Java
|
package emu.grasscutter.database;
|
||
|
|
||
|
import dev.morphia.annotations.Entity;
|
||
|
import dev.morphia.annotations.Id;
|
||
|
|
||
|
@Entity(value = "counters", noClassnameStored = true)
|
||
|
public class DatabaseCounter {
|
||
|
@Id
|
||
|
private String id;
|
||
|
private int count;
|
||
|
|
||
|
public DatabaseCounter() {}
|
||
|
|
||
|
public DatabaseCounter(String id) {
|
||
|
this.id = id;
|
||
|
this.count = 10000;
|
||
|
}
|
||
|
|
||
|
public int getNextId() {
|
||
|
int id = ++count;
|
||
|
return id;
|
||
|
}
|
||
|
}
|