text
stringlengths
3
1.18M
package deanandjames.sprite; import java.awt.*; import java.awt.image.BufferedImage; public class Brick { private int height; private BufferedImage image; private final int imageID; private final int mapX; private final int mapY; private int yLocation; public Brick(int id, int x, int y) { mapX...
package deanandjames.ui; import deanandjames.image.BackgroundManager; import deanandjames.image.ImageLoader; import deanandjames.image.PlayerImage; import deanandjames.sprite.Avatar; import deanandjames.sprite.BrickManager; import deanandjames.sprite.FireBallSprite; import java.awt.*; import java.awt.event.KeyEvent; ...
package deanandjames.ui; import com.sun.j3d.utils.timer.J3DTimer; import deanandjames.HorizontalPlatformGame; import deanandjames.image.ImageLoader; import deanandjames.image.PlayerImageWatcher; import deanandjames.sound.SoundLoader; import deanandjames.stats.StatisticsController; import javax.swing.*; impo...
package deanandjames; import deanandjames.sound.Music; import deanandjames.ui.GamePanel; import javax.swing.*; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; @SuppressWarnings("serial") public class HorizontalPlatformGame extends JFrame implements WindowListener { private static...
package deanandjames.image; import javax.imageio.ImageIO; import java.awt.*; import java.awt.image.BufferedImage; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; import java.util.List; public class ImageLoader...
package deanandjames.image; import java.awt.*; public class BackgroundManager { private final double moveFactors[] = {0.1, 0.5, 1.0}; private final int moveSize; private final int numberOfRibbons; private final String ribbonImages[] = {"mountains", "houses", "trees"}; private final Ribbon[] ribbons; ...
package deanandjames.image; public interface PlayerImageWatcher { void sequenceEnded(String imageName); }
package deanandjames.image; import java.awt.image.BufferedImage; public class PlayerImage { private final int animationPeriod; private long animationTotalTime; private boolean ignoreUpdates; private final String imageName; private int imagePosition; private final ImageLoader imagesLoader; private bo...
package deanandjames.image; import java.awt.*; import java.awt.image.BufferedImage; public class Ribbon { private final BufferedImage image; private boolean isMovingLeft; private boolean isMovingRight; private final int moveSize; private final int panelHeight; private final int panelWidth; private ...
package deanandjames.stats; import com.sun.j3d.utils.timer.J3DTimer; import java.awt.*; public class StatisticsController { private static final int MAX_HITS = 10; private long gameStartTime; private int numHits = 0; private int score; private final FontMetrics fontMetrics; private final Font messageFont; pri...
package game.statistics; import game.configuration.Configuration; import java.awt.*; public class Score { private int value = 0; public void draw(Graphics2D graphics, int x, int y) { if (Configuration.getInstance().isDebugEnabled()) { graphics.setColor(Color.red); graphics.drawString("Score: " + value, x,...
package game.statistics; import java.text.DecimalFormat; public class Statistics { private static long MAX_STATS_INTERVAL = 1000000000L; // Number of frames with a delay of 0 ms before the animation thread yields to other running threads. private static int NUM_FPS = 10; private double averageFPS = 0.0; private ...
package game.configuration; public class Configuration { private static Configuration instance; public static void configure(boolean isDebugEnabled) { instance = new Configuration(isDebugEnabled); } public static Configuration getInstance() { return instance; } private boolean isDebugEnabled; private Co...
package game.shapes; import java.awt.geom.Rectangle2D; public class BoundingBox { private final Rectangle2D rectangle2D; public BoundingBox(Rectangle2D rectangle2D) { this.rectangle2D = rectangle2D; } public Rectangle2D getRectangle() { return this.rectangle2D; } }
package game.shapes; import java.awt.*; public class Circle { private static final int TWO_PI = (int) (Math.PI * 2.0); private final Point centrePoint; private final int size; public Circle(Point centrePoint, int size) { this.centrePoint = centrePoint; this.size = size; } public void draw(Graphics2D graph...
package game.shapes; import java.awt.*; public class Subject { private final Color colour; private final int x; private final int y; public Subject(Color colour, int x, int y) { this.colour = colour; this.x = x; this.y = y; } public void draw(Graphics2D graphics) { graphics.setColor(colour); graphic...
package game.ui; import java.awt.*; public class Background { private static final Color colour = Color.black; private final int height; private final int width; public Background(int width, int height) { this.width = width; this.height = height; } public void draw(Graphics2D graphics) { graphics.setCol...
package game.ui; import game.configuration.Configuration; import game.domain.AsteroidField; import game.domain.SpaceShip; import game.statistics.Score; import game.statistics.Statistics; import game.Game; import javax.swing.*; import java.awt.*; import java.awt.event.KeyAdapter; import java.awt.event.KeyE...
package game.domain; import javax.vecmath.Point2d; import java.awt.*; public class PolygonGenerator { private static final double TWO_PI = Math.PI * 2.0; public Polygon generate(Point2d position, double heading, int numberOfSides, int size) { // TODO could optimise this so that it keeps the polygon without posit...
package game.domain; import game.configuration.Configuration; import javax.vecmath.Point2d; import java.awt.*; import java.util.ArrayList; import java.util.List; public class AsteroidField { private static final double MINIMUM_ASTEROID_SIZE = 10.0; private static final int MINIMUM_SIDES_TO_AN_ASTEROID =...
package game.domain; import game.configuration.Configuration; import game.movement.Moveable; import game.movement.MovementManager; import game.shapes.BoundingBox; import javax.vecmath.Point2d; import java.awt.*; public class Asteroid implements Moveable, game.domain.Controlable, Boundable { private final Color colo...
package game.domain; import game.configuration.Configuration; import game.movement.Moveable; import game.movement.MovementManager; import game.shapes.BoundingBox; import javax.vecmath.Point2d; import java.awt.*; public class SpaceShip implements Controlable, Boundable, Moveable { private final Color colo...
package game.domain; import game.shapes.BoundingBox; public interface Boundable { BoundingBox getBoundingBox(); }
package game.domain; public interface Controlable { void accellerate(); void decellerate(); void turnLeft(); void turnRight(); }
package game.domain; import game.configuration.Configuration; import game.movement.Moveable; import game.movement.MovementManager; import game.shapes.BoundingBox; import javax.vecmath.Point2d; import java.awt.*; public class Laser implements Moveable, Boundable { private static final double LASER_LENGTH = 50.0; pr...
package game.movement; import javax.vecmath.Point2d; import javax.vecmath.Vector2d; public class MovementManager { private static final double MAX_SPEED = 2.0; private static final double ROTATION_AMOUNT = 0.05; private final boolean isPoweredObject; private final int maxHeight; private final int maxWidth; priv...
package game.movement; import javax.vecmath.Point2d; public interface Moveable { double getDirection(); double getHeading(); Point2d getPosition(); double getSpeed(); void setDirection(double direction); void setDisabled(); void setHeading(double heading); void setSpeed(double speed); }
package game; import game.ui.FullScreenGamePanel; import javax.swing.*; import java.awt.*; public class Game extends JFrame { private static int DESIRED_FPS = 80; private static final long MILLISECONDS_TO_NANOSECONDS = 1000000L; private static final long PERIOD_IN_MS = (long) 1000.0 / DESIRED_FPS; pri...
package speech; import com.sun.speech.freetts.Voice; import com.sun.speech.freetts.VoiceManager; public class HelloWorld { public static void listAllVoices(VoiceManager voiceManager) { Voice[] voices = voiceManager.getVoices(); for (int i = 0; i < voices.length; i++) { System.out.println(voices[i].ge...
package speech; import com.sun.speech.freetts.Voice; import com.sun.speech.freetts.VoiceManager; public class Speaker { private Voice voice; public Speaker() { VoiceManager voiceManager = VoiceManager.getInstance(); voice = loadVoice(voiceManager); voice.allocate(); } public void speak(S...
package speech; public class SpeechMain { public static void main(String[] args) { new SpeechMain().run(); } private void run() { Speaker speaker = new Speaker(); speaker.speak("hi there"); speaker.cleanUp(); } }
package deanandjames.statistics; import deanandjames.configuration.Configuration; import java.awt.*; public class Score { private int value = 0; public void draw(Graphics2D graphics, int x, int y) { if (Configuration.getInstance().isDebugEnabled()) { graphics.setColor(Color.red); graphics.drawString("Scor...
package deanandjames.statistics; import java.text.DecimalFormat; public class Statistics { private static long MAX_STATS_INTERVAL = 1000000000L; // Number of frames with a delay of 0 ms before the animation thread yields // to other running threads. private static int NUM_FPS = 10; private double averageFPS = 0....
package deanandjames.configuration; public class Configuration { private static Configuration instance; public static void configure(boolean isDebugEnabled) { instance = new Configuration(isDebugEnabled); } public static Configuration getInstance() { return instance; } private boolean isDebugEnabled; pr...
package deanandjames.shapes; import java.awt.geom.Rectangle2D; public class BoundingBox { private final Rectangle2D rectangle2D; public BoundingBox(Rectangle2D rectangle2D) { this.rectangle2D = rectangle2D; } public Rectangle2D getRectangle() { return this.rectangle2D; } }
package deanandjames.shapes; import java.awt.*; public class Circle { private static final int TWO_PI = (int) (Math.PI * 2.0); private final Point centrePoint; private final int size; public Circle(Point centrePoint, int size) { this.centrePoint = centrePoint; this.size = size; } public void draw(Graphic...
package deanandjames.ui; import java.awt.*; import java.util.ArrayList; import java.util.List; public class Background { private static final Color colour = Color.black; private final int height; private final List<Star> stars; private final int width; public Background(int width, int height, int numberOfStars)...
package deanandjames.ui; import java.awt.*; public class Star { private final Color colour; private final int x; private final int y; public Star(Color colour, int x, int y) { this.colour = colour; this.x = x; this.y = y; } public void draw(Graphics2D graphics) { graphics.setColor(colour); graphics....
package deanandjames.ui; import deanandjames.AsteroidsGame; import deanandjames.configuration.Configuration; import deanandjames.domain.AsteroidField; import deanandjames.domain.SpaceShip; import deanandjames.statistics.Score; import deanandjames.statistics.Statistics; import javax.swing.*; import java.awt....
package deanandjames; import deanandjames.ui.FullScreenGamePanel; import javax.swing.*; import java.awt.*; @SuppressWarnings("serial") public class AsteroidsGame extends JFrame { private static int DESIRED_FPS = 80; private static final long MILLISECONDS_TO_NANOSECONDS = 1000000L; private static final ...
package deanandjames.domain; import javax.vecmath.Point2d; import java.awt.*; public class PolygonGenerator { private static final double TWO_PI = Math.PI * 2.0; public Polygon generate(Point2d position, double heading, int numberOfSides, int size) { // TODO could optimise this so that it keeps the polygon witho...
package deanandjames.domain; import deanandjames.configuration.Configuration; import javax.vecmath.Point2d; import java.awt.*; import java.util.ArrayList; import java.util.List; public class AsteroidField { private static final double MINIMUM_ASTEROID_SIZE = 10.0; private static final int MINIMUM_SIDES_...
package deanandjames.domain; import deanandjames.configuration.Configuration; import deanandjames.movement.Moveable; import deanandjames.movement.MovementManager; import deanandjames.shapes.BoundingBox; import javax.vecmath.Point2d; import java.awt.*; public class Asteroid implements Moveable, Controlable, Boundable...
package deanandjames.domain; import deanandjames.configuration.Configuration; import deanandjames.movement.Moveable; import deanandjames.movement.MovementManager; import deanandjames.shapes.BoundingBox; import javax.vecmath.Point2d; import java.awt.*; public class SpaceShip implements Controlable, Boundabl...
package deanandjames.domain; import deanandjames.shapes.BoundingBox; public interface Boundable { BoundingBox getBoundingBox(); }
package deanandjames.domain; public interface Controlable { void accellerate(); void decellerate(); void turnLeft(); void turnRight(); }
package deanandjames.domain; import deanandjames.configuration.Configuration; import deanandjames.movement.Moveable; import deanandjames.movement.MovementManager; import deanandjames.shapes.BoundingBox; import javax.vecmath.Point2d; import java.awt.*; public class Laser implements Moveable, Boundable { private stat...
package deanandjames.movement; import javax.vecmath.Point2d; import javax.vecmath.Vector2d; public class MovementManager { private static final double MAX_SPEED = 2.0; private static final double ROTATION_AMOUNT = 0.05; private final boolean isPoweredObject; private final int maxHeight; private final int maxWidt...
package deanandjames.movement; import javax.vecmath.Point2d; public interface Moveable { double getDirection(); double getHeading(); Point2d getPosition(); double getSpeed(); void setDirection(double direction); void setDisabled(); void setHeading(double heading); void setSpeed(double speed); }
/* * Classe utile pour le chargement de la configuration Hibernate */ package com.aai.db; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; public class HibernateUtil { private static final SessionFactory sessionFactory = buildSessionFactory(); private static SessionFactory ...
package com.aai.servlets; import java.io.IOException; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.ht...
package com.aai.servlets; import java.io.IOException; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.ht...
/* * Cette servlet se charge de la gestion des erreurs * @author: Essoussi Mohamed Habib */ package com.aai.servlets; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class Erreur extends HttpServlet { private static final long serialVersionUID = -1889967268592679472L;...
package com.aai.utils; public class Constants { public static final String dataBaseName = "2ai"; public static final String dataBaseServer ="localhost"; public static final String datatBaseLogin="root"; public static final String dataBasePassWord=""; //*************************************************...
package com.guhesan.querycrypt.beans; import java.util.ArrayList; import java.util.HashMap; import java.util.StringTokenizer; /** * @author Venkatt Guhesan (www.AvedaTech.com) * This code is part of the QueryCrypt project: * All Rights Reserved. * * THE QUERYCRYPT SOFTWARE IS PROVIDED ``AS IS'' AND ...
package com.guhesan.querycrypt.beans; /** * @author Venkatt Guhesan (www.AvedaTech.com) * This code is part of the QueryCrypt project: * All Rights Reserved. * * THE QUERYCRYPT SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WAR...
package com.guhesan.querycrypt.beans; import java.util.HashMap; import javax.crypto.SecretKey; /** * @author Venkatt Guhesan (www.AvedaTech.com) * This code is part of the QueryCrypt project: * All Rights Reserved. * * THE QUERYCRYPT SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR * IMPLIED ...
package com.guhesan.querycrypt.util; /** * @author Venkatt Guhesan (www.AvedaTech.com) * This code is part of the QueryCrypt project: * All Rights Reserved. * * THE QUERYCRYPT SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARR...
package com.guhesan.querycrypt.servlet; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import com.guhesan.querycrypt.QueryCrypt; import com.guhesan.querycrypt.beans.QueryCryptProperties; /** * @author Venkatt Guhesan (www.AvedaTech.com) * This code is part of the QueryCrypt...
package com.guhesan.querycrypt.listener; import javax.servlet.http.HttpSessionEvent; import javax.servlet.http.HttpSessionListener; import com.guhesan.querycrypt.QueryCrypt; /** * @author Venkatt Guhesan (www.AvedaTech.com) * This code is part of the QueryCrypt project: * All Rights Reserved. * * ...
package com.guhesan.querycrypt; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.HashMap; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; import javax.servlet.http.HttpServletRequest; import com.guhesan.querycr...
package mh.log; import java.util.logging.ConsoleHandler; /** * This class is created in order to change the color of Logger's messages.<br> * This override the main constructor in order to be able to use the protected method <code>setOutputStream()</code><br> * * @author Gianmarco Laggia * */ public class MHC...
package mh.log; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.PrintStream; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Properties; import java.util.logging.FileHandler; import java.util.logging.Level; import java....
package mh.log; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.logging.Formatter; import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.LogRecord; /** * Class used to create a properly styled and formatted html log file.<br...
package mh.log; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; /** * A stream that redirect the flow to a specified logger. * * @author Gianmarco Laggia * */ public class LogOutputStream extends ByteArrayOutputStream {//java.io...
package mh; import java.util.ArrayList; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.DisplayMode; import org.lwjgl.opengl.GL11; import de.matthiasmann.twl.Event; import de.matthiasmann.twl.FPSCounter; import de.matthiasmann.twl.GUI; import de.matthiasmann.twl.Label; import de.matthiasmann.twl.RadialPopup...
package mh.chat; /** * This class is the class that handles <b>all</b> chat's messages.<br> * The chat is IRC based, a little simplified with few commands.<br> * * * @author Gianmarco Laggia * */ public class ChatMessageExecuter { }
package mh.chat; /** * The enum of all the avaible commands for communication between Clients and Server * * @author Gianmarco Laggia * */ public enum MessageType{ BAD_COMMAND(null), PING("ping"), NICK("nick"), PASS("pass"), MOVE("move"), CHAT("chat"), BROADCAST("bc"); private final String command; p...
package mh.interfaces; /** * An Entity is the thing that handle movements and collision for each sprite. * * @author Gianmarco Laggia * */ public interface IEntity { public void move(); public void setSpeed(); public double getSpeed(); public void draw(); /** * Get the x location of this entity * ...
package mh.interfaces; /** * A sprite to be displayed on the screen. This class does not contain position information. * * @author Gianmarco Laggia */ public interface IImage { /** * Returns the width of the sprite * * @return The width in pixels */ public int getWidth(); /** * Returns the height ...
package mh.interfaces; import java.io.File; import mh.MagicHogwarts; /** * Class that contains all the constants used in the game. * * @author Gianmarco Laggia * */ public interface Constants { /** The size of a standard tile */ public static final int TILE_SIZE = 32; /** The size of a standard tile, ...
package mh; import gmmxEditor.Converter; import java.io.IOException; public class Prove { public Prove() { } public static void main(String[] arg) { // try { // // OSXImporter i = new OSXImporter("/Users/gianmarco/Dropbox/MagicHogwarts/objects copia.png"); // i.getObjects(); int[][] arr = new ...
package mh; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Hashtable; import mh.interface...
package mh; import java.io.IOException; import java.net.DatagramPacket; import java.net.InetAddress; import java.net.MulticastSocket; /** * WARNING TEST CLASS!!!!! * * @author gianmarcolaggia * */ public class ClientUDP implements Runnable { private final MagicHogwarts game; public ClientUDP(MagicHogwarts g...
package mh; /** * * @author Gianmarco Laggia * */ public class PlayerEntity extends Entity { private static int darkness; private static long experience; private static int level; private static long lifePoints; private static double magicPower; private static long money; private int fireInterva...
package mh; import java.awt.Rectangle; /** * The spell casted by any player. * * @author Gianmarco Laggia * */ public class SpellEntity extends Entity { private double xSpeed; private double ySpeed; /** * Constructor, mouse coordinates are used to calculate the angle of the image and the couple of verti...
package mh.util; import java.util.Arrays; /** * A very fast and memory efficient class to encode and decode to and from BASE64 in full accordance with RFC 2045.<br> * <br> * On Windows XP sp1 with 1.4.2_04 and later ;), this encoder and decoder is about 10 times faster on small arrays (10 - * 1000 bytes) and 2-3 ...
package mh.util; /** * A generic class that connect together two object, forming a pair. * * @author Gianmarco * * @param <A> * The type of the first element * @param <B> * The type of the second element */ public class Pair<A, B> { private A a; private B b; /** * Standard constr...
package mh.util; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; /** * Manage all kind of SHA hashing is needed by the program. * * @author Gianmarco Laggia * @since 0.2 * */ public class SHAHash { /** * Takes the input and calculate the SHA-2...
package mh; /** * WARNING TEST CLASS!!!!! * * @author gianmarcolaggia * */ public class UDPMulticastServer { // // public static void main(String[] arg) { // byte[] buffer = new byte[65535]; // try { // int port = 5000; // MulticastSocket sock = new MulticastSocket(5000); // InetAddress addr = In...
package mh; import mh.map.SpellImage; import mh.map.Sprite; /** * A central reference point for creating resources useful in the game. * * @author Gianmarco Laggia */ public class ResourceFactory { /** The single instance of this class to ever exist [singleton] */ private static final ResourceFactory single = ...
package mh; import static org.lwjgl.opengl.GL11.GL_BLEND; import static org.lwjgl.opengl.GL11.GL_COLOR_BUFFER_BIT; import static org.lwjgl.opengl.GL11.GL_DEPTH_BUFFER_BIT; import static org.lwjgl.opengl.GL11.GL_DEPTH_TEST; import static org.lwjgl.opengl.GL11.GL_MODELVIEW; import static org.lwjgl.opengl.GL11.GL_ONE_MIN...
package mh; import java.awt.Canvas; import java.awt.event.KeyEvent; import java.io.FileNotFoundException; import java.io.IOException; import java.net.MalformedURLException; import java.text.ParseException; import java.util.Hashtable; import java.util.concurrent.LinkedBlockingQueue; import java.util.logging.Logger; im...
package mh; /** * An interface describing any class that wishes to be notified as the game window renders. * * @author Kevin Glass */ public interface GameWindowCallback { /** * Notification that game should initialise any resources it needs to use. This includes loading sprites. */ public void initialise()...
package mh.message; import java.text.ParseException; import java.util.ArrayList; import java.util.StringTokenizer; import java.util.logging.Logger; /** * This class analyze INcoming string from server and convert them to <code>IncomingMessage</code> format. Messages are * parsed.<br> * The <code>parseMessage(Strin...
package mh.message; import java.util.ArrayList; import java.util.TreeMap; /** * This class is not properly a parser. It just analyze if IrcMessage has the right parameters structure for the * correspondent command. The class is used in the heart of Command Recognizer and MessageReceiver to complete parse * operati...
package mh.message; import java.util.ArrayList; /** * This class manages each message incoming from the server. * * @author gianmarcolaggia * */ public class IncomingMessage { /** * The prefix of the message (the one starting with ":") */ private String prefix; /** * The command of the message *...
package mh; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.net.ConnectException; import java.net.InetSocketAddress; import java.net.Socket; import java.net.SocketException; import java.net.SocketTimeoutException; import java.text.ParseException; import java...
package mh.entity; import java.util.ArrayList; import mh.util.Pair; /** * Represents any kind of interaction between two different entities.<br> * A <code>Damage</code> is something that's carried by a damaging <code>Entity</code> to a to-be-damaged one.<br> * Each entity is asked to calculate its own damage by g...
package mh.entity; /** * Defines whether or not a tile or an entity is damageable or not * * @author Gianmarco Laggia * @author Alberto D'Este * */ public interface IDamageable { /** * @return false if for any reason the target can't be damaged */ public boolean isDamageable(); /** * Sets if an obje...
package mh.entity; public enum DamageEffectEnum{ BURN, EXTINGUISH, WET, DRY, FROZE, UNFROZE, HIT, BLAST, REPAIR, BLEED, HEAL, BLOCK, UNBLOCK, SLOWDOWN, LEVITATE, PUSH, PULL, DISARM, MAGNET, //Accio magnet negative, repulgo magnet positive. An object is considered to be positive. LIGHT, STUN, DES...
package mh.entity; import java.util.ArrayList; /** * Contains all avaible state for each entity. * * @author Gianmarco Laggia * @author Alberto D'Este */ public enum EnumState{ /** * DAMAGE STATE<br> * Main state of each object [REQUIRED]. The object uses this state when has not received any damage, nor is...
package mh.entity; /** * Basic action of an Entity to check for collision * * @author Gianmarco Laggia * */ public interface ICollidable { public boolean collidesWith(Entity other); public abstract void collidedWith(Entity other); }
package mh.entity; import java.util.List; import mh.entity.object.EntityObject; /** * Defines if a particular object (Furniture) can contain other <code>EntityObject</code>s * * @author Gianmarco Laggia * @author Alberto D'Este * */ public interface IContainer { /** * @return True if the container is emp...
package mh.entity.object; import java.util.Vector; import mh.entity.Entity; import mh.entity.IPickAndCollect; import mh.entity.object.attributes.ObjectAttribute; import mh.entity.object.attributes.ObjectAttributeWalkable; import mh.map.objectset.ObjectSet; public abstract class EntityObject extends Entity implements...
package mh.entity.object; import mh.map.render.RenderItem; /** * The representation of each object in the map, an object is something that is map related and its creation is * controlled only by map's creator. * * @author Gianmarco Laggia * @author Alberto D'Este * */ public class EntityItem extends EntityOb...
package mh.entity.object; import mh.entity.object.attributes.ObjectAttributeWalkable; import mh.map.Texture; public class EntityFurniture extends EntityObject { public EntityFurniture(Texture tex, int texOffsetX, int texOffsetY, int damageThreshold, int maximumHealth, int weight, EnumEntityObjectSize h, double refl...
package mh.entity.object; import mh.map.Texture; public class EntityFurnitureSittable extends EntityFurniture { public EntityFurnitureSittable(Texture tex, int texOffsetX, int texOffsetY, int damageThreshold, int maximumHealth, int weight, EnumEntityObjectSize h, double reflection) { super(tex, texOffsetX, texOff...
package mh.entity.object.attributes; import mh.entity.Entity; import mh.entity.object.EntityObject; public abstract class ObjectAttribute { /** * Reference to the object that has this attribute */ protected EntityObject obj; public ObjectAttribute(EntityObject o) { this.obj = o; } public abstract boolean...
package mh.entity.object.attributes; import mh.entity.Entity; import mh.entity.object.EntityObject; public class ObjectAttributeWalkable extends ObjectAttribute { /** * Array of valid access directions */ boolean[] validDirections = { true, true, true, true }; /** * Position of the top access bit */ pr...