Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
a13725b1
Commit
a13725b1
authored
Jul 24, 2022
by
KingRainbow44
Browse files
Add a `Location` class (Scene + Position)
parent
7397c7f3
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/utils/Location.java
0 → 100644
View file @
a13725b1
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
());
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment