Source stringclasses 1
value | Date int32 2.01k 2.01k | Text stringlengths 3 15.9M | Token_count int32 1 2.44M |
|---|---|---|---|
github-java-corpus | 2,012 | package inventory;
import player.PlayerDirection;
import com.golden.gamedev.object.AnimatedSprite;
import app.RPGGame;
/**
* Class for items that do damage.
* Has instance variable myDamage to represent base damage value
* Weapons are in the form of
* "Name, weapon, boolean forSale, int Price, int Dam... | 797 |
github-java-corpus | 2,012 | package inventory;
public interface Sellable {
int price = 0;
boolean isSellable();
}
| 23 |
github-java-corpus | 2,012 | package inventory;
import java.awt.Graphics2D;
import app.RPGGame;
/**
* Class for items that attach to the hero and contribute to his stats.
* Accessories are of the form
* "Name, gifName, accessory, statToChange, valueOfChange" for example
* "Charismatic Chainmail, chainmail, accessory, health, 8"
*
* @auth... | 894 |
github-java-corpus | 2,012 | package inventory;
import app.RPGGame;
/**
* Class for items that affect the hero's counters. Health potions are of the
* form "Name, gif name, healthpotion, value of change" for example
* "Super Potion, potion, healthpotion, 4"
*
* @author Chris Dennis
*/
public class HealthPotion extends ItemSub {
priva... | 548 |
github-java-corpus | 2,012 | package inventory;
import app.RPGGame;
/**
* Class for items that must be collected to complete the game.
*
* KeyItems are of the form
* "Name, keyitem, boolean forSale, int Price"
* for example
* "Master Key, keyitem, false"
*
* @author Chris Dennis
*/
public class KeyItem extends ItemSub ... | 409 |
github-java-corpus | 2,012 | package inventory;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.util.ArrayList;
import app.InventoryMenu;
import app.RPGGame;
import com.golden.gamedev.object.Sprite;
import com.golden.gamedev.object.font.SystemFont;
public class PlayerInventory extends Inventory {
private... | 1,050 |
github-java-corpus | 2,012 | package inventory;
import java.awt.image.BufferedImage;
import collisions.ItemCollision;
import com.golden.gamedev.object.Sprite;
import com.golden.gamedev.object.SpriteGroup;
import app.RPGGame;
public abstract class ItemSub implements Comparable<ItemSub>, EquipItemInterface
{
protected static RPGGame ... | 806 |
github-java-corpus | 2,012 | package inventory;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
public class Inventory implements Iterable<ItemSub> {
protected Map<ItemSub, Integer> myItemMap;
public Inventory() {
myItemMap = new TreeMap<ItemSub, Integer>();
}
public voi... | 634 |
github-java-corpus | 2,012 | package inventory;
import player.PlayerDirection;
import app.RPGGame;
import com.golden.gamedev.object.AnimatedSprite;
public class BowAndArrows extends Weapon implements Sellable{
private BowAndArrows(){
super();
}
private int price = 1;
private BowAndArrows (RPGGame game2, String name,
... | 405 |
github-java-corpus | 2,012 | package enemy;
import collisions.CollisionObserver;
import ai.AbstractGameHeuristic;
import app.RPGGame;
public class PlayerEnemyCollisionHeuristic extends AbstractGameHeuristic implements CollisionObserver{
private boolean collided;
public PlayerEnemyCollisionHeuristic(RPGGame game, Enemy enemy,
String condit... | 143 |
github-java-corpus | 2,012 | package enemy;
import inventory.ItemSub;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.HashMap;
import saving_loading.AttributeContainer;
import saving_loading.Jsonable;
import ai.AbstractAI;
import app.RPGGame;
import collisions.EnemyCollision;
import collisions.Projecti... | 1,044 |
github-java-corpus | 2,012 | package enemy;
import app.RPGGame;
public class SuperTelepathicAttack extends AbstractAttack {
int strikes;
public SuperTelepathicAttack(RPGGame game, IEnemy enemy, String name) {
super(game, enemy, name);
strikes = 3;
}
@Override
public boolean isAttackValid(long elapsedTime) {
// This attack is perf... | 169 |
github-java-corpus | 2,012 | package enemy;
import app.RPGGame;
import com.golden.gamedev.object.AnimatedSprite;
public abstract class AbstractAttackVector {
protected static RPGGame game;
private AnimatedSprite vectorSprite;
public AbstractAttackVector(RPGGame game, AbstractVectorAttack owner, double x, double y, double speedX, double spee... | 125 |
github-java-corpus | 2,012 | package enemy;
import inventory.ItemSub;
import app.RPGGame;
public class HealthMod extends ItemSub implements EnemyMod
{
private Enemy owner;
private int healthChange;
public HealthMod(Enemy owner, int healthChange)
{
this.owner = owner;
this.healthChange = healthChange;
}
public void remove()
{
ow... | 270 |
github-java-corpus | 2,012 | package enemy;
import collisions.AttackVectorCollision;
import com.golden.gamedev.object.Sprite;
import com.golden.gamedev.object.SpriteGroup;
import app.RPGGame;
public abstract class AbstractVectorAttack extends AbstractAttack {
private SpriteGroup vectors;
protected double vectorSpeedX = 0;
protected doub... | 263 |
github-java-corpus | 2,012 | package enemy;
import app.RPGGame;
public class SlowBehaviorModifier extends AbstractTimedBehaviorModifier {
private static final int EFFECT_DURATION = 5000;
private static final double SLOW_FACTOR = 0.4;
private double slowFactor;
public SlowBehaviorModifier(RPGGame game){
this(game, EFFECT_DURATION, SLOW_F... | 199 |
github-java-corpus | 2,012 | package enemy;
import player.Player;
import app.RPGGame;
public abstract class AbstractAttack {
protected static RPGGame game;
protected IEnemy enemy;
protected Player target;
private String name;
public AbstractAttack (RPGGame game, IEnemy enemy, String name){
AbstractAttack.game = game;
this.enemy = enem... | 184 |
github-java-corpus | 2,012 | package enemy;
import app.RPGGame;
public abstract class AbstractRangeAttack extends AbstractAttack{
public AbstractRangeAttack(RPGGame game, IEnemy enemy) {
super(game, enemy, "AbstractRangeAttack");
}
@Override
public void performAttack(long elapsedTime) {
}
}
| 61 |
github-java-corpus | 2,012 | package enemy;
import com.golden.gamedev.object.Timer;
import app.RPGGame;
public abstract class AbstractRecurrentTimeBehaviorModifier extends AbstractBehaviorModifier{
Timer timer;
int executions;
public AbstractRecurrentTimeBehaviorModifier(RPGGame game, int intervalTime, int executions) {
super(game);
t... | 156 |
github-java-corpus | 2,012 | package enemy;
import player.Player;
import app.RPGGame;
public abstract class AbstractBehaviorModifier {
RPGGame game;
protected Player player;
public AbstractBehaviorModifier(RPGGame game){
this.game = game;
this.player = game.getPlayer();
}
public abstract void setUp(long elapsedTime);
public abstra... | 89 |
github-java-corpus | 2,012 | package enemy;
import app.RPGGame;
public abstract class AbstractCollisionAttack extends AbstractAttack {
protected boolean active = true;
public AbstractCollisionAttack(RPGGame game, IEnemy enemy, String name, boolean startActive) {
super(game, enemy, name);
active = startActive;
}
public void setActive... | 80 |
github-java-corpus | 2,012 | package enemy;
import java.util.Comparator;
import java.util.Map;
/*
* Sorts a map based upon its values, in descending order
*/
@SuppressWarnings("hiding")
public class ValueComparator<String> implements Comparator<String> {
Map<String, Double> toSort;
public ValueComparator(Map<String, Double> map)
... | 166 |
github-java-corpus | 2,012 | package enemy;
import java.awt.image.BufferedImage;
import level.Level;
import saving_loading.AttributeContainer;
import saving_loading.MapContainer;
import saving_loading.RWGameObject;
import scenery.Portal;
import ai.SnakeDecisionTableAI;
import app.RPGGame;
import com.golden.gamedev.engine.timer.SystemTim... | 551 |
github-java-corpus | 2,012 | package enemy;
import player.HealthCounter;
import counters.BaseCounter;
import app.RPGGame;
public class PoisonedBehaviorModifier extends AbstractRecurrentTimeBehaviorModifier{
private static final int EXECUTIONS = 5;
private static final int INTERVAL_TIME = 1500;
public PoisonedBehaviorModifier(RPGGame game){... | 173 |
github-java-corpus | 2,012 | package enemy;
import java.awt.image.BufferedImage;
import java.util.HashMap;
import collisions.EnemyCollision;
import com.golden.gamedev.object.Sprite;
import com.golden.gamedev.object.SpriteGroup;
public interface IEnemy {
public abstract void add(int[] location, int layer);
public abstract Sprite getSprite();
... | 205 |
github-java-corpus | 2,012 | package enemy;
import app.RPGGame;
import com.golden.gamedev.object.Timer;
public abstract class AbstractTimedBehaviorModifier extends AbstractBehaviorModifier{
Timer timer;
boolean uniqueDone = false;
public AbstractTimedBehaviorModifier(RPGGame game, int effectDuration) {
super(game);
timer = new Timer(e... | 167 |
github-java-corpus | 2,012 | package enemy;
public interface EnemyMod
{
void remove();
void apply();
}
| 16 |
github-java-corpus | 2,012 | package enemy;
import com.golden.gamedev.object.Sprite;
import com.golden.gamedev.object.Timer;
import app.RPGGame;
public class ShootingAttack extends AbstractVectorAttack{
Timer timer;
public ShootingAttack(RPGGame game, IEnemy enemy, String name) {
super(game, enemy, name);
timer = new Timer(1000);
vect... | 231 |
github-java-corpus | 2,012 | package enemy;
import inventory.ItemSub;
import inventory.MakeItems;
import java.util.Random;
import java.util.TreeMap;
import app.RPGGame;
/*
* EnemyItemGen returns an item to be dropped when an enemy dies.
* the getDroppedItem method takes an enemy parameter because the
* state of the enemy may influence the dro... | 358 |
github-java-corpus | 2,012 | package enemy;
import app.RPGGame;
public class BehaviorModifyingCollisionAttack extends AbstractCollisionAttack {
private AbstractBehaviorModifier bm;
public BehaviorModifyingCollisionAttack(RPGGame game, IEnemy enemy, String name, AbstractBehaviorModifier bm, boolean startActive) {
super(game, enemy, name, s... | 133 |
github-java-corpus | 2,012 | package enemy;
import java.awt.image.BufferedImage;
import app.RPGGame;
import com.golden.gamedev.object.AnimatedSprite;
public class ShotVector extends AbstractAttackVector {
private static final String imagePath = "resources/enemy/projectile.png";
public ShotVector(RPGGame game, AbstractVectorAttack owner, d... | 136 |
github-java-corpus | 2,012 | package counters;
import java.awt.Graphics2D;
import java.util.List;
public interface Counters {
public List<BaseCounter> getCounters();
public void update(long elapsed);
public void render(Graphics2D g);
}
| 43 |
github-java-corpus | 2,012 | package counters;
public abstract class BaseCounter {
private Integer count;
protected Integer init; // Initial is used as maximum
private boolean full = false;
private boolean empty = false;
public BaseCounter (int count) {
this.count = count;
this.init = count + 5;
}
public abstract void update(long e... | 340 |
github-java-corpus | 2,012 | package counters;
import java.awt.Graphics2D;
public abstract class GraphicalCounter extends BaseCounter {
public GraphicalCounter(int count) {
super(count);
}
public abstract void render(Graphics2D g);
}
| 45 |
github-java-corpus | 2,012 | package counters;
import java.awt.Graphics2D;
import java.util.ArrayList;
import java.util.List;
public abstract class BaseCounters {
private List<BaseCounter> counters = new ArrayList<BaseCounter>();
public List<BaseCounter> getCounters() {
return counters;
}
public void update(long elapsed) {
for (BaseCou... | 138 |
github-java-corpus | 2,012 | package actions;
public abstract class BaseAction {
private boolean enabled = false;
private boolean active = false;
public abstract void update(long elapsed);
public void setEnabled(boolean enabled, boolean modifyActive) {
if (!enabled && modifyActive)
active = false;
this.enabled = enabled;
}
pub... | 104 |
github-java-corpus | 2,012 | package actions;
import java.io.File;
import java.util.Arrays;
import java.util.Iterator;
import com.golden.gamedev.util.FileUtil;
public abstract class Directions implements Iterable<Direction>{
protected Cardinal curDirection;
private Direction[] directions = new Direction[4];
protected String json;
public enu... | 215 |
github-java-corpus | 2,012 | package actions;
import java.awt.Graphics2D;
import java.util.ArrayList;
import java.util.List;
public class BaseActions implements Actions {
private List<BaseAction> actions = new ArrayList<BaseAction>();
public List<BaseAction> getActions() {
return actions;
}
public void update(long elapsed) {
for (Bas... | 138 |
github-java-corpus | 2,012 | package actions;
import java.awt.image.BufferedImage;
import actions.Directions.Cardinal;
public abstract class Direction{
private Double speedX;
private Double speedY;
private BufferedImage[] images;
private Cardinal cardinal;
public Direction(double speedX, double speedY, Cardinal cardinal, BufferedImage[... | 212 |
github-java-corpus | 2,012 | package actions;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.golden.gamedev.util.FileUtil;
import com.google.gson.Gson;
public class DirectionlessKeys {
private List<Integer> keys;
public DirectionlessKeys(String url) {
keys = loadJSON(url);... | 231 |
github-java-corpus | 2,012 | package actions;
import java.awt.Graphics2D;
public abstract class GraphicalAction extends BaseAction{
public abstract void render(Graphics2D g);
}
| 31 |
github-java-corpus | 2,012 | package actions;
import java.awt.Graphics2D;
import java.util.List;
public interface Actions {
public List<BaseAction> getActions();
public void update(long elapsed);
public void render(Graphics2D g);
}
| 42 |
github-java-corpus | 2,012 | package quest;
//An interface to be implemented by quests.
//QuestGivers will observe quests in order to decide what dialogue to share with the player
public interface Observable
{
public void addObserver(QuestGiver qu);
public void removeObserver(QuestGiver qu);
}
| 60 |
github-java-corpus | 2,012 | /*
* interface for QuestGivers to implement, to ensure that a quest has been completed
*/
package quest;
public interface Observer
{
public void update(Quest qu);
}
| 36 |
github-java-corpus | 2,012 | package quest;
import app.RPGGame;
import inventory.Inventory;
import inventory.ItemSub;
import npc.NPC;
/*
* Type of task where the player transports an item from point A to point B
*/
public class TransportTask extends Task
{
private ItemSub item;
private NPC recipient;
private Inventory inv;
public Tran... | 161 |
github-java-corpus | 2,012 | /*
* Make sure the npc safely arrives at the appointed location
*/
package quest;
import npc.NPC;
public class EscortTask extends Task
{
private int[] loc;
private NPC recipient;
public EscortTask(String description, NPC recipient, int[] loc)
{
super(description);
this.loc = loc;
this.recipient = recip... | 137 |
github-java-corpus | 2,012 | /**
* The classic fetch x amount of this_item and bring it to so and so
* A HashMap is used in the constructor in case items of multiple types are required
*/
package quest;
import java.util.HashMap;
import app.RPGGame;
import npc.NPC;
import inventory.Inventory;
import inventory.ItemSub;
public class FetchTas... | 353 |
github-java-corpus | 2,012 | package quest;
public abstract class Task
{
protected boolean isComplete = false;
protected String description;
public Task (String description)
{
this.description = description;
}
public String getDescription()
{
return toString();
}
public abstract boolean checkComplete();
}
| 59 |
github-java-corpus | 2,012 | package quest;
import inventory.ItemSub;
import app.RPGGame;
public class QuestItem extends ItemSub implements Observable {
private ItemSub myItem;
// private ArrayList<Task> myObservers;
public QuestItem (ItemSub item) {
myItem = item;
}
@Override
public boolean isThisKindOfItem (Str... | 281 |
github-java-corpus | 2,012 | /*
* Type of quest where the player is given a reward at the end
*/
package quest;
import inventory.ItemSub;
import app.RPGGame;
public class RewardQuest extends Quest
{
private ItemSub reward;
public RewardQuest(String description, ItemSub reward, Task... required ) {
super(description, required);
this.re... | 98 |
github-java-corpus | 2,012 | /*
* The QuestGiver interface is an example of Observer.
* QuestGivers can be more than just npc's. For instance a sign on the road, or a bulletin board
* or a letter could be questgivers.
* QuestGivers observe quests.
*/
package quest;
public interface QuestGiver
{
public void update(Quest qu);
public voi... | 84 |
github-java-corpus | 2,012 | /*
* Type of task where player must destroy a certain NPC
*/
package quest;
import enemy.Enemy;
public class DestroyTask extends Task
{
private Enemy recipient;
public DestroyTask(String description, Enemy recipient)
{
super(description);
this.recipient = recipient;
}
public boolean checkComplete()
{... | 83 |
github-java-corpus | 2,012 | package quest;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.util.ArrayList;
import com.golden.gamedev.object.font.SystemFont;
public class QuestJournal
{
private ArrayList<Quest> myQuests;
private boolean showJournal = false;
public static final int INDENT = 10;
public sta... | 433 |
github-java-corpus | 2,012 | package quest;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import app.RPGGame;
public abstract class Quest implements Observable
{
protected ArrayList<Task> toDo;
protected ArrayList<Task> done;
protected boolean isActive = false;
protected ArrayList<QuestGiver> observers;
prot... | 300 |
github-java-corpus | 2,012 | /*
* Type of quest where the game state changes after quest completion.
* For example, a previously locked door may now become locked.
*/
package quest;
import app.RPGGame;
public class StateChangeQuest extends Quest
{
public StateChangeQuest(Task... required)
{
super(null, required);
}
public void comp... | 83 |
github-java-corpus | 2,012 | package scenery;
import java.awt.image.BufferedImage;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import level.Level;
import saving_loading.AttributeContainer;
import saving_loading.Jsonable;
import saving_loading.MapContainer;
import saving_loading.RWGameObject;
impo... | 648 |
github-java-corpus | 2,012 | package scenery;
import app.RPGGame;
import collisions.PortalCollision;
public class Portal extends Scenery {
public Portal(RPGGame game, String imageURL) {
super(game, imageURL);
}
public void setCollision() {
PortalCollision collision = new PortalCollision(game);
collision.pixelPerfectColli... | 90 |
github-java-corpus | 2,012 | package collisions;
import com.golden.gamedev.object.Sprite;
import com.golden.gamedev.object.collision.BasicCollisionGroup;
import enemy.AbstractVectorAttack;
public class AttackVectorCollision extends BasicCollisionGroup{
AbstractVectorAttack owner;
public AttackVectorCollision(AbstractVectorAttack owner){
... | 96 |
github-java-corpus | 2,012 | package collisions;
import com.golden.gamedev.object.Sprite;
import com.golden.gamedev.object.collision.BasicCollisionGroup;
public class SceneryCollision extends BasicCollisionGroup {
public void collided(Sprite character, Sprite scenery) {
double maxsep = scenery.getImage().getHeight() - character.getImage().ge... | 113 |
github-java-corpus | 2,012 | package collisions;
import app.RPGGame;
import com.golden.gamedev.object.Sprite;
import com.golden.gamedev.object.collision.BasicCollisionGroup;
public class PortalCollision extends BasicCollisionGroup{
private RPGGame game;
String end = "End";
public PortalCollision (RPGGame game) {
this.game = g... | 157 |
github-java-corpus | 2,012 | package collisions;
import player.PlayerActions;
import npc.NPC;
import app.RPGGame;
import com.golden.gamedev.object.Sprite;
import com.golden.gamedev.object.collision.BasicCollisionGroup;
public class NPCCollision extends BasicCollisionGroup {
private RPGGame game;
private NPC npc;
public NPC... | 263 |
github-java-corpus | 2,012 | package collisions;
import inventory.ItemSub;
import java.util.HashMap;
import player.PlayerActions;
import app.RPGGame;
import com.golden.gamedev.object.Sprite;
import com.golden.gamedev.object.collision.BasicCollisionGroup;
public class ItemCollision extends BasicCollisionGroup {
private RPGGame ... | 180 |
github-java-corpus | 2,012 | package collisions;
import com.golden.gamedev.object.Background;
import com.golden.gamedev.object.Sprite;
import com.golden.gamedev.object.collision.CollisionBounds;
public class PlayerBoundaryCollision extends CollisionBounds {
public PlayerBoundaryCollision(Background bg) {
super(bg);
}
public void collided(... | 120 |
github-java-corpus | 2,012 | package collisions;
import npc.NPC;
import player.Player;
import app.RPGGame;
import com.golden.gamedev.object.Sprite;
import com.golden.gamedev.object.collision.BasicCollisionGroup;
import enemy.IEnemy;
public class ProjectileCollision extends BasicCollisionGroup {
private RPGGame game;
private IEnemy enemy... | 212 |
github-java-corpus | 2,012 | package collisions;
public interface CollisionObserver {
void notifyOfCollision();
}
| 14 |
github-java-corpus | 2,012 | package collisions;
import java.util.ArrayList;
import java.util.List;
import player.Player;
import app.RPGGame;
import com.golden.gamedev.object.Sprite;
import com.golden.gamedev.object.collision.BasicCollisionGroup;
import enemy.IEnemy;
public class EnemyCollision extends BasicCollisionGroup {
p... | 404 |
github-java-corpus | 2,012 | package npc;
import java.util.Arrays;
import saving_loading.AttributeContainer;
import ai.AbstractMovementAI;
import app.RPGGame;
public abstract class MovingNPC extends NPC{
/**
*
*/
private static final long serialVersionUID = 1L;
RPGGame game;
int[] velocity;
AbstractMovementAI motion;
p... | 143 |
github-java-corpus | 2,012 | package npc;
import java.awt.image.BufferedImage;
import saving_loading.AttributeContainer;
import saving_loading.Jsonable;
import app.RPGGame;
import collisions.NPCCollision;
import collisions.ProjectileCollision;
import com.golden.gamedev.object.Sprite;
import com.golden.gamedev.object.SpriteGroup;
import ... | 533 |
github-java-corpus | 2,012 | package npc;
import saving_loading.AttributeContainer;
import app.RPGGame;
@SuppressWarnings("serial")
public abstract class StationaryNPC extends NPC{
public StationaryNPC(RPGGame game2, AttributeContainer ac) {
super(game2, ac);
// TODO Auto-generated constructor stub
}
@Override
public abstract String ge... | 90 |
github-java-corpus | 2,012 | package npc;
import java.util.ArrayList;
import quest.Quest;
import quest.QuestGiver;
import saving_loading.AttributeContainer;
import app.RPGGame;
import dialogue.SimpleDialogue;
@SuppressWarnings("serial")
public class TestQuestGiver extends StationaryNPC implements QuestGiver
{
private ArrayList<Quest> myQuests;
... | 379 |
github-java-corpus | 2,012 | package npc;
import java.awt.image.BufferedImage;
import level.Level;
import saving_loading.AttributeContainer;
import saving_loading.MapContainer;
import saving_loading.RWGameObject;
import scenery.Portal;
import app.RPGGame;
import dialogue.SimpleDialogue;
@SuppressWarnings("serial")
public class Pri... | 460 |
github-java-corpus | 2,012 | package level;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.util.HashMap;
import java.util.StringTokenizer;
import com.golden.gamedev.engine.BaseIO;
import com.golden.gamedev.engine.BaseLoader;
import com.golden.gamedev.engine.timer.SystemTimer;
import com.golden.gamedev.ob... | 1,518 |
github-java-corpus | 2,012 | package level;
import inventory.ItemSub;
import java.awt.Graphics2D;
import npc.Priest;
import saving_loading.AttributeContainer;
import scenery.Scenery;
import app.RPGGame;
import com.golden.gamedev.engine.BaseIO;
import com.golden.gamedev.engine.BaseLoader;
public class Start extends Level {
/**
... | 814 |
github-java-corpus | 2,012 | package level;
import java.awt.Graphics2D;
import java.awt.event.KeyEvent;
import java.awt.image.BufferedImage;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import npc.Priest;
import saving_loading.AttributeContainer;
... | 1,543 |
github-java-corpus | 2,012 | package level;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import app.RPGGame;
import com.golden.gamedev.engine.BaseIO;
import com.golden.gamedev.engine.BaseLoader;
public class Template extends Level {
/**
*
*/
private static final long serialVersionUID = 1L;
... | 977 |
github-java-corpus | 2,012 | package level;
//JFC
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
//GTGE
import app.RPGGame;
import com.golden.gamedev.object.sprite.AdvanceSprite;
public class RPGSprite extends AdvanceSprite {
/**
*
*/
private static final long serialVersionUID = 1L;
... | 795 |
github-java-corpus | 2,012 | package level;
import java.awt.Graphics2D;
import com.golden.gamedev.engine.BaseIO;
import com.golden.gamedev.engine.BaseLoader;
import saving_loading.AttributeContainer;
import scenery.Scenery;
import app.RPGGame;
import enemy.Snake;
public class End extends Level {
/**
*
*/
private... | 570 |
github-java-corpus | 2,012 | package level;
import app.RPGGame;
import saving_loading.AttributeContainer;
import saving_loading.Jsonable;
import saving_loading.MapContainer;
import saving_loading.RWGameObject;
public class LevelSettings implements Jsonable{
private AttributeContainer attributes;
@Override
public String toJson() {
// TODO... | 176 |
github-java-corpus | 2,012 | package level;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import app.RPGGame;
import com.golden.gamedev.*;
import com.golden.gamedev.util.*;
/**
* Arrow key : navigate
* Space : switch lower/upper tile
* Page down : next tile
* Page up : prev ... | 1,390 |
github-java-corpus | 2,012 | package level;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.util.StringTokenizer;
import com.golden.gamedev.engine.BaseIO;
import com.golden.gamedev.engine.BaseLoader;
import com.golden.gamedev.object.background.abstraction.AbstractTileBackground;
import com.golden.gamedev.util.... | 970 |
github-java-corpus | 2,012 | package level;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import com.golden.gamedev.Game;
import com.golden.gamedev.GameLoader;
import com.gold... | 1,409 |
github-java-corpus | 2,012 | package ai;
import app.RPGGame;
import enemy.IEnemy;
public class PlayerFarFromEnemyHeuristic extends AbstractGameHeuristic {
double threshold;
private static double DEFAULT_THRESHOLD = 0.5;
public PlayerFarFromEnemyHeuristic(RPGGame game, IEnemy enemy){
this(game, enemy, DEFAULT_THRESHOLD);
}
public Play... | 147 |
github-java-corpus | 2,012 | package ai;
import java.util.HashMap;
import app.RPGGame;
import enemy.IEnemy;
public class SnakeDecisionTableAI extends AbstractDecisionTableAI {
public SnakeDecisionTableAI(RPGGame game, IEnemy enemy) {
super(game, enemy);
generateDecisionTable();
}
//right now the decision table is hard-coded in a class
... | 314 |
github-java-corpus | 2,012 | package ai;
import player.Player;
public class FollowingMovementAI extends AbstractMovementAI {
public FollowingMovementAI (Player player) {
}
@Override
public double[] getVelocities () {
/*
* double xSpeed = follow.getMaxXSpeed(); double ySpeed =
* follow.getMaxYSpeed(); r... | 94 |
github-java-corpus | 2,012 | package ai;
import app.RPGGame;
import enemy.AbstractAttack;
import enemy.IEnemy;
public abstract class AbstractAI{
protected static RPGGame game;
protected IEnemy enemy;
public AbstractAI(RPGGame game, IEnemy enemy){
AbstractAI.game = game;
this.enemy = enemy;
}
public abstract void act... | 113 |
github-java-corpus | 2,012 | package ai;
public abstract class AbstractMovementAI {
public abstract double[] getVelocities();
public double getXVelocity(){
return getVelocities()[0];
}
public double getYVelocity(){
return getVelocities()[1];
}
}
| 52 |
github-java-corpus | 2,012 | package ai;
import app.RPGGame;
import enemy.AbstractAttack;
import enemy.IEnemy;
import java.util.Comparator;
import java.util.HashMap;
import java.util.PriorityQueue;
public abstract class AbstractDecisionTableAI extends AbstractAI{
HashMap<String,HashMap<AbstractGameHeuristic,Integer>> decisionTable;
public ... | 597 |
github-java-corpus | 2,012 | package ai;
import app.RPGGame;
import enemy.IEnemy;
public class PlayerFasterThanEnemyHeuristic extends AbstractGameHeuristic {
public PlayerFasterThanEnemyHeuristic(RPGGame game, IEnemy enemy) {
super(game, enemy, "playerFaster");
}
@Override
public boolean getHeuristicBool() {
System.err.println(game.ge... | 126 |
github-java-corpus | 2,012 | package ai;
import java.util.HashMap;
import java.util.Iterator;
import app.RPGGame;
import enemy.AbstractAttack;
import enemy.IEnemy;
public class BetterAI extends AbstractAI{
public BetterAI(RPGGame game, IEnemy enemy) {
super(game, enemy);
}
@Override
public void act(long elapsedTime) {
if(!enemy.isDead(... | 437 |
github-java-corpus | 2,012 | package ai;
import java.util.ArrayList;
import java.util.List;
import level.Level;
import player.Player;
import app.RPGGame;
public abstract class AbstractGameState
implements Cloneable, Comparable<AbstractGameState> {
List<AbstractGameState> successors = new ArrayList<AbstractGameState>();
p... | 163 |
github-java-corpus | 2,012 | package ai;
import java.util.HashMap;
import java.util.Iterator;
import app.RPGGame;
import enemy.AbstractAttack;
import enemy.IEnemy;
public class SimpleAI extends AbstractAI {
public SimpleAI(RPGGame game, IEnemy enemy) {
super(game, enemy);
}
@Override
public void act(long elapsedTime) {
... | 343 |
github-java-corpus | 2,012 | package ai;
import enemy.IEnemy;
import app.RPGGame;
public abstract class AbstractGameHeuristic {
RPGGame game;
IEnemy enemy;
String conditionName;
public AbstractGameHeuristic(RPGGame game, IEnemy enemy, String conditionName){
this.game = game;
this.enemy = enemy;
this.conditionName = conditionName;
}... | 87 |
github-java-corpus | 2,012 | package dialogue;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
public class YesNoScriptGenerator {
Scanner myInput;
BufferedWriter myWriter;
public void generateScript() throws IO... | 401 |
github-java-corpus | 2,012 | package dialogue;
import java.io.File;
import com.golden.gamedev.util.FileUtil;
public abstract class AbstractDialogue {
public abstract void goToNextLine(DialogueObject choice);
public abstract String getCurrentLine();
public abstract boolean isDone();
String[] readFile(String url){
String[] lines = ... | 89 |
github-java-corpus | 2,012 | package dialogue;
public class Node {
public String info;
public Node left;
public Node right;
public Node(){
}
}
| 27 |
github-java-corpus | 2,012 | package dialogue;
public class YesNoDialogue extends AbstractDialogue{
private Node currentNode;
private int count;
public YesNoDialogue(String url){
String[] lines = readFile(url);
currentNode = generateTree(lines);
}
@Override
public void goToNextLine(DialogueObject choice) {
YesNoDialogueObject thi... | 298 |
github-java-corpus | 2,012 | package dialogue;
public class SimpleDialogue extends AbstractDialogue{
private String[] script;
private int index;
public SimpleDialogue(String url){
script = readFile(url);
index = 0;
}
public void goToNextLine(DialogueObject choice) {
if (!isDone())
index++;
}
public String getCurrentLine(){
... | 117 |
github-java-corpus | 2,012 | package saving_loading;
import app.RPGGame;
import level.Level;
public interface RWGameObject {
public boolean isThisKindOfObject(String objectTag);
public void createAndAddToMap(AttributeContainer attributeContainer, MapContainer maps, Level level, RPGGame game2);
}
| 58 |
github-java-corpus | 2,012 | package saving_loading;
import java.io.File;
import javax.swing.filechooser.FileFilter;
public class LoadFileFilter extends FileFilter {
private final String[] acceptedFileExts;
public LoadFileFilter(String[] acceptedFileExts){
this.acceptedFileExts = acceptedFileExts;
}
@Override
public boolean accept(File... | 136 |
github-java-corpus | 2,012 | package saving_loading;
import java.lang.reflect.Type;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
public class AttributeContainer {
/**
* A Map containing the names of attributes and JSON formatted Strings of ... | 501 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.