Skip to content

Commit

Permalink
update for 0.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
123marvin123 committed May 2, 2015
1 parent e339afc commit 46194f7
Show file tree
Hide file tree
Showing 14 changed files with 599 additions and 78 deletions.
24 changes: 24 additions & 0 deletions src/main/java/net/gtaun/shoebill/SampObjectFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -716,4 +716,28 @@ default Timer createTimer(int interval)
{
return createTimer(interval, Timer.COUNT_INFINITE, null);
}

/**
* Creates a actor with params.
* @param modelid Modelid of the skin
* @param position Where the actor should stand
* @param angle In which angle the actor should stand
* @return The created actor
* @throws CreationFailedException
*/
Actor createActor(int modelid, Vector3D position, float angle) throws CreationFailedException;

/**
* Creates a actor with params
* @param modelid Modelid of the skin
* @param x X-Pos where the actor should stand
* @param y Y-Pos where the actor should stand
* @param z Z-Pos where the actor should stand
* @param angle In which angle the actor should stand
* @return The created actor
* @throws CreationFailedException
*/
default Actor createActor(int modelid, float x, float y, float z, float angle) throws CreationFailedException {
return createActor(modelid, new Vector3D(x, y, z), angle);
}
}
51 changes: 35 additions & 16 deletions src/main/java/net/gtaun/shoebill/SampObjectStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,10 @@

package net.gtaun.shoebill;

import java.util.Collection;

import net.gtaun.shoebill.data.SpawnInfo;
import net.gtaun.shoebill.object.DialogId;
import net.gtaun.shoebill.object.Label;
import net.gtaun.shoebill.object.Menu;
import net.gtaun.shoebill.object.Pickup;
import net.gtaun.shoebill.object.Player;
import net.gtaun.shoebill.object.PlayerLabel;
import net.gtaun.shoebill.object.PlayerObject;
import net.gtaun.shoebill.object.PlayerTextdraw;
import net.gtaun.shoebill.object.SampObject;
import net.gtaun.shoebill.object.Server;
import net.gtaun.shoebill.object.Textdraw;
import net.gtaun.shoebill.object.Vehicle;
import net.gtaun.shoebill.object.World;
import net.gtaun.shoebill.object.Zone;
import net.gtaun.shoebill.object.*;

import java.util.Collection;

/**
* SA-MP object interface, managing all SA-MP objects that exist.
Expand Down Expand Up @@ -269,4 +256,36 @@ public interface SampObjectStore
* @return Collection of PlayerClasses.
*/
Collection<SpawnInfo> getPlayerClasses();

/**
* Get the collection of actors (CreateActor) which exist.
*
* @return Collection of Actors
*/
Collection<Actor> getActors();

/**
* Get the actor with a specific id
* @param id The actor id
* @return Found actor (null is not found)
*/
Actor getActor(int id);

/**
* Gets the pool size of the vehicles.
* @return Vehicle's poolsize
*/
int getVehiclePoolSize();

/**
* Gets the pool size of the players
* @return Player's poolsize
*/
int getPlayerPoolSize();

/**
* Gets the pool size of the actors
* @return Actor's poolsize
*/
int getActorPoolSize();
}
52 changes: 52 additions & 0 deletions src/main/java/net/gtaun/shoebill/data/VehicleState.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package net.gtaun.shoebill.data;

/**
* Created by marvin on 02.05.15 in project shoebill-api.
* Copyright (c) 2015 Marvin Haschker. All rights reserved.
*/
public class VehicleState {

public int driver, passenger, backLeft, backRight;

public VehicleState() {
}

public VehicleState(int driver, int passenger, int backLeft, int backRight) {
this.driver = driver;
this.passenger = passenger;
this.backLeft = backLeft;
this.backRight = backRight;
}

public int getDriver() {
return driver;
}

public void setDriver(int driver) {
this.driver = driver;
}

public int getPassenger() {
return passenger;
}

public void setPassenger(int passenger) {
this.passenger = passenger;
}

public int getBackLeft() {
return backLeft;
}

public void setBackLeft(int backLeft) {
this.backLeft = backLeft;
}

public int getBackRight() {
return backRight;
}

public void setBackRight(int backRight) {
this.backRight = backRight;
}
}
21 changes: 21 additions & 0 deletions src/main/java/net/gtaun/shoebill/event/actor/ActorEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package net.gtaun.shoebill.event.actor;

import net.gtaun.shoebill.object.Actor;
import net.gtaun.util.event.Event;

/**
* Created by marvin on 01.05.15 in project shoebill-api.
* Copyright (c) 2015 Marvin Haschker. All rights reserved.
*/
public abstract class ActorEvent extends Event {

private Actor actor;

public ActorEvent(Actor actor) {
this.actor = actor;
}

public Actor getActor() {
return actor;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package net.gtaun.shoebill.event.actor;

import net.gtaun.shoebill.object.Actor;
import net.gtaun.shoebill.object.Player;

/**
* Created by marvin on 01.05.15 in project shoebill-api.
* Copyright (c) 2015 Marvin Haschker. All rights reserved.
*/
public class ActorStreamInEvent extends ActorEvent {

private Player player;

public ActorStreamInEvent(Actor actor, Player player) {
super(actor);
this.player = player;
}

public Player getPlayer() {
return player;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package net.gtaun.shoebill.event.actor;

import net.gtaun.shoebill.object.Actor;
import net.gtaun.shoebill.object.Player;

/**
* Created by marvin on 01.05.15 in project shoebill-api.
* Copyright (c) 2015 Marvin Haschker. All rights reserved.
*/
public class ActorStreamOutEvent extends ActorEvent {

private Player player;

public ActorStreamOutEvent(Actor actor, Player player) {
super(actor);
this.player = player;
}

public Player getPlayer() {
return player;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package net.gtaun.shoebill.event.player;

import net.gtaun.shoebill.constant.WeaponModel;
import net.gtaun.shoebill.object.Actor;
import net.gtaun.shoebill.object.Player;

/**
* Created by marvin on 01.05.15 in project shoebill-api.
* Copyright (c) 2015 Marvin Haschker. All rights reserved.
*/
public class PlayerDamageActorEvent extends PlayerEvent {

private Actor actor;
private int amount, bodypart;
private WeaponModel weapon;

public PlayerDamageActorEvent(Player player, Actor actor, int amount, WeaponModel weapon, int bodypart) {
super(player);
this.actor = actor;
this.amount = amount;
this.bodypart = bodypart;
this.weapon = weapon;
}

public Actor getActor() {
return actor;
}

public int getAmount() {
return amount;
}

public int getBodypart() {
return bodypart;
}

public WeaponModel getWeapon() {
return weapon;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package net.gtaun.shoebill.event.vehicle;

import net.gtaun.shoebill.object.Player;
import net.gtaun.shoebill.object.Vehicle;

/**
* Created by marvin on 01.05.15 in project shoebill-api.
* Copyright (c) 2015 Marvin Haschker. All rights reserved.
*/
public class VehicleSirenStateChangeEvent extends VehicleEvent {

private Player player;
private boolean newState;

public VehicleSirenStateChangeEvent(Vehicle vehicle, Player player, boolean newState) {
super(vehicle);
this.player = player;
this.newState = newState;
}

public Player getPlayer() {
return player;
}

public boolean getNewState() {
return newState;
}

}
Loading

0 comments on commit 46194f7

Please sign in to comment.