DatabaseCounter.java 417 Bytes
Newer Older
Melledy's avatar
Melledy committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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;
	}
}