mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-12-06 03:07:19 +00:00
Move Position destructuring functions to their own object
This commit is contained in:
1 parent
3c26d0acf1
commit
9c4eff712e
3 files changed
+15
-11
No files matched your search
@@ -2,8 +2,11 @@ package org.apollo.game.plugins.api
|
||||
|
||||
import org.apollo.game.model.Position
|
||||
|
||||
// Support destructuring a Position into its components.
|
||||
|
||||
operator fun Position.component1(): Int = x
|
||||
operator fun Position.component2(): Int = y
|
||||
operator fun Position.component3(): Int = height
|
||||
/**
|
||||
* Support destructuring a Position into its components.
|
||||
*/
|
||||
object Position {
|
||||
operator fun Position.component1(): Int = x
|
||||
operator fun Position.component2(): Int = y
|
||||
operator fun Position.component3(): Int = height
|
||||
}
|
||||
@@ -2,9 +2,9 @@ package org.apollo.game.plugins.area
|
||||
|
||||
import org.apollo.game.model.Position
|
||||
import org.apollo.game.model.entity.Player
|
||||
import org.apollo.game.plugins.api.component1
|
||||
import org.apollo.game.plugins.api.component2
|
||||
import org.apollo.game.plugins.api.component3
|
||||
import org.apollo.game.plugins.api.Position.component1
|
||||
import org.apollo.game.plugins.api.Position.component2
|
||||
import org.apollo.game.plugins.api.Position.component3
|
||||
|
||||
/**
|
||||
* An area in the game world.
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
|
||||
import com.google.common.primitives.Ints
|
||||
import org.apollo.game.model.Position
|
||||
import org.apollo.game.model.entity.setting.PrivilegeLevel
|
||||
import org.apollo.game.plugin.util.command.valid_arg_length
|
||||
import org.apollo.game.plugins.api.component1
|
||||
import org.apollo.game.plugins.api.component2
|
||||
import org.apollo.game.plugins.api.component3
|
||||
import org.apollo.game.plugins.api.Position.component1
|
||||
import org.apollo.game.plugins.api.Position.component2
|
||||
import org.apollo.game.plugins.api.Position.component3
|
||||
|
||||
/**
|
||||
* Sends the player's position.
|
||||
|
||||
Reference in new issue
Block a user