Location.java 924 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package emu.grasscutter.utils;

import dev.morphia.annotations.Entity;
import dev.morphia.annotations.Transient;
import emu.grasscutter.game.world.Scene;
import lombok.Getter;
import lombok.Setter;

@Entity
public class Location extends Position {
    @Transient @Getter @Setter
    private Scene scene;

    public Location(Scene scene, Position position) {
        this.set(position);

        this.scene = scene;
    }

    public Location(Scene scene, float x, float y) {
        this.set(x, y);

        this.scene = scene;
    }

    public Location(Scene scene, float x, float y, float z) {
        this.set(x, y, z);

        this.scene = scene;
    }

    @Override
    public Location clone() {
        return new Location(this.scene, super.clone());
    }

    @Override
    public String toString() {
        return String.format("%s:%s,%s,%s", this.scene.getId(), this.getX(), this.getY(), this.getZ());
    }
}