mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 00:38:21 +00:00
Move Position destructuring functions to their own object
This commit is contained in:
@@ -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