Skip to content

Commit

Permalink
more ext improvements
Browse files Browse the repository at this point in the history
add NPC,withID
add NPC.withName
add Projectile.withID
add Scene.projectilesWithID

use HashSet instead of ArrayList to prevent objects bigger than 1x1 from being in the Scene.objects list twice. it also improves performance.
  • Loading branch information
zeruth committed Jan 29, 2024
1 parent ebb2cb0 commit a639901
Show file tree
Hide file tree
Showing 7 changed files with 280 additions and 253 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,56 +22,46 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.api;

import javax.annotation.Nullable;
package net.runelite.api

/**
* Represents a non-player character in the game.
*/
public interface NPC extends Actor
{
/**
* Gets the ID of the NPC.
*
* @return the ID of the NPC
* @see NpcID
*/
int getId();

@Override
String getName();

@Override
int getCombatLevel();

/**
* Gets the index position of this NPC in the clients cached
* NPC array.
*
* @return the NPC index
* @see Client#getCachedNPCs()
*/
int getIndex();
interface NPC : Actor {
/**
* Gets the ID of the NPC.
*
* @return the ID of the NPC
* @see NpcID
*/
val id: Int
override fun getName(): String?
override fun getCombatLevel(): Int

/**
* Gets the composition of this NPC.
*
* @return the composition
*/
NPCComposition getComposition();
/**
* Gets the index position of this NPC in the clients cached
* NPC array.
*
* @return the NPC index
* @see Client.getCachedNPCs
*/
val index: Int

/**
* Get the composition for this NPC and transform it if required
*
* @return the transformed NPC
*/
@Nullable
NPCComposition getTransformedComposition();
/**
* Gets the composition of this NPC.
*
* @return the composition
*/
val composition: NPCComposition

@Nullable
NpcOverrides getModelOverrides();
/**
* Get the composition for this NPC and transform it if required
*
* @return the transformed NPC
*/
val transformedComposition: NPCComposition?
val modelOverrides: NpcOverrides?
val chatheadOverrides: NpcOverrides?

@Nullable
NpcOverrides getChatheadOverrides();
companion object
}
202 changes: 0 additions & 202 deletions runelite-api/src/main/java/net/runelite/api/Projectile.java

This file was deleted.

Loading

0 comments on commit a639901

Please sign in to comment.