Jump to content
Sign in to follow this  
Fuzenseth

[PI] - Minigame handling - Create better and unique minigames

Recommended Posts

Add new java file called AbstractMinigame.

package server.model.minigames;
[CODE]package server.model.minigames;

import server.model.players.Client;

/**
*
* @author Fuzen Seth
* [MENTION=98951]infor[/MENTION]mation s
*/
public abstract class AbstractMinigame {

/** Returns to the minigame's name.*/
public abstract String getName();
/** Start the minigame. */
public abstract void start(Client client);

/** Force stops the minigame. */
public abstract void forceStop(Client client);

/** Displays the interfaces that are used in the minigame. */
public abstract void displayInterfaces(Client client);

}
[/CODE]


This is a example of the mage arena minigame. It's a simple start.

[CODE]package server.model.minigames.impl;

import server.model.minigames.AbstractMinigame;
import server.model.players.Client;
/**
*
* @author Fuzen Seth
* [MENTION=98951]infor[/MENTION]mation Mage arena minigame.
* [MENTION=3199]Sin[/MENTION]ce 23.8.2014
*/
public class MageArena extends AbstractMinigame {

/** AbstractMinigame is the super class. */
public MageArena() {
super();
}

/** Name of the minigame. */
[MENTION=15855]Over[/MENTION]ride
public String getName() {
return "Mage arena";
}

/** Starts the mage arena minigame. */
[MENTION=15855]Over[/MENTION]ride
public void start(Client client) {

}

/** Force stops the minigame. */
[MENTION=15855]Over[/MENTION]ride
public void forceStop(Client client) {
// TODO Auto-generated method stub

}

/** The minigame's fighting state. */
public enum FightState {
NOT_STARTED, IN_BATTLE, FINISHED;
}

/** This minigame doesn't use any interfaces. */
[MENTION=15855]Over[/MENTION]ride
public void displayInterfaces(Client client) {

}

}
[/CODE]

Share this post


Link to post
Share on other sites
Thanks for the snippet :)

could you help me with my pi? i have a few problems idk how to fix :/

Share this post


Link to post
Share on other sites
[quote name='Max1']Thanks for the snippet :)

could you help me with my pi? i have a few problems idk how to fix :/[/QUOTE]

I wish I could but i'm not a expert with PI frameworks too, i've pretty much converted my own pi to Hyperion.
Project Insanity as a base is very bad decision for me, could of just wrote own framework instead.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×