Remove polymorphic events

This commit is contained in:
Max Weber
2018-11-18 11:36:02 -07:00
committed by Adam
parent 76a964a9d3
commit c503aacd73
7 changed files with 4 additions and 116 deletions

View File

@@ -1,56 +0,0 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (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.events;
import net.runelite.api.Actor;
/**
* Represents the base event where an {@link Actor} has despawned.
* <p>
* To hook into a more focused actor type, see the {@link PlayerDespawned}
* or {@link NpcDespawned} events.
* <p>
* Examples of when this event may trigger include:
* <ul>
* <li>An actor moving out of render distance</li>
* <li>An actor despawning after death</li>
* <li>Moving out of or away from a region with Actor entities in it</li>
* </ul>
* <p>
* During a world change, the event is only called for Players,
* ie. {@link PlayerDespawned} will trigger but {@link NpcDespawned}
* will not.
* <p>
* The client logging out does not trigger this event.
*/
public interface ActorDespawned
{
/**
* Gets the despawned player or NPC.
*
* @return despawned entity
*/
Actor getActor();
}

View File

@@ -1,50 +0,0 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (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.events;
import net.runelite.api.Actor;
/**
* Represents the base event where an {@link Actor} has spawned.
* <p>
* To hook into a more focused actor type, see the {@link PlayerSpawned}
* or {@link NpcSpawned} events.
* <p>
* Examples of when this event may trigger include:
* <ul>
* <li>Entering a new region or area with actors inside</li>
* <li>A player logging in nearby</li>
* <li>An actor moving into render distance</li>
* </ul>
*/
public interface ActorSpawned
{
/**
* Gets the spawned player or NPC.
*
* @return spawned entity
*/
Actor getActor();
}

View File

@@ -32,14 +32,13 @@ import net.runelite.api.NPC;
* An event where an {@link NPC} has despawned.
*/
@Value
public class NpcDespawned implements ActorDespawned
public class NpcDespawned
{
/**
* The despawned NPC.
*/
private final NPC npc;
@Override
public Actor getActor()
{
return npc;

View File

@@ -32,14 +32,13 @@ import net.runelite.api.NPC;
* An event where an {@link NPC} has spawned.
*/
@Value
public class NpcSpawned implements ActorSpawned
public class NpcSpawned
{
/**
* The spawned NPC.
*/
private final NPC npc;
@Override
public Actor getActor()
{
return npc;

View File

@@ -34,14 +34,13 @@ import net.runelite.api.Player;
* Note: This event does not get called for the local player.
*/
@Value
public class PlayerDespawned implements ActorDespawned
public class PlayerDespawned
{
/**
* The despawned player.
*/
private final Player player;
@Override
public Actor getActor()
{
return player;

View File

@@ -32,14 +32,13 @@ import net.runelite.api.Player;
* An event where a {@link Player} has spawned.
*/
@Value
public class PlayerSpawned implements ActorSpawned
public class PlayerSpawned
{
/**
* The spawned player.
*/
private final Player player;
@Override
public Actor getActor()
{
return player;

View File

@@ -32,8 +32,6 @@ import net.runelite.api.coords.LocalPoint;
/**
* Used for getting players in view,deprecated as of existence of Actor spawn events
*
* @see net.runelite.api.events.ActorSpawned
* @see net.runelite.api.events.ActorDespawned
*/
@Deprecated
public abstract class ActorQuery<EntityType extends Actor, QueryType> extends Query<EntityType, QueryType>