diff --git a/.classpath b/.classpath index 45f6ff8..dd14e7a 100644 --- a/.classpath +++ b/.classpath @@ -32,5 +32,6 @@ + diff --git a/LICENSE.txt b/LICENSE.txt index 2cf0918..fe55e0a 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,5 @@ -Copyright (c) 2014 Ondřej Hruška (MightyPork), +Copyright (c) 2014, Ondřej Hruška +Some rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -14,6 +15,7 @@ are met: 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. diff --git a/src/mightypork/gamecore/core/Config.java b/src/mightypork/gamecore/core/Config.java index dd085fe..406efaa 100644 --- a/src/mightypork/gamecore/core/Config.java +++ b/src/mightypork/gamecore/core/Config.java @@ -15,7 +15,7 @@ import mightypork.gamecore.util.files.config.PropertyManager; /** * Static application configuration * - * @author MightyPork + * @author Ondřej Hruška */ public class Config { @@ -63,7 +63,7 @@ public class Config { * Key property.
* The stored value must be invariant ({@link KeyStroke} is mutable). * - * @author MightyPork + * @author Ondřej Hruška */ public static class KeyProperty extends Property { diff --git a/src/mightypork/gamecore/core/WorkDir.java b/src/mightypork/gamecore/core/WorkDir.java index bd015cf..563f747 100644 --- a/src/mightypork/gamecore/core/WorkDir.java +++ b/src/mightypork/gamecore/core/WorkDir.java @@ -11,7 +11,7 @@ import mightypork.gamecore.logging.Log; /** * Static application workdir accessor. * - * @author MightyPork + * @author Ondřej Hruška */ public class WorkDir { diff --git a/src/mightypork/gamecore/core/events/MainLoopRequest.java b/src/mightypork/gamecore/core/events/MainLoopRequest.java index 277bbe4..55257b1 100644 --- a/src/mightypork/gamecore/core/events/MainLoopRequest.java +++ b/src/mightypork/gamecore/core/events/MainLoopRequest.java @@ -9,7 +9,7 @@ import mightypork.gamecore.eventbus.event_flags.SingleReceiverEvent; /** * Request to execute given {@link Runnable} in main loop. * - * @author MightyPork + * @author Ondřej Hruška */ @SingleReceiverEvent public class MainLoopRequest extends BusEvent { diff --git a/src/mightypork/gamecore/core/events/ShudownRequest.java b/src/mightypork/gamecore/core/events/ShudownRequest.java index 73fbb8c..c238cc4 100644 --- a/src/mightypork/gamecore/core/events/ShudownRequest.java +++ b/src/mightypork/gamecore/core/events/ShudownRequest.java @@ -5,14 +5,13 @@ import mightypork.gamecore.core.modules.MainLoop; import mightypork.gamecore.eventbus.BusEvent; import mightypork.gamecore.eventbus.event_flags.NonConsumableEvent; import mightypork.gamecore.eventbus.event_flags.SingleReceiverEvent; -import mightypork.gamecore.resources.audio.SoundSystem; /** * Shutdown request, non-interactive. Shutdown needs to execute on GL thread for * display to deinit properly. * - * @author MightyPork + * @author Ondřej Hruška */ @SingleReceiverEvent @NonConsumableEvent diff --git a/src/mightypork/gamecore/core/events/UserQuitRequest.java b/src/mightypork/gamecore/core/events/UserQuitRequest.java index ba571b3..8828303 100644 --- a/src/mightypork/gamecore/core/events/UserQuitRequest.java +++ b/src/mightypork/gamecore/core/events/UserQuitRequest.java @@ -10,7 +10,7 @@ import mightypork.gamecore.eventbus.EventBus; * titlebar button, and if no client consumes it, the application will be shut * down. * - * @author MightyPork + * @author Ondřej Hruška */ public class UserQuitRequest extends BusEvent { diff --git a/src/mightypork/gamecore/core/events/UserQuitRequestListener.java b/src/mightypork/gamecore/core/events/UserQuitRequestListener.java index 45fd94c..b97a995 100644 --- a/src/mightypork/gamecore/core/events/UserQuitRequestListener.java +++ b/src/mightypork/gamecore/core/events/UserQuitRequestListener.java @@ -4,7 +4,7 @@ package mightypork.gamecore.core.events; /** * Quit request listener; implementing client can abort shutdown. * - * @author MightyPork + * @author Ondřej Hruška */ public interface UserQuitRequestListener { diff --git a/src/mightypork/gamecore/core/modules/AppAccess.java b/src/mightypork/gamecore/core/modules/AppAccess.java index 05faf43..eede2a7 100644 --- a/src/mightypork/gamecore/core/modules/AppAccess.java +++ b/src/mightypork/gamecore/core/modules/AppAccess.java @@ -10,7 +10,7 @@ import mightypork.gamecore.resources.audio.SoundSystem; /** * App interface visible to subsystems * - * @author MightyPork + * @author Ondřej Hruška */ public interface AppAccess extends BusAccess { diff --git a/src/mightypork/gamecore/core/modules/AppAccessAdapter.java b/src/mightypork/gamecore/core/modules/AppAccessAdapter.java index faceb51..a6a825a 100644 --- a/src/mightypork/gamecore/core/modules/AppAccessAdapter.java +++ b/src/mightypork/gamecore/core/modules/AppAccessAdapter.java @@ -10,7 +10,7 @@ import mightypork.gamecore.resources.audio.SoundSystem; /** * App access adapter (defualt {@link AppAccess} implementation) * - * @author MightyPork + * @author Ondřej Hruška */ public class AppAccessAdapter implements AppAccess { diff --git a/src/mightypork/gamecore/core/modules/AppModule.java b/src/mightypork/gamecore/core/modules/AppModule.java index 35cf15d..9b1db57 100644 --- a/src/mightypork/gamecore/core/modules/AppModule.java +++ b/src/mightypork/gamecore/core/modules/AppModule.java @@ -11,7 +11,7 @@ import mightypork.gamecore.resources.audio.SoundSystem; * App event bus client, to be used for subsystems, screens and anything that * needs access to the eventbus and other systems; Attached directly to bus. * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class AppModule extends RootBusNode implements AppAccess { diff --git a/src/mightypork/gamecore/core/modules/AppSubModule.java b/src/mightypork/gamecore/core/modules/AppSubModule.java index 5e91002..bf32a83 100644 --- a/src/mightypork/gamecore/core/modules/AppSubModule.java +++ b/src/mightypork/gamecore/core/modules/AppSubModule.java @@ -13,7 +13,7 @@ import mightypork.gamecore.resources.audio.SoundSystem; * Delegating bus client, to be attached to any {@link DelegatingClient}, such * as a {@link RootBusNode}. * - * @author MightyPork + * @author Ondřej Hruška */ public class AppSubModule extends BusNode implements AppAccess { diff --git a/src/mightypork/gamecore/core/modules/BaseApp.java b/src/mightypork/gamecore/core/modules/BaseApp.java index 464ee39..3dd93d0 100644 --- a/src/mightypork/gamecore/core/modules/BaseApp.java +++ b/src/mightypork/gamecore/core/modules/BaseApp.java @@ -11,9 +11,9 @@ import java.util.logging.Level; import javax.swing.JOptionPane; import mightypork.gamecore.core.Config; -import mightypork.gamecore.core.WorkDir; import mightypork.gamecore.core.Config.ConfigSetup; import mightypork.gamecore.core.Config.KeySetup; +import mightypork.gamecore.core.WorkDir; import mightypork.gamecore.core.WorkDir.RouteSetup; import mightypork.gamecore.eventbus.EventBus; import mightypork.gamecore.eventbus.events.DestroyEvent; @@ -31,16 +31,16 @@ import mightypork.gamecore.resources.ResourceSetup; import mightypork.gamecore.resources.audio.SoundSystem; import mightypork.gamecore.util.annot.DefaultImpl; import mightypork.gamecore.util.files.InstanceLock; -import mightypork.gamecore.util.ion.Ion; import mightypork.gamecore.util.math.algo.Coord; import mightypork.gamecore.util.math.algo.Move; +import mightypork.ion.Ion; /** * Basic screen-based game with subsystems.
* This class takes care of the initialization sequence. * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class BaseApp implements AppAccess, UncaughtExceptionHandler { @@ -320,8 +320,8 @@ public abstract class BaseApp implements AppAccess, UncaughtExceptionHandler { { logSystemInfo(); } - - + + protected void logSystemInfo() { String txt = ""; @@ -344,8 +344,8 @@ public abstract class BaseApp implements AppAccess, UncaughtExceptionHandler { protected void registerIonizables() { - Ion.registerType(Coord.ION_MARK, Coord.class); - Ion.registerType(Move.ION_MARK, Move.class); + Ion.register(Coord.class); + Ion.register(Move.class); } diff --git a/src/mightypork/gamecore/core/modules/MainLoop.java b/src/mightypork/gamecore/core/modules/MainLoop.java index 03e29dd..86ab3fb 100644 --- a/src/mightypork/gamecore/core/modules/MainLoop.java +++ b/src/mightypork/gamecore/core/modules/MainLoop.java @@ -2,9 +2,7 @@ package mightypork.gamecore.core.modules; import java.util.Deque; -import java.util.Queue; import java.util.concurrent.ConcurrentLinkedDeque; -import java.util.concurrent.ConcurrentLinkedQueue; import mightypork.gamecore.eventbus.events.UpdateEvent; import mightypork.gamecore.gui.screens.ScreenRegistry; @@ -21,7 +19,7 @@ import mightypork.gamecore.util.math.timing.TimerDelta; /** * Delta-timed game loop with task queue etc. * - * @author MightyPork + * @author Ondřej Hruška */ public class MainLoop extends AppModule implements ScreenshotRequestListener { @@ -74,7 +72,7 @@ public class MainLoop extends AppModule implements ScreenshotRequestListener { getEventBus().sendDirect(new UpdateEvent(delta)); Runnable r; - long t = Profiler.begin(); + final long t = Profiler.begin(); while ((r = tasks.poll()) != null) { Log.f3(" * Main loop task."); r.run(); diff --git a/src/mightypork/gamecore/eventbus/BusAccess.java b/src/mightypork/gamecore/eventbus/BusAccess.java index dbd2718..31c4770 100644 --- a/src/mightypork/gamecore/eventbus/BusAccess.java +++ b/src/mightypork/gamecore/eventbus/BusAccess.java @@ -4,7 +4,7 @@ package mightypork.gamecore.eventbus; /** * Access to an {@link EventBus} instance * - * @author MightyPork + * @author Ondřej Hruška */ public interface BusAccess { diff --git a/src/mightypork/gamecore/eventbus/BusEvent.java b/src/mightypork/gamecore/eventbus/BusEvent.java index 99e36c5..7cfd9d6 100644 --- a/src/mightypork/gamecore/eventbus/BusEvent.java +++ b/src/mightypork/gamecore/eventbus/BusEvent.java @@ -27,7 +27,7 @@ import mightypork.gamecore.eventbus.event_flags.SingleReceiverEvent; * zero delay. *

* - * @author MightyPork + * @author Ondřej Hruška * @param handler type */ public abstract class BusEvent { diff --git a/src/mightypork/gamecore/eventbus/EventBus.java b/src/mightypork/gamecore/eventbus/EventBus.java index b8ff901..b509ae8 100644 --- a/src/mightypork/gamecore/eventbus/EventBus.java +++ b/src/mightypork/gamecore/eventbus/EventBus.java @@ -7,7 +7,6 @@ import java.util.Collection; import java.util.Collections; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentLinkedDeque; import java.util.concurrent.DelayQueue; import java.util.concurrent.Delayed; import java.util.concurrent.TimeUnit; @@ -25,7 +24,7 @@ import mightypork.gamecore.util.Utils; * An event bus, accommodating multiple EventChannels.
* Channel will be created when an event of type is first encountered. * - * @author MightyPork + * @author Ondřej Hruška */ final public class EventBus implements Destroyable, BusAccess { @@ -135,13 +134,13 @@ final public class EventBus implements Destroyable, BusAccess { private final QueuePollingThread busThread; /** Registered clients */ - private final Set clients = Collections.newSetFromMap(new ConcurrentHashMap()); + private final Set clients = Collections.newSetFromMap(new ConcurrentHashMap()); /** Whether the bus was destroyed */ private boolean dead = false; /** Message channels */ - private final Set> channels = Collections.newSetFromMap(new ConcurrentHashMap,Boolean>()); + private final Set> channels = Collections.newSetFromMap(new ConcurrentHashMap, Boolean>()); /** Messages queued for delivery */ private final DelayQueue sendQueue = new DelayQueue<>(); diff --git a/src/mightypork/gamecore/eventbus/EventChannel.java b/src/mightypork/gamecore/eventbus/EventChannel.java index fbd6d55..0c9f2eb 100644 --- a/src/mightypork/gamecore/eventbus/EventChannel.java +++ b/src/mightypork/gamecore/eventbus/EventChannel.java @@ -14,7 +14,7 @@ import mightypork.gamecore.util.Utils; /** * Event delivery channel, module of {@link EventBus} * - * @author MightyPork + * @author Ondřej Hruška * @param event type * @param client (subscriber) type */ diff --git a/src/mightypork/gamecore/eventbus/clients/BusNode.java b/src/mightypork/gamecore/eventbus/clients/BusNode.java index 44e2430..d9a7f13 100644 --- a/src/mightypork/gamecore/eventbus/clients/BusNode.java +++ b/src/mightypork/gamecore/eventbus/clients/BusNode.java @@ -13,7 +13,7 @@ import mightypork.gamecore.eventbus.EventBus; * Client that can be attached to the {@link EventBus}, or added as a child * client to another {@link DelegatingClient} * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class BusNode implements BusAccess, ClientHub { diff --git a/src/mightypork/gamecore/eventbus/clients/ClientHub.java b/src/mightypork/gamecore/eventbus/clients/ClientHub.java index 279770b..4776789 100644 --- a/src/mightypork/gamecore/eventbus/clients/ClientHub.java +++ b/src/mightypork/gamecore/eventbus/clients/ClientHub.java @@ -9,7 +9,7 @@ import mightypork.gamecore.eventbus.EventBus; /** * Common methods for client hubs (ie delegating vlient implementations) * - * @author MightyPork + * @author Ondřej Hruška */ public interface ClientHub extends DelegatingClient, ToggleableClient { diff --git a/src/mightypork/gamecore/eventbus/clients/ClientList.java b/src/mightypork/gamecore/eventbus/clients/ClientList.java index 4d7764f..d47a21c 100644 --- a/src/mightypork/gamecore/eventbus/clients/ClientList.java +++ b/src/mightypork/gamecore/eventbus/clients/ClientList.java @@ -7,7 +7,7 @@ import java.util.ArrayList; /** * Array-list with varargs constructor * - * @author MightyPork + * @author Ondřej Hruška */ public class ClientList extends ArrayList { diff --git a/src/mightypork/gamecore/eventbus/clients/DelegatingClient.java b/src/mightypork/gamecore/eventbus/clients/DelegatingClient.java index 2f352b8..e157310 100644 --- a/src/mightypork/gamecore/eventbus/clients/DelegatingClient.java +++ b/src/mightypork/gamecore/eventbus/clients/DelegatingClient.java @@ -9,7 +9,7 @@ import java.util.Collection; * of clients is ordered, the clients will be served in that order. In any case, * the {@link DelegatingClient} itself will be served beforehand. * - * @author MightyPork + * @author Ondřej Hruška */ public interface DelegatingClient { diff --git a/src/mightypork/gamecore/eventbus/clients/DelegatingList.java b/src/mightypork/gamecore/eventbus/clients/DelegatingList.java index 926990c..eac6765 100644 --- a/src/mightypork/gamecore/eventbus/clients/DelegatingList.java +++ b/src/mightypork/gamecore/eventbus/clients/DelegatingList.java @@ -9,7 +9,7 @@ import mightypork.gamecore.gui.Enableable; /** * Basic delegating client * - * @author MightyPork + * @author Ondřej Hruška */ public class DelegatingList extends ClientList implements DelegatingClient, Enableable { diff --git a/src/mightypork/gamecore/eventbus/clients/RootBusNode.java b/src/mightypork/gamecore/eventbus/clients/RootBusNode.java index 4e543b3..5fd1402 100644 --- a/src/mightypork/gamecore/eventbus/clients/RootBusNode.java +++ b/src/mightypork/gamecore/eventbus/clients/RootBusNode.java @@ -9,7 +9,7 @@ import mightypork.gamecore.util.annot.DefaultImpl; /** * Bus node that should be directly attached to the bus. * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class RootBusNode extends BusNode implements Destroyable { diff --git a/src/mightypork/gamecore/eventbus/clients/ToggleableClient.java b/src/mightypork/gamecore/eventbus/clients/ToggleableClient.java index 3bc6286..c5e85e2 100644 --- a/src/mightypork/gamecore/eventbus/clients/ToggleableClient.java +++ b/src/mightypork/gamecore/eventbus/clients/ToggleableClient.java @@ -4,7 +4,7 @@ package mightypork.gamecore.eventbus.clients; /** * Client that can toggle receiving messages. * - * @author MightyPork + * @author Ondřej Hruška */ public interface ToggleableClient { diff --git a/src/mightypork/gamecore/eventbus/event_flags/DelayedEvent.java b/src/mightypork/gamecore/eventbus/event_flags/DelayedEvent.java index 7644645..a55c287 100644 --- a/src/mightypork/gamecore/eventbus/event_flags/DelayedEvent.java +++ b/src/mightypork/gamecore/eventbus/event_flags/DelayedEvent.java @@ -7,7 +7,7 @@ import java.lang.annotation.*; /** * Event that should be queued with given delay (default: 0); * - * @author MightyPork + * @author Ondřej Hruška */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/src/mightypork/gamecore/eventbus/event_flags/DirectEvent.java b/src/mightypork/gamecore/eventbus/event_flags/DirectEvent.java index 5961b2e..7e97d84 100644 --- a/src/mightypork/gamecore/eventbus/event_flags/DirectEvent.java +++ b/src/mightypork/gamecore/eventbus/event_flags/DirectEvent.java @@ -7,7 +7,7 @@ import java.lang.annotation.*; /** * Event that should not be queued. * - * @author MightyPork + * @author Ondřej Hruška */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/src/mightypork/gamecore/eventbus/event_flags/NonConsumableEvent.java b/src/mightypork/gamecore/eventbus/event_flags/NonConsumableEvent.java index adc2888..866cd67 100644 --- a/src/mightypork/gamecore/eventbus/event_flags/NonConsumableEvent.java +++ b/src/mightypork/gamecore/eventbus/event_flags/NonConsumableEvent.java @@ -11,7 +11,7 @@ import java.lang.annotation.Target; /** * Event that cannot be consumed * - * @author MightyPork + * @author Ondřej Hruška */ @Retention(RetentionPolicy.RUNTIME) @Documented diff --git a/src/mightypork/gamecore/eventbus/event_flags/NonRejectableEvent.java b/src/mightypork/gamecore/eventbus/event_flags/NonRejectableEvent.java index 87decb0..4271b6e 100644 --- a/src/mightypork/gamecore/eventbus/event_flags/NonRejectableEvent.java +++ b/src/mightypork/gamecore/eventbus/event_flags/NonRejectableEvent.java @@ -11,7 +11,7 @@ import java.lang.annotation.Target; /** * Event that is forcibly delivered to all clients (bypass Toggleable etc) * - * @author MightyPork + * @author Ondřej Hruška */ @Retention(RetentionPolicy.RUNTIME) @Documented diff --git a/src/mightypork/gamecore/eventbus/event_flags/NotLoggedEvent.java b/src/mightypork/gamecore/eventbus/event_flags/NotLoggedEvent.java index 1497e16..ec7519c 100644 --- a/src/mightypork/gamecore/eventbus/event_flags/NotLoggedEvent.java +++ b/src/mightypork/gamecore/eventbus/event_flags/NotLoggedEvent.java @@ -8,7 +8,7 @@ import java.lang.annotation.*; * Event that's not worth logging, unless there was an error with it.
* Useful for common events that would otherwise clutter the log. * - * @author MightyPork + * @author Ondřej Hruška */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/src/mightypork/gamecore/eventbus/event_flags/SingleReceiverEvent.java b/src/mightypork/gamecore/eventbus/event_flags/SingleReceiverEvent.java index ba5a289..73c6ed1 100644 --- a/src/mightypork/gamecore/eventbus/event_flags/SingleReceiverEvent.java +++ b/src/mightypork/gamecore/eventbus/event_flags/SingleReceiverEvent.java @@ -7,7 +7,7 @@ import java.lang.annotation.*; /** * Handled only by the first client, then discarded. * - * @author MightyPork + * @author Ondřej Hruška */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/src/mightypork/gamecore/eventbus/events/DestroyEvent.java b/src/mightypork/gamecore/eventbus/events/DestroyEvent.java index e334f62..d7e55cb 100644 --- a/src/mightypork/gamecore/eventbus/events/DestroyEvent.java +++ b/src/mightypork/gamecore/eventbus/events/DestroyEvent.java @@ -9,7 +9,7 @@ import mightypork.gamecore.eventbus.event_flags.NonConsumableEvent; /** * Invoke destroy() method of all subscribers. Used to deinit a system. * - * @author MightyPork + * @author Ondřej Hruška */ @DirectEvent @NonConsumableEvent diff --git a/src/mightypork/gamecore/eventbus/events/Destroyable.java b/src/mightypork/gamecore/eventbus/events/Destroyable.java index 01c5a4a..e0bb79d 100644 --- a/src/mightypork/gamecore/eventbus/events/Destroyable.java +++ b/src/mightypork/gamecore/eventbus/events/Destroyable.java @@ -4,7 +4,7 @@ package mightypork.gamecore.eventbus.events; /** * Object that can be destroyed (free resources etc) * - * @author MightyPork + * @author Ondřej Hruška */ public interface Destroyable { diff --git a/src/mightypork/gamecore/eventbus/events/UpdateEvent.java b/src/mightypork/gamecore/eventbus/events/UpdateEvent.java index 422ab34..206d98b 100644 --- a/src/mightypork/gamecore/eventbus/events/UpdateEvent.java +++ b/src/mightypork/gamecore/eventbus/events/UpdateEvent.java @@ -10,7 +10,7 @@ import mightypork.gamecore.eventbus.event_flags.NotLoggedEvent; /** * Delta timing update event. Not logged. * - * @author MightyPork + * @author Ondřej Hruška */ @NotLoggedEvent @DirectEvent diff --git a/src/mightypork/gamecore/eventbus/events/Updateable.java b/src/mightypork/gamecore/eventbus/events/Updateable.java index e6050a2..219e5d5 100644 --- a/src/mightypork/gamecore/eventbus/events/Updateable.java +++ b/src/mightypork/gamecore/eventbus/events/Updateable.java @@ -4,7 +4,7 @@ package mightypork.gamecore.eventbus.events; /** * Uses delta timing * - * @author MightyPork + * @author Ondřej Hruška */ public interface Updateable { diff --git a/src/mightypork/gamecore/gui/Action.java b/src/mightypork/gamecore/gui/Action.java index 191f1f4..07c6133 100644 --- a/src/mightypork/gamecore/gui/Action.java +++ b/src/mightypork/gamecore/gui/Action.java @@ -4,7 +4,7 @@ package mightypork.gamecore.gui; /** * Triggered action * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class Action implements Runnable, Enableable { diff --git a/src/mightypork/gamecore/gui/ActionTrigger.java b/src/mightypork/gamecore/gui/ActionTrigger.java index 4a6ff27..38da682 100644 --- a/src/mightypork/gamecore/gui/ActionTrigger.java +++ b/src/mightypork/gamecore/gui/ActionTrigger.java @@ -4,7 +4,7 @@ package mightypork.gamecore.gui; /** * Element that can be assigned an action (ie. button); * - * @author MightyPork + * @author Ondřej Hruška */ public interface ActionTrigger { diff --git a/src/mightypork/gamecore/gui/AlignX.java b/src/mightypork/gamecore/gui/AlignX.java index 4d541b9..f6fb554 100644 --- a/src/mightypork/gamecore/gui/AlignX.java +++ b/src/mightypork/gamecore/gui/AlignX.java @@ -4,7 +4,7 @@ package mightypork.gamecore.gui; /** * Horizontal align sides * - * @author MightyPork + * @author Ondřej Hruška */ public enum AlignX { diff --git a/src/mightypork/gamecore/gui/AlignY.java b/src/mightypork/gamecore/gui/AlignY.java index 888734f..4f99016 100644 --- a/src/mightypork/gamecore/gui/AlignY.java +++ b/src/mightypork/gamecore/gui/AlignY.java @@ -4,7 +4,7 @@ package mightypork.gamecore.gui; /** * Vertical align sides * - * @author MightyPork + * @author Ondřej Hruška */ public enum AlignY { diff --git a/src/mightypork/gamecore/gui/Enableable.java b/src/mightypork/gamecore/gui/Enableable.java index 29ba0d9..072387f 100644 --- a/src/mightypork/gamecore/gui/Enableable.java +++ b/src/mightypork/gamecore/gui/Enableable.java @@ -6,7 +6,7 @@ package mightypork.gamecore.gui; * Implementations should take appropriate action (ie. stop listening to events, * updating etc.) * - * @author MightyPork + * @author Ondřej Hruška */ public interface Enableable { diff --git a/src/mightypork/gamecore/gui/Hideable.java b/src/mightypork/gamecore/gui/Hideable.java index 62837c0..a18c6a7 100644 --- a/src/mightypork/gamecore/gui/Hideable.java +++ b/src/mightypork/gamecore/gui/Hideable.java @@ -4,7 +4,7 @@ package mightypork.gamecore.gui; /** * Element that can be hidden or visible * - * @author MightyPork + * @author Ondřej Hruška */ public interface Hideable { diff --git a/src/mightypork/gamecore/gui/components/BaseComponent.java b/src/mightypork/gamecore/gui/components/BaseComponent.java index 690af5e..ae3f2af 100644 --- a/src/mightypork/gamecore/gui/components/BaseComponent.java +++ b/src/mightypork/gamecore/gui/components/BaseComponent.java @@ -20,7 +20,7 @@ import mightypork.gamecore.util.math.constraints.rect.proxy.RectBoundAdapter; * {@link Renderable} with pluggable context. When caching is enabled, the * layout update can be triggered by firing the {@link LayoutChangeEvent}. * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class BaseComponent extends AbstractRectCache implements Component, LayoutChangeListener, Enableable { diff --git a/src/mightypork/gamecore/gui/components/Component.java b/src/mightypork/gamecore/gui/components/Component.java index fda0e5f..60cbeab 100644 --- a/src/mightypork/gamecore/gui/components/Component.java +++ b/src/mightypork/gamecore/gui/components/Component.java @@ -9,7 +9,7 @@ import mightypork.gamecore.util.math.constraints.num.Num; /** * Basic UI component interface * - * @author MightyPork + * @author Ondřej Hruška */ public interface Component extends Enableable, Hideable, PluggableRenderable { diff --git a/src/mightypork/gamecore/gui/components/PluggableRenderable.java b/src/mightypork/gamecore/gui/components/PluggableRenderable.java index cad978a..a06ec03 100644 --- a/src/mightypork/gamecore/gui/components/PluggableRenderable.java +++ b/src/mightypork/gamecore/gui/components/PluggableRenderable.java @@ -10,7 +10,7 @@ import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; /** * Renderable that can be assigned different context * - * @author MightyPork + * @author Ondřej Hruška */ public interface PluggableRenderable extends Renderable, PluggableRectBound { diff --git a/src/mightypork/gamecore/gui/components/input/TextButton.java b/src/mightypork/gamecore/gui/components/input/TextButton.java index 9988709..555c7f7 100644 --- a/src/mightypork/gamecore/gui/components/input/TextButton.java +++ b/src/mightypork/gamecore/gui/components/input/TextButton.java @@ -15,7 +15,7 @@ import mightypork.gamecore.util.math.constraints.vect.mutable.VectVar; /** * Menu-like button with shadow and push state * - * @author MightyPork + * @author Ondřej Hruška */ public class TextButton extends ClickableComponent implements DynamicWidthComponent { diff --git a/src/mightypork/gamecore/gui/components/layout/ConstraintLayout.java b/src/mightypork/gamecore/gui/components/layout/ConstraintLayout.java index d00dbde..8639647 100644 --- a/src/mightypork/gamecore/gui/components/layout/ConstraintLayout.java +++ b/src/mightypork/gamecore/gui/components/layout/ConstraintLayout.java @@ -10,7 +10,7 @@ import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; /** * Layout for components with arbitrary constraints. * - * @author MightyPork + * @author Ondřej Hruška */ public class ConstraintLayout extends LayoutComponent { diff --git a/src/mightypork/gamecore/gui/components/layout/FlowColumnLayout.java b/src/mightypork/gamecore/gui/components/layout/FlowColumnLayout.java index 78cb207..e9630b4 100644 --- a/src/mightypork/gamecore/gui/components/layout/FlowColumnLayout.java +++ b/src/mightypork/gamecore/gui/components/layout/FlowColumnLayout.java @@ -13,7 +13,7 @@ import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; /** * Holder with same-sized columns, aligned to left or right * - * @author MightyPork + * @author Ondřej Hruška */ public class FlowColumnLayout extends LayoutComponent { diff --git a/src/mightypork/gamecore/gui/components/layout/FlowRowLayout.java b/src/mightypork/gamecore/gui/components/layout/FlowRowLayout.java index 31f1cfe..0480e26 100644 --- a/src/mightypork/gamecore/gui/components/layout/FlowRowLayout.java +++ b/src/mightypork/gamecore/gui/components/layout/FlowRowLayout.java @@ -13,7 +13,7 @@ import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; /** * Holder with same-sized rows, aligned to top or bottom * - * @author MightyPork + * @author Ondřej Hruška */ public class FlowRowLayout extends LayoutComponent { diff --git a/src/mightypork/gamecore/gui/components/layout/GridLayout.java b/src/mightypork/gamecore/gui/components/layout/GridLayout.java index 8eaed63..235cb14 100644 --- a/src/mightypork/gamecore/gui/components/layout/GridLayout.java +++ b/src/mightypork/gamecore/gui/components/layout/GridLayout.java @@ -11,7 +11,7 @@ import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; /** * Holder with table cells * - * @author MightyPork + * @author Ondřej Hruška */ public class GridLayout extends LayoutComponent { diff --git a/src/mightypork/gamecore/gui/components/layout/NullComponent.java b/src/mightypork/gamecore/gui/components/layout/NullComponent.java index 3aa753f..cea279a 100644 --- a/src/mightypork/gamecore/gui/components/layout/NullComponent.java +++ b/src/mightypork/gamecore/gui/components/layout/NullComponent.java @@ -7,7 +7,7 @@ import mightypork.gamecore.gui.components.BaseComponent; /** * Invisible component that does nothing at all; Null object pattern * - * @author MightyPork + * @author Ondřej Hruška */ public class NullComponent extends BaseComponent { diff --git a/src/mightypork/gamecore/gui/components/layout/linear/AbstractLinearWrapper.java b/src/mightypork/gamecore/gui/components/layout/linear/AbstractLinearWrapper.java index 9c19418..507c36f 100644 --- a/src/mightypork/gamecore/gui/components/layout/linear/AbstractLinearWrapper.java +++ b/src/mightypork/gamecore/gui/components/layout/linear/AbstractLinearWrapper.java @@ -12,7 +12,7 @@ import mightypork.gamecore.gui.components.LinearComponent; /** * Converts a component into a linear component * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class AbstractLinearWrapper extends LinearComponent implements DelegatingClient { diff --git a/src/mightypork/gamecore/gui/components/layout/linear/LinearGap.java b/src/mightypork/gamecore/gui/components/layout/linear/LinearGap.java index 520856f..807651d 100644 --- a/src/mightypork/gamecore/gui/components/layout/linear/LinearGap.java +++ b/src/mightypork/gamecore/gui/components/layout/linear/LinearGap.java @@ -8,7 +8,7 @@ import mightypork.gamecore.util.math.constraints.num.Num; /** * Gap in linear layout * - * @author MightyPork + * @author Ondřej Hruška */ public class LinearGap extends LinearRectangle { diff --git a/src/mightypork/gamecore/gui/components/painters/ImagePainter.java b/src/mightypork/gamecore/gui/components/painters/ImagePainter.java index 89ca4c3..1692aac 100644 --- a/src/mightypork/gamecore/gui/components/painters/ImagePainter.java +++ b/src/mightypork/gamecore/gui/components/painters/ImagePainter.java @@ -10,7 +10,7 @@ import mightypork.gamecore.resources.textures.TxQuad; /** * Draws image in given rect * - * @author MightyPork + * @author Ondřej Hruška */ public class ImagePainter extends BaseComponent implements DynamicWidthComponent { diff --git a/src/mightypork/gamecore/gui/components/painters/QuadPainter.java b/src/mightypork/gamecore/gui/components/painters/QuadPainter.java index e64f090..9448a90 100644 --- a/src/mightypork/gamecore/gui/components/painters/QuadPainter.java +++ b/src/mightypork/gamecore/gui/components/painters/QuadPainter.java @@ -10,7 +10,7 @@ import mightypork.gamecore.util.math.color.Color; /** * Draws image in given rect * - * @author MightyPork + * @author Ondřej Hruška */ public class QuadPainter extends BaseComponent { diff --git a/src/mightypork/gamecore/gui/components/painters/TextPainter.java b/src/mightypork/gamecore/gui/components/painters/TextPainter.java index 374f645..2b79940 100644 --- a/src/mightypork/gamecore/gui/components/painters/TextPainter.java +++ b/src/mightypork/gamecore/gui/components/painters/TextPainter.java @@ -19,7 +19,7 @@ import mightypork.gamecore.util.strings.StringWrapper; /** * Text painting component. * - * @author MightyPork + * @author Ondřej Hruška */ public class TextPainter extends BaseComponent implements DynamicWidthComponent { diff --git a/src/mightypork/gamecore/gui/events/LayoutChangeEvent.java b/src/mightypork/gamecore/gui/events/LayoutChangeEvent.java index 3125f15..9b6f7ae 100644 --- a/src/mightypork/gamecore/gui/events/LayoutChangeEvent.java +++ b/src/mightypork/gamecore/gui/events/LayoutChangeEvent.java @@ -11,7 +11,7 @@ import mightypork.gamecore.eventbus.event_flags.NonRejectableEvent; * Intended use is to notify UI component sub-clients that they should poll * their cached constraints. * - * @author MightyPork + * @author Ondřej Hruška */ @DirectEvent @NonConsumableEvent diff --git a/src/mightypork/gamecore/gui/events/ScreenRequest.java b/src/mightypork/gamecore/gui/events/ScreenRequest.java index fe42b41..f160b9e 100644 --- a/src/mightypork/gamecore/gui/events/ScreenRequest.java +++ b/src/mightypork/gamecore/gui/events/ScreenRequest.java @@ -8,7 +8,7 @@ import mightypork.gamecore.eventbus.event_flags.SingleReceiverEvent; /** * Request to change screen * - * @author MightyPork + * @author Ondřej Hruška */ @SingleReceiverEvent public class ScreenRequest extends BusEvent { diff --git a/src/mightypork/gamecore/gui/events/ScreenRequestListener.java b/src/mightypork/gamecore/gui/events/ScreenRequestListener.java index 86a141c..5c3a081 100644 --- a/src/mightypork/gamecore/gui/events/ScreenRequestListener.java +++ b/src/mightypork/gamecore/gui/events/ScreenRequestListener.java @@ -4,7 +4,7 @@ package mightypork.gamecore.gui.events; /** * {@link ScreenRequest} listener * - * @author MightyPork + * @author Ondřej Hruška */ public interface ScreenRequestListener { diff --git a/src/mightypork/gamecore/gui/screens/LayeredScreen.java b/src/mightypork/gamecore/gui/screens/LayeredScreen.java index eeea5ff..bc3e013 100644 --- a/src/mightypork/gamecore/gui/screens/LayeredScreen.java +++ b/src/mightypork/gamecore/gui/screens/LayeredScreen.java @@ -14,14 +14,14 @@ import mightypork.gamecore.eventbus.clients.DelegatingClient; /** * Screen with multiple instances of {@link ScreenLayer} * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class LayeredScreen extends Screen { /** * Wrapper for delegating client, to use custom client ordering. * - * @author MightyPork + * @author Ondřej Hruška */ private class LayersClient implements DelegatingClient { diff --git a/src/mightypork/gamecore/gui/screens/Overlay.java b/src/mightypork/gamecore/gui/screens/Overlay.java index 3d0f454..d9b840b 100644 --- a/src/mightypork/gamecore/gui/screens/Overlay.java +++ b/src/mightypork/gamecore/gui/screens/Overlay.java @@ -26,7 +26,7 @@ import mightypork.gamecore.util.math.constraints.vect.Vect; * Abstract overlay.
* Overlay is connected to event bus and is renderable. * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class Overlay extends AppSubModule implements Comparable, Updateable, Renderable, KeyBinder, Hideable, Enableable, LayoutChangeListener { diff --git a/src/mightypork/gamecore/gui/screens/Screen.java b/src/mightypork/gamecore/gui/screens/Screen.java index c782f96..fb35da1 100644 --- a/src/mightypork/gamecore/gui/screens/Screen.java +++ b/src/mightypork/gamecore/gui/screens/Screen.java @@ -20,7 +20,7 @@ import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; /** * Screen class. * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class Screen extends AppSubModule implements Renderable, RectBound, KeyBinder, LayoutChangeListener { diff --git a/src/mightypork/gamecore/gui/screens/ScreenLayer.java b/src/mightypork/gamecore/gui/screens/ScreenLayer.java index f445e30..ad017aa 100644 --- a/src/mightypork/gamecore/gui/screens/ScreenLayer.java +++ b/src/mightypork/gamecore/gui/screens/ScreenLayer.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.annot.DefaultImpl; /** * Screen display layer * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class ScreenLayer extends Overlay { diff --git a/src/mightypork/gamecore/gui/screens/ScreenRegistry.java b/src/mightypork/gamecore/gui/screens/ScreenRegistry.java index a95918c..fd9d7ea 100644 --- a/src/mightypork/gamecore/gui/screens/ScreenRegistry.java +++ b/src/mightypork/gamecore/gui/screens/ScreenRegistry.java @@ -6,8 +6,6 @@ import java.util.HashMap; import java.util.Map; import java.util.TreeSet; -import org.newdawn.slick.opengl.GLUtils; - import mightypork.gamecore.core.modules.AppAccess; import mightypork.gamecore.core.modules.AppModule; import mightypork.gamecore.gui.events.LayoutChangeEvent; @@ -22,7 +20,7 @@ import mightypork.gamecore.util.annot.DefaultImpl; /** * Game screens holder; Takes care of rendering and screen requests. * - * @author MightyPork + * @author Ondřej Hruška */ public class ScreenRegistry extends AppModule implements ScreenRequestListener, ViewportChangeListener, Renderable { @@ -114,7 +112,7 @@ public class ScreenRegistry extends AppModule implements ScreenRequestListener, @Override public void onViewportChanged(ViewportChangeEvent event) { - if(active != null) fireLayoutUpdateEvent(); + if (active != null) fireLayoutUpdateEvent(); } diff --git a/src/mightypork/gamecore/gui/screens/impl/CrossfadeOverlay.java b/src/mightypork/gamecore/gui/screens/impl/CrossfadeOverlay.java index b13b18d..364124d 100644 --- a/src/mightypork/gamecore/gui/screens/impl/CrossfadeOverlay.java +++ b/src/mightypork/gamecore/gui/screens/impl/CrossfadeOverlay.java @@ -15,7 +15,7 @@ import mightypork.gamecore.util.math.timing.TimedTask; /** * Overlay used for cross-fading between screens * - * @author MightyPork + * @author Ondřej Hruška */ public class CrossfadeOverlay extends Overlay { @@ -67,7 +67,7 @@ public class CrossfadeOverlay extends Overlay { { requestedScreenName = screen; - if(screen == null) { + if (screen == null) { // going for halt getSoundSystem().fadeOutAllLoops(); } diff --git a/src/mightypork/gamecore/gui/screens/impl/CrossfadeRequest.java b/src/mightypork/gamecore/gui/screens/impl/CrossfadeRequest.java index 099de69..87e180c 100644 --- a/src/mightypork/gamecore/gui/screens/impl/CrossfadeRequest.java +++ b/src/mightypork/gamecore/gui/screens/impl/CrossfadeRequest.java @@ -6,7 +6,7 @@ import mightypork.gamecore.eventbus.event_flags.SingleReceiverEvent; /** - * @author MightyPork + * @author Ondřej Hruška */ @SingleReceiverEvent public class CrossfadeRequest extends BusEvent { diff --git a/src/mightypork/gamecore/gui/screens/impl/FadingLayer.java b/src/mightypork/gamecore/gui/screens/impl/FadingLayer.java index 699bd4d..f714e20 100644 --- a/src/mightypork/gamecore/gui/screens/impl/FadingLayer.java +++ b/src/mightypork/gamecore/gui/screens/impl/FadingLayer.java @@ -12,7 +12,7 @@ import mightypork.gamecore.util.math.timing.TimedTask; /** * Layer that smoothly appears/disappears when shown/hidden * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class FadingLayer extends ScreenLayer { diff --git a/src/mightypork/gamecore/input/InputSystem.java b/src/mightypork/gamecore/input/InputSystem.java index 1dbf690..fc8d245 100644 --- a/src/mightypork/gamecore/input/InputSystem.java +++ b/src/mightypork/gamecore/input/InputSystem.java @@ -22,7 +22,7 @@ import org.lwjgl.opengl.Display; /** * Input system * - * @author MightyPork + * @author Ondřej Hruška */ public class InputSystem extends RootBusNode implements Updateable, KeyBinder { diff --git a/src/mightypork/gamecore/input/KeyBinder.java b/src/mightypork/gamecore/input/KeyBinder.java index c934262..f43caa3 100644 --- a/src/mightypork/gamecore/input/KeyBinder.java +++ b/src/mightypork/gamecore/input/KeyBinder.java @@ -8,7 +8,7 @@ import mightypork.gamecore.input.KeyStroke.Edge; /** * Can bind events to keys. * - * @author MightyPork + * @author Ondřej Hruška */ public interface KeyBinder { diff --git a/src/mightypork/gamecore/input/KeyBinding.java b/src/mightypork/gamecore/input/KeyBinding.java index 5681a91..123a52e 100644 --- a/src/mightypork/gamecore/input/KeyBinding.java +++ b/src/mightypork/gamecore/input/KeyBinding.java @@ -10,7 +10,7 @@ import mightypork.gamecore.input.events.KeyEventHandler; /** * Key binding, trigger activated by a keystroke event * - * @author MightyPork + * @author Ondřej Hruška */ public class KeyBinding implements KeyEventHandler, InputReadyListener { diff --git a/src/mightypork/gamecore/input/KeyBindingPool.java b/src/mightypork/gamecore/input/KeyBindingPool.java index dc6b7e9..ad364e1 100644 --- a/src/mightypork/gamecore/input/KeyBindingPool.java +++ b/src/mightypork/gamecore/input/KeyBindingPool.java @@ -14,7 +14,7 @@ import mightypork.gamecore.logging.Log; /** * Key binding pool * - * @author MightyPork + * @author Ondřej Hruška */ public class KeyBindingPool implements KeyBinder, KeyEventHandler { diff --git a/src/mightypork/gamecore/input/KeyStroke.java b/src/mightypork/gamecore/input/KeyStroke.java index 32cdc42..6555436 100644 --- a/src/mightypork/gamecore/input/KeyStroke.java +++ b/src/mightypork/gamecore/input/KeyStroke.java @@ -9,7 +9,7 @@ import org.lwjgl.input.Keyboard; /** * Key stroke trigger * - * @author MightyPork + * @author Ondřej Hruška */ public class KeyStroke { //implements Pollable diff --git a/src/mightypork/gamecore/input/Keys.java b/src/mightypork/gamecore/input/Keys.java index c6c00ec..95a14ab 100644 --- a/src/mightypork/gamecore/input/Keys.java +++ b/src/mightypork/gamecore/input/Keys.java @@ -11,7 +11,7 @@ import org.lwjgl.input.Keyboard; /** * Key constants, from LWJGL {@link Keyboard} * - * @author MightyPork + * @author Ondřej Hruška */ public class Keys { diff --git a/src/mightypork/gamecore/input/events/KeyEvent.java b/src/mightypork/gamecore/input/events/KeyEvent.java index b14fdc3..640c815 100644 --- a/src/mightypork/gamecore/input/events/KeyEvent.java +++ b/src/mightypork/gamecore/input/events/KeyEvent.java @@ -10,7 +10,7 @@ import org.lwjgl.input.Keyboard; /** * A keyboard event * - * @author MightyPork + * @author Ondřej Hruška */ @NotLoggedEvent public class KeyEvent extends BusEvent { diff --git a/src/mightypork/gamecore/input/events/KeyEventHandler.java b/src/mightypork/gamecore/input/events/KeyEventHandler.java index fd031d4..d4025bd 100644 --- a/src/mightypork/gamecore/input/events/KeyEventHandler.java +++ b/src/mightypork/gamecore/input/events/KeyEventHandler.java @@ -4,7 +4,7 @@ package mightypork.gamecore.input.events; /** * {@link KeyEvent} listener * - * @author MightyPork + * @author Ondřej Hruška */ public interface KeyEventHandler { diff --git a/src/mightypork/gamecore/input/events/MouseButtonEvent.java b/src/mightypork/gamecore/input/events/MouseButtonEvent.java index 78b7c49..a520e66 100644 --- a/src/mightypork/gamecore/input/events/MouseButtonEvent.java +++ b/src/mightypork/gamecore/input/events/MouseButtonEvent.java @@ -11,7 +11,7 @@ import mightypork.gamecore.util.math.constraints.vect.VectConst; /** * Mouse button / wheel event triggered * - * @author MightyPork + * @author Ondřej Hruška */ @NotLoggedEvent public class MouseButtonEvent extends BusEvent { diff --git a/src/mightypork/gamecore/input/events/MouseButtonHandler.java b/src/mightypork/gamecore/input/events/MouseButtonHandler.java index 74a1a06..166ab00 100644 --- a/src/mightypork/gamecore/input/events/MouseButtonHandler.java +++ b/src/mightypork/gamecore/input/events/MouseButtonHandler.java @@ -4,7 +4,7 @@ package mightypork.gamecore.input.events; /** * {@link MouseButtonEvent} listener * - * @author MightyPork + * @author Ondřej Hruška */ public interface MouseButtonHandler { diff --git a/src/mightypork/gamecore/input/events/MouseMotionEvent.java b/src/mightypork/gamecore/input/events/MouseMotionEvent.java index 7fb4d69..df56408 100644 --- a/src/mightypork/gamecore/input/events/MouseMotionEvent.java +++ b/src/mightypork/gamecore/input/events/MouseMotionEvent.java @@ -10,7 +10,7 @@ import mightypork.gamecore.util.math.constraints.vect.VectConst; /** * Mouse moved * - * @author MightyPork + * @author Ondřej Hruška */ @NotLoggedEvent public class MouseMotionEvent extends BusEvent { diff --git a/src/mightypork/gamecore/input/events/MouseMotionHandler.java b/src/mightypork/gamecore/input/events/MouseMotionHandler.java index 07d306a..7864d58 100644 --- a/src/mightypork/gamecore/input/events/MouseMotionHandler.java +++ b/src/mightypork/gamecore/input/events/MouseMotionHandler.java @@ -4,7 +4,7 @@ package mightypork.gamecore.input.events; /** * {@link MouseMotionEvent} listener * - * @author MightyPork + * @author Ondřej Hruška */ public interface MouseMotionHandler { diff --git a/src/mightypork/gamecore/logging/Log.java b/src/mightypork/gamecore/logging/Log.java index 031df95..a6fbd06 100644 --- a/src/mightypork/gamecore/logging/Log.java +++ b/src/mightypork/gamecore/logging/Log.java @@ -19,7 +19,7 @@ import mightypork.gamecore.util.strings.StringUtils; /** * A log. * - * @author MightyPork + * @author Ondřej Hruška */ public class Log { diff --git a/src/mightypork/gamecore/logging/LogAlias.java b/src/mightypork/gamecore/logging/LogAlias.java index 3ff5d1d..28d8f2c 100644 --- a/src/mightypork/gamecore/logging/LogAlias.java +++ b/src/mightypork/gamecore/logging/LogAlias.java @@ -10,7 +10,7 @@ import java.lang.annotation.RetentionPolicy; /** * Specify pretty name to be used when logging (eg. Log.str()) * - * @author MightyPork + * @author Ondřej Hruška */ @Retention(RetentionPolicy.RUNTIME) @Inherited diff --git a/src/mightypork/gamecore/logging/SlickLogRedirector.java b/src/mightypork/gamecore/logging/SlickLogRedirector.java index b6687d5..576740d 100644 --- a/src/mightypork/gamecore/logging/SlickLogRedirector.java +++ b/src/mightypork/gamecore/logging/SlickLogRedirector.java @@ -9,7 +9,7 @@ import mightypork.gamecore.logging.writers.LogWriter; /** * Used to redirect slick log into main logger. * - * @author MightyPork + * @author Ondřej Hruška */ public class SlickLogRedirector implements org.newdawn.slick.util.LogSystem { diff --git a/src/mightypork/gamecore/logging/writers/ArchivingLog.java b/src/mightypork/gamecore/logging/writers/ArchivingLog.java index ba926de..2025477 100644 --- a/src/mightypork/gamecore/logging/writers/ArchivingLog.java +++ b/src/mightypork/gamecore/logging/writers/ArchivingLog.java @@ -15,7 +15,7 @@ import mightypork.gamecore.util.files.FileUtils; /** * Logger that cleans directory & archives old logs * - * @author MightyPork + * @author Ondřej Hruška * @copy (c) 2014 */ public class ArchivingLog extends SimpleLog { diff --git a/src/mightypork/gamecore/logging/writers/LogWriter.java b/src/mightypork/gamecore/logging/writers/LogWriter.java index 0f87791..fb05385 100644 --- a/src/mightypork/gamecore/logging/writers/LogWriter.java +++ b/src/mightypork/gamecore/logging/writers/LogWriter.java @@ -9,7 +9,7 @@ import mightypork.gamecore.logging.monitors.LogMonitor; /** * Log interface * - * @author MightyPork + * @author Ondřej Hruška */ public interface LogWriter { diff --git a/src/mightypork/gamecore/logging/writers/SimpleLog.java b/src/mightypork/gamecore/logging/writers/SimpleLog.java index d1c3968..8e25b59 100644 --- a/src/mightypork/gamecore/logging/writers/SimpleLog.java +++ b/src/mightypork/gamecore/logging/writers/SimpleLog.java @@ -18,7 +18,7 @@ import mightypork.gamecore.logging.monitors.LogMonitor; /** * Basic logger * - * @author MightyPork + * @author Ondřej Hruška */ public class SimpleLog implements LogWriter { diff --git a/src/mightypork/gamecore/render/DisplaySystem.java b/src/mightypork/gamecore/render/DisplaySystem.java index f6b0034..6a6ec21 100644 --- a/src/mightypork/gamecore/render/DisplaySystem.java +++ b/src/mightypork/gamecore/render/DisplaySystem.java @@ -24,7 +24,7 @@ import org.lwjgl.opengl.DisplayMode; /** * Display system * - * @author MightyPork + * @author Ondřej Hruška */ public class DisplaySystem extends AppModule implements RectBound { diff --git a/src/mightypork/gamecore/render/Render.java b/src/mightypork/gamecore/render/Render.java index d005697..c0fd7e8 100644 --- a/src/mightypork/gamecore/render/Render.java +++ b/src/mightypork/gamecore/render/Render.java @@ -25,7 +25,7 @@ import org.newdawn.slick.opengl.TextureLoader; /** * Render utilities * - * @author MightyPork + * @author Ondřej Hruška */ public class Render { diff --git a/src/mightypork/gamecore/render/Renderable.java b/src/mightypork/gamecore/render/Renderable.java index 5f27785..787717c 100644 --- a/src/mightypork/gamecore/render/Renderable.java +++ b/src/mightypork/gamecore/render/Renderable.java @@ -4,7 +4,7 @@ package mightypork.gamecore.render; /** * Can be rendered * - * @author MightyPork + * @author Ondřej Hruška */ public interface Renderable { diff --git a/src/mightypork/gamecore/render/Screenshot.java b/src/mightypork/gamecore/render/Screenshot.java index 21bbee8..3d684e7 100644 --- a/src/mightypork/gamecore/render/Screenshot.java +++ b/src/mightypork/gamecore/render/Screenshot.java @@ -13,7 +13,7 @@ import javax.imageio.ImageIO; * Screenshot object, can be used to extract image or write to file.
* Screenshot, once taken, can be safely processed in separate thread. * - * @author MightyPork + * @author Ondřej Hruška */ public class Screenshot { diff --git a/src/mightypork/gamecore/render/events/ViewportChangeEvent.java b/src/mightypork/gamecore/render/events/ViewportChangeEvent.java index 01420c9..75396b3 100644 --- a/src/mightypork/gamecore/render/events/ViewportChangeEvent.java +++ b/src/mightypork/gamecore/render/events/ViewportChangeEvent.java @@ -10,7 +10,7 @@ import mightypork.gamecore.util.math.constraints.vect.Vect; /** * Screen resolution or mode was changed * - * @author MightyPork + * @author Ondřej Hruška */ @NonConsumableEvent @NotLoggedEvent diff --git a/src/mightypork/gamecore/render/events/ViewportChangeListener.java b/src/mightypork/gamecore/render/events/ViewportChangeListener.java index a50cd08..35ef876 100644 --- a/src/mightypork/gamecore/render/events/ViewportChangeListener.java +++ b/src/mightypork/gamecore/render/events/ViewportChangeListener.java @@ -4,7 +4,7 @@ package mightypork.gamecore.render.events; /** * {@link ViewportChangeEvent} listener * - * @author MightyPork + * @author Ondřej Hruška */ public interface ViewportChangeListener { diff --git a/src/mightypork/gamecore/resources/AsyncResourceLoader.java b/src/mightypork/gamecore/resources/AsyncResourceLoader.java index e84a491..725f8b4 100644 --- a/src/mightypork/gamecore/resources/AsyncResourceLoader.java +++ b/src/mightypork/gamecore/resources/AsyncResourceLoader.java @@ -14,7 +14,7 @@ import mightypork.gamecore.logging.Log; /** * Asynchronous resource loading thread. * - * @author MightyPork + * @author Ondřej Hruška */ public class AsyncResourceLoader extends Thread implements ResourceLoader, Destroyable { @@ -98,7 +98,7 @@ public class AsyncResourceLoader extends Thread implements ResourceLoader, Destr @Override public void run() { - if(!def.isLoaded()) { + if (!def.isLoaded()) { def.load(); } } diff --git a/src/mightypork/gamecore/resources/BaseLazyResource.java b/src/mightypork/gamecore/resources/BaseLazyResource.java index a67f0d6..733f123 100644 --- a/src/mightypork/gamecore/resources/BaseLazyResource.java +++ b/src/mightypork/gamecore/resources/BaseLazyResource.java @@ -6,14 +6,13 @@ import java.io.IOException; import mightypork.gamecore.eventbus.events.Destroyable; import mightypork.gamecore.logging.Log; import mightypork.gamecore.logging.LogAlias; -import mightypork.gamecore.util.math.Calc; import mightypork.gamecore.util.strings.StringUtils; /** * Deferred resource abstraction. * - * @author MightyPork + * @author Ondřej Hruška */ @LogAlias(name = "Resource") public abstract class BaseLazyResource implements LazyResource, Destroyable { @@ -51,7 +50,7 @@ public abstract class BaseLazyResource implements LazyResource, Destroyable { throw new NullPointerException("Resource string cannot be null for non-null resource."); } - long time = Profiler.begin(); + final long time = Profiler.begin(); Log.f3("(res) + Load: " + this); loadResource(resource); Log.f3("(res) - Done: " + this + " in " + Profiler.endStr(time)); diff --git a/src/mightypork/gamecore/resources/LazyResource.java b/src/mightypork/gamecore/resources/LazyResource.java index e476045..aec4c71 100644 --- a/src/mightypork/gamecore/resources/LazyResource.java +++ b/src/mightypork/gamecore/resources/LazyResource.java @@ -4,7 +4,7 @@ package mightypork.gamecore.resources; /** * Deferred resource * - * @author MightyPork + * @author Ondřej Hruška */ public interface LazyResource { diff --git a/src/mightypork/gamecore/resources/Res.java b/src/mightypork/gamecore/resources/Res.java index 94f9534..aefdf3d 100644 --- a/src/mightypork/gamecore/resources/Res.java +++ b/src/mightypork/gamecore/resources/Res.java @@ -16,7 +16,7 @@ import mightypork.gamecore.resources.textures.TxSheet; /** * Static resource repository * - * @author MightyPork + * @author Ondřej Hruška */ public final class Res { diff --git a/src/mightypork/gamecore/resources/ResourceLoadRequest.java b/src/mightypork/gamecore/resources/ResourceLoadRequest.java index ee7899f..a1bcdcb 100644 --- a/src/mightypork/gamecore/resources/ResourceLoadRequest.java +++ b/src/mightypork/gamecore/resources/ResourceLoadRequest.java @@ -8,7 +8,7 @@ import mightypork.gamecore.eventbus.event_flags.SingleReceiverEvent; /** * Request to load a deferred resource. * - * @author MightyPork + * @author Ondřej Hruška */ @SingleReceiverEvent public class ResourceLoadRequest extends BusEvent { diff --git a/src/mightypork/gamecore/resources/ResourceLoader.java b/src/mightypork/gamecore/resources/ResourceLoader.java index d2df33f..8c5c06a 100644 --- a/src/mightypork/gamecore/resources/ResourceLoader.java +++ b/src/mightypork/gamecore/resources/ResourceLoader.java @@ -7,7 +7,7 @@ import mightypork.gamecore.eventbus.BusAccess; /** * {@link ResourceLoadRequest} listener * - * @author MightyPork + * @author Ondřej Hruška */ public interface ResourceLoader { diff --git a/src/mightypork/gamecore/resources/ResourceSetup.java b/src/mightypork/gamecore/resources/ResourceSetup.java index b7e7ba0..00e2a3d 100644 --- a/src/mightypork/gamecore/resources/ResourceSetup.java +++ b/src/mightypork/gamecore/resources/ResourceSetup.java @@ -9,7 +9,7 @@ import mightypork.gamecore.resources.textures.TextureRegistry; /** * Resource binder; used by apps to specify what resources are to be loaded. * - * @author MightyPork + * @author Ondřej Hruška */ public interface ResourceSetup { diff --git a/src/mightypork/gamecore/resources/TextureBasedResource.java b/src/mightypork/gamecore/resources/TextureBasedResource.java index 994e9ac..185c5de 100644 --- a/src/mightypork/gamecore/resources/TextureBasedResource.java +++ b/src/mightypork/gamecore/resources/TextureBasedResource.java @@ -8,7 +8,7 @@ import java.lang.annotation.*; * Resource that is texture-based and therefore needs to be loaded in the main * thread (ie. main loop). * - * @author MightyPork + * @author Ondřej Hruška */ @Retention(RetentionPolicy.RUNTIME) diff --git a/src/mightypork/gamecore/resources/audio/JointVolume.java b/src/mightypork/gamecore/resources/audio/JointVolume.java index af76962..e364e6b 100644 --- a/src/mightypork/gamecore/resources/audio/JointVolume.java +++ b/src/mightypork/gamecore/resources/audio/JointVolume.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.math.Calc; /** * Volume combined of multiple volumes, combining them (multiplication). * - * @author MightyPork + * @author Ondřej Hruška */ public class JointVolume extends Volume { diff --git a/src/mightypork/gamecore/resources/audio/LazyAudio.java b/src/mightypork/gamecore/resources/audio/LazyAudio.java index 3bf368f..7ea087c 100644 --- a/src/mightypork/gamecore/resources/audio/LazyAudio.java +++ b/src/mightypork/gamecore/resources/audio/LazyAudio.java @@ -16,7 +16,7 @@ import org.newdawn.slick.openal.SoundStore; /** * Wrapper class for slick audio * - * @author MightyPork + * @author Ondřej Hruška */ @LogAlias(name = "Audio") public class LazyAudio extends BaseLazyResource { diff --git a/src/mightypork/gamecore/resources/audio/SoundRegistry.java b/src/mightypork/gamecore/resources/audio/SoundRegistry.java index a7b3234..0ff166e 100644 --- a/src/mightypork/gamecore/resources/audio/SoundRegistry.java +++ b/src/mightypork/gamecore/resources/audio/SoundRegistry.java @@ -13,7 +13,7 @@ import mightypork.gamecore.resources.audio.players.LoopPlayer; /** * Audio resource storage * - * @author MightyPork + * @author Ondřej Hruška */ public class SoundRegistry extends AppAccessAdapter { diff --git a/src/mightypork/gamecore/resources/audio/SoundSystem.java b/src/mightypork/gamecore/resources/audio/SoundSystem.java index d1fef9c..ad5e095 100644 --- a/src/mightypork/gamecore/resources/audio/SoundSystem.java +++ b/src/mightypork/gamecore/resources/audio/SoundSystem.java @@ -3,9 +3,7 @@ package mightypork.gamecore.resources.audio; import java.nio.FloatBuffer; import java.util.ArrayList; -import java.util.HashSet; import java.util.List; -import java.util.Set; import mightypork.gamecore.core.modules.AppAccess; import mightypork.gamecore.eventbus.clients.RootBusNode; @@ -26,7 +24,7 @@ import org.newdawn.slick.openal.SoundStore; /** * Sound system class (only one instance should be made per application) * - * @author MightyPork + * @author Ondřej Hruška */ public class SoundSystem extends RootBusNode implements Updateable { @@ -164,7 +162,7 @@ public class SoundSystem extends RootBusNode implements Updateable { */ private LazyAudio createResource(String res) { - final LazyAudio a = new LazyAudio(res); + final LazyAudio a = new LazyAudio(res); getEventBus().send(new ResourceLoadRequest(a)); resources.add(a); return a; diff --git a/src/mightypork/gamecore/resources/audio/Volume.java b/src/mightypork/gamecore/resources/audio/Volume.java index fc73278..b3fb72d 100644 --- a/src/mightypork/gamecore/resources/audio/Volume.java +++ b/src/mightypork/gamecore/resources/audio/Volume.java @@ -8,7 +8,7 @@ import mightypork.gamecore.util.objects.Mutable; /** * Mutable volume 0-1 * - * @author MightyPork + * @author Ondřej Hruška */ public class Volume extends Mutable { diff --git a/src/mightypork/gamecore/resources/audio/players/BaseAudioPlayer.java b/src/mightypork/gamecore/resources/audio/players/BaseAudioPlayer.java index d2406a3..a83b738 100644 --- a/src/mightypork/gamecore/resources/audio/players/BaseAudioPlayer.java +++ b/src/mightypork/gamecore/resources/audio/players/BaseAudioPlayer.java @@ -9,7 +9,7 @@ import mightypork.gamecore.resources.audio.Volume; /** * Basic abstract player * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class BaseAudioPlayer implements Destroyable { diff --git a/src/mightypork/gamecore/resources/audio/players/EffectPlayer.java b/src/mightypork/gamecore/resources/audio/players/EffectPlayer.java index 52a82bd..9437b60 100644 --- a/src/mightypork/gamecore/resources/audio/players/EffectPlayer.java +++ b/src/mightypork/gamecore/resources/audio/players/EffectPlayer.java @@ -9,7 +9,7 @@ import mightypork.gamecore.util.math.constraints.vect.Vect; /** * Player for one-off effects * - * @author MightyPork + * @author Ondřej Hruška */ public class EffectPlayer extends BaseAudioPlayer { diff --git a/src/mightypork/gamecore/resources/audio/players/LoopPlayer.java b/src/mightypork/gamecore/resources/audio/players/LoopPlayer.java index 9da7e11..86250dc 100644 --- a/src/mightypork/gamecore/resources/audio/players/LoopPlayer.java +++ b/src/mightypork/gamecore/resources/audio/players/LoopPlayer.java @@ -13,7 +13,7 @@ import org.lwjgl.openal.AL10; /** * Audio loop player (with fading, good for music) * - * @author MightyPork + * @author Ondřej Hruška */ public class LoopPlayer extends BaseAudioPlayer implements Updateable, Pauseable { diff --git a/src/mightypork/gamecore/resources/fonts/FontRegistry.java b/src/mightypork/gamecore/resources/fonts/FontRegistry.java index 5088439..1843eb5 100644 --- a/src/mightypork/gamecore/resources/fonts/FontRegistry.java +++ b/src/mightypork/gamecore/resources/fonts/FontRegistry.java @@ -14,7 +14,7 @@ import org.newdawn.slick.opengl.Texture; /** * Font loader and registry * - * @author MightyPork + * @author Ondřej Hruška */ public class FontRegistry extends AppAccessAdapter { diff --git a/src/mightypork/gamecore/resources/fonts/FontRenderer.java b/src/mightypork/gamecore/resources/fonts/FontRenderer.java index 6ae2031..3bb1d6c 100644 --- a/src/mightypork/gamecore/resources/fonts/FontRenderer.java +++ b/src/mightypork/gamecore/resources/fonts/FontRenderer.java @@ -12,7 +12,7 @@ import mightypork.gamecore.util.math.constraints.vect.Vect; /** * Font renderer * - * @author MightyPork + * @author Ondřej Hruška */ public class FontRenderer { diff --git a/src/mightypork/gamecore/resources/fonts/GLFont.java b/src/mightypork/gamecore/resources/fonts/GLFont.java index 0ff64ba..936f10f 100644 --- a/src/mightypork/gamecore/resources/fonts/GLFont.java +++ b/src/mightypork/gamecore/resources/fonts/GLFont.java @@ -1,7 +1,6 @@ package mightypork.gamecore.resources.fonts; -import mightypork.gamecore.resources.TextureBasedResource; import mightypork.gamecore.util.math.color.Color; import mightypork.gamecore.util.math.constraints.vect.Vect; @@ -9,7 +8,7 @@ import mightypork.gamecore.util.math.constraints.vect.Vect; /** * Interface bor drawable font. * - * @author MightyPork + * @author Ondřej Hruška */ public interface GLFont { diff --git a/src/mightypork/gamecore/resources/fonts/Glyphs.java b/src/mightypork/gamecore/resources/fonts/Glyphs.java index 98ddedd..e6e166e 100644 --- a/src/mightypork/gamecore/resources/fonts/Glyphs.java +++ b/src/mightypork/gamecore/resources/fonts/Glyphs.java @@ -4,7 +4,7 @@ package mightypork.gamecore.resources.fonts; /** * Glyph tables. * - * @author MightyPork + * @author Ondřej Hruška */ public class Glyphs { diff --git a/src/mightypork/gamecore/resources/fonts/impl/LazyFont.java b/src/mightypork/gamecore/resources/fonts/impl/LazyFont.java index a8e13fb..e829377 100644 --- a/src/mightypork/gamecore/resources/fonts/impl/LazyFont.java +++ b/src/mightypork/gamecore/resources/fonts/impl/LazyFont.java @@ -19,7 +19,7 @@ import mightypork.gamecore.util.math.constraints.vect.Vect; /** * Font obtained from a resource file (TTF). * - * @author MightyPork + * @author Ondřej Hruška */ @TextureBasedResource @LogAlias(name = "Font") diff --git a/src/mightypork/gamecore/resources/fonts/impl/LazyFontNative.java b/src/mightypork/gamecore/resources/fonts/impl/LazyFontNative.java index 8021625..45932af 100644 --- a/src/mightypork/gamecore/resources/fonts/impl/LazyFontNative.java +++ b/src/mightypork/gamecore/resources/fonts/impl/LazyFontNative.java @@ -11,7 +11,7 @@ import mightypork.gamecore.resources.textures.FilterMode; /** * Font obtained from the OS * - * @author MightyPork + * @author Ondřej Hruška */ @LogAlias(name = "FontNative") public class LazyFontNative extends LazyFont { diff --git a/src/mightypork/gamecore/resources/fonts/impl/TextureBackedFont.java b/src/mightypork/gamecore/resources/fonts/impl/TextureBackedFont.java index 9a850c0..ca4dac7 100644 --- a/src/mightypork/gamecore/resources/fonts/impl/TextureBackedFont.java +++ b/src/mightypork/gamecore/resources/fonts/impl/TextureBackedFont.java @@ -19,7 +19,6 @@ import java.util.List; import java.util.Map; import mightypork.gamecore.logging.Log; -import mightypork.gamecore.resources.TextureBasedResource; import mightypork.gamecore.resources.fonts.GLFont; import mightypork.gamecore.resources.textures.FilterMode; import mightypork.gamecore.resources.textures.LazyTexture; @@ -40,7 +39,7 @@ import org.newdawn.slick.opengl.GLUtils; * @author Kevin Glass (kevglass) * @author Peter Korzuszek (genail) * @author David Aaron Muhar (bobjob) - * @author MightyPork + * @author Ondřej Hruška */ public class TextureBackedFont implements GLFont { diff --git a/src/mightypork/gamecore/resources/textures/FilterMode.java b/src/mightypork/gamecore/resources/textures/FilterMode.java index 2affbf7..e8503ef 100644 --- a/src/mightypork/gamecore/resources/textures/FilterMode.java +++ b/src/mightypork/gamecore/resources/textures/FilterMode.java @@ -7,7 +7,7 @@ import org.lwjgl.opengl.GL11; /** * Texture filtering mode * - * @author MightyPork + * @author Ondřej Hruška */ public enum FilterMode { diff --git a/src/mightypork/gamecore/resources/textures/GLTexture.java b/src/mightypork/gamecore/resources/textures/GLTexture.java index 9921925..2a76506 100644 --- a/src/mightypork/gamecore/resources/textures/GLTexture.java +++ b/src/mightypork/gamecore/resources/textures/GLTexture.java @@ -8,7 +8,7 @@ import mightypork.gamecore.util.math.constraints.rect.Rect; /** * Texture with filter and wrap mode * - * @author MightyPork + * @author Ondřej Hruška */ public interface GLTexture extends Destroyable { diff --git a/src/mightypork/gamecore/resources/textures/LazyTexture.java b/src/mightypork/gamecore/resources/textures/LazyTexture.java index 82808ac..8904084 100644 --- a/src/mightypork/gamecore/resources/textures/LazyTexture.java +++ b/src/mightypork/gamecore/resources/textures/LazyTexture.java @@ -13,7 +13,7 @@ import org.lwjgl.opengl.GL11; /** * Deferred texture * - * @author MightyPork + * @author Ondřej Hruška */ @LogAlias(name = "Texture") @TextureBasedResource diff --git a/src/mightypork/gamecore/resources/textures/QuadGrid.java b/src/mightypork/gamecore/resources/textures/QuadGrid.java index 7b716dc..9acccb5 100644 --- a/src/mightypork/gamecore/resources/textures/QuadGrid.java +++ b/src/mightypork/gamecore/resources/textures/QuadGrid.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.math.constraints.rect.Rect; /** * {@link TxQuad} and {@link TxSheet} building utility * - * @author MightyPork + * @author Ondřej Hruška */ public class QuadGrid { diff --git a/src/mightypork/gamecore/resources/textures/TextureRegistry.java b/src/mightypork/gamecore/resources/textures/TextureRegistry.java index 08cb708..9d7e534 100644 --- a/src/mightypork/gamecore/resources/textures/TextureRegistry.java +++ b/src/mightypork/gamecore/resources/textures/TextureRegistry.java @@ -15,7 +15,7 @@ import mightypork.gamecore.util.math.constraints.rect.Rect; * Texture storage and quad/sheet registry. Quads and Sheets are interchangeable * once registered. * - * @author MightyPork + * @author Ondřej Hruška */ public class TextureRegistry extends AppAccessAdapter { diff --git a/src/mightypork/gamecore/resources/textures/TxQuad.java b/src/mightypork/gamecore/resources/textures/TxQuad.java index 403e239..78c54e6 100644 --- a/src/mightypork/gamecore/resources/textures/TxQuad.java +++ b/src/mightypork/gamecore/resources/textures/TxQuad.java @@ -8,7 +8,7 @@ import mightypork.gamecore.util.math.constraints.rect.RectConst; /** * Texture Quad (describing a part of a texture) * - * @author MightyPork + * @author Ondřej Hruška */ public class TxQuad { diff --git a/src/mightypork/gamecore/resources/textures/TxSheet.java b/src/mightypork/gamecore/resources/textures/TxSheet.java index 3928cf9..c84414a 100644 --- a/src/mightypork/gamecore/resources/textures/TxSheet.java +++ b/src/mightypork/gamecore/resources/textures/TxSheet.java @@ -9,7 +9,7 @@ import mightypork.gamecore.logging.Log; /** * Basic sprite sheet * - * @author MightyPork + * @author Ondřej Hruška */ public class TxSheet { diff --git a/src/mightypork/gamecore/resources/textures/WrapMode.java b/src/mightypork/gamecore/resources/textures/WrapMode.java index dd997f4..7cf10ef 100644 --- a/src/mightypork/gamecore/resources/textures/WrapMode.java +++ b/src/mightypork/gamecore/resources/textures/WrapMode.java @@ -7,7 +7,7 @@ import org.lwjgl.opengl.GL11; /** * Texture wrap mode * - * @author MightyPork + * @author Ondřej Hruška */ public enum WrapMode { diff --git a/src/mightypork/gamecore/util/Utils.java b/src/mightypork/gamecore/util/Utils.java index 13a8e0b..03f89f4 100644 --- a/src/mightypork/gamecore/util/Utils.java +++ b/src/mightypork/gamecore/util/Utils.java @@ -9,7 +9,7 @@ import java.util.Date; /** * Assorted utils * - * @author MightyPork + * @author Ondřej Hruška */ public final class Utils { diff --git a/src/mightypork/gamecore/util/annot/DefaultImpl.java b/src/mightypork/gamecore/util/annot/DefaultImpl.java index 7d1be2c..3c21fa5 100644 --- a/src/mightypork/gamecore/util/annot/DefaultImpl.java +++ b/src/mightypork/gamecore/util/annot/DefaultImpl.java @@ -13,7 +13,7 @@ import java.lang.annotation.Target; * implementation) as a convenience.
* This is a description annotation and has no other function. * - * @author MightyPork + * @author Ondřej Hruška */ @Documented @Retention(RetentionPolicy.SOURCE) diff --git a/src/mightypork/gamecore/util/annot/FactoryMethod.java b/src/mightypork/gamecore/util/annot/FactoryMethod.java index d287383..3a7c8d4 100644 --- a/src/mightypork/gamecore/util/annot/FactoryMethod.java +++ b/src/mightypork/gamecore/util/annot/FactoryMethod.java @@ -12,7 +12,7 @@ import java.lang.annotation.Target; * Marks a static factory method. This is a description annotation and has no * other function. * - * @author MightyPork + * @author Ondřej Hruška */ @Retention(RetentionPolicy.SOURCE) @Target(ElementType.METHOD) diff --git a/src/mightypork/gamecore/util/error/CorruptDataException.java b/src/mightypork/gamecore/util/error/CorruptDataException.java index 5c1383c..41e8ce1 100644 --- a/src/mightypork/gamecore/util/error/CorruptDataException.java +++ b/src/mightypork/gamecore/util/error/CorruptDataException.java @@ -1,15 +1,12 @@ package mightypork.gamecore.util.error; -import java.io.IOException; - - /** * Thrown when data could not be read successfully. * - * @author MightyPork + * @author Ondřej Hruška */ -public class CorruptDataException extends IOException { +public class CorruptDataException extends RuntimeException { public CorruptDataException() { diff --git a/src/mightypork/gamecore/util/error/IllegalValueException.java b/src/mightypork/gamecore/util/error/IllegalValueException.java index 9add26c..da7a960 100644 --- a/src/mightypork/gamecore/util/error/IllegalValueException.java +++ b/src/mightypork/gamecore/util/error/IllegalValueException.java @@ -5,7 +5,7 @@ package mightypork.gamecore.util.error; * Thrown when a invalid value is given to a method, or found in a data object / * file etc * - * @author MightyPork + * @author Ondřej Hruška */ public class IllegalValueException extends RuntimeException { diff --git a/src/mightypork/gamecore/util/error/KeyAlreadyExistsException.java b/src/mightypork/gamecore/util/error/KeyAlreadyExistsException.java index 2cac099..40184ef 100644 --- a/src/mightypork/gamecore/util/error/KeyAlreadyExistsException.java +++ b/src/mightypork/gamecore/util/error/KeyAlreadyExistsException.java @@ -4,7 +4,7 @@ package mightypork.gamecore.util.error; /** * Thrown by a map-like class when the key specified is already taken. * - * @author MightyPork + * @author Ondřej Hruška */ public class KeyAlreadyExistsException extends RuntimeException { diff --git a/src/mightypork/gamecore/util/files/FileSuffixFilter.java b/src/mightypork/gamecore/util/files/FileSuffixFilter.java index 8e1cc9c..7e37bb5 100644 --- a/src/mightypork/gamecore/util/files/FileSuffixFilter.java +++ b/src/mightypork/gamecore/util/files/FileSuffixFilter.java @@ -8,7 +8,7 @@ import java.io.FileFilter; /** * File filter for certain suffixes * - * @author MightyPork + * @author Ondřej Hruška */ public class FileSuffixFilter implements FileFilter { diff --git a/src/mightypork/gamecore/util/files/InstanceLock.java b/src/mightypork/gamecore/util/files/InstanceLock.java index 36f73fe..c58cd7b 100644 --- a/src/mightypork/gamecore/util/files/InstanceLock.java +++ b/src/mightypork/gamecore/util/files/InstanceLock.java @@ -10,7 +10,7 @@ import java.nio.channels.FileLock; /** * Instance lock (avoid running twice) * - * @author MightyPork + * @author Ondřej Hruška */ public class InstanceLock { diff --git a/src/mightypork/gamecore/util/files/config/PropertyManager.java b/src/mightypork/gamecore/util/files/config/PropertyManager.java index e9660df..29cf780 100644 --- a/src/mightypork/gamecore/util/files/config/PropertyManager.java +++ b/src/mightypork/gamecore/util/files/config/PropertyManager.java @@ -16,7 +16,7 @@ import mightypork.gamecore.util.objects.Convert; /** * Property manager with advanced formatting and value checking. * - * @author MightyPork + * @author Ondřej Hruška */ public class PropertyManager { diff --git a/src/mightypork/gamecore/util/files/config/SimpleConfig.java b/src/mightypork/gamecore/util/files/config/SimpleConfig.java index 9d135f3..b8924f8 100644 --- a/src/mightypork/gamecore/util/files/config/SimpleConfig.java +++ b/src/mightypork/gamecore/util/files/config/SimpleConfig.java @@ -20,7 +20,7 @@ import mightypork.gamecore.util.files.FileUtils; * lines with "=" must have "key = value" format, or a warning is logged.
* use "NULL" to create empty value. * - * @author MightyPork + * @author Ondřej Hruška */ public class SimpleConfig { diff --git a/src/mightypork/gamecore/util/files/config/SortedProperties.java b/src/mightypork/gamecore/util/files/config/SortedProperties.java index 45e9ca7..973f997 100644 --- a/src/mightypork/gamecore/util/files/config/SortedProperties.java +++ b/src/mightypork/gamecore/util/files/config/SortedProperties.java @@ -12,7 +12,7 @@ import java.util.Vector; * Properties stored in file, alphabetically sorted.
* Uses UTF-8 encoding and each property can have it's own comment. * - * @author MightyPork + * @author Ondřej Hruška */ public class SortedProperties extends java.util.Properties { diff --git a/src/mightypork/gamecore/util/files/zip/ZipBuilder.java b/src/mightypork/gamecore/util/files/zip/ZipBuilder.java index a6469b5..1d19bdb 100644 --- a/src/mightypork/gamecore/util/files/zip/ZipBuilder.java +++ b/src/mightypork/gamecore/util/files/zip/ZipBuilder.java @@ -17,7 +17,7 @@ import mightypork.gamecore.util.files.FileUtils; /** * Class for building a zip file * - * @author MightyPork + * @author Ondřej Hruška */ public class ZipBuilder { diff --git a/src/mightypork/gamecore/util/files/zip/ZipUtils.java b/src/mightypork/gamecore/util/files/zip/ZipUtils.java index 12f9d94..73254b4 100644 --- a/src/mightypork/gamecore/util/files/zip/ZipUtils.java +++ b/src/mightypork/gamecore/util/files/zip/ZipUtils.java @@ -16,7 +16,7 @@ import mightypork.gamecore.util.strings.filtering.StringFilter; /** * Utilities for manipulating zip files * - * @author MightyPork + * @author Ondřej Hruška */ public class ZipUtils { diff --git a/src/mightypork/gamecore/util/ion/Ion.java b/src/mightypork/gamecore/util/ion/Ion.java deleted file mode 100644 index e155f34..0000000 --- a/src/mightypork/gamecore/util/ion/Ion.java +++ /dev/null @@ -1,295 +0,0 @@ -package mightypork.gamecore.util.ion; - - -import java.io.*; - -import mightypork.gamecore.logging.Log; - - -/** - * Universal data storage system (main API class) - * - * @author MightyPork - */ -public class Ion { - - // marks for object saving - /** Null mark */ - static final int NULL = 0; - /** Boolean mark */ - static final int BOOLEAN = 1; - /** Byte mark */ - static final int BYTE = 2; - /** Character mark */ - static final int CHAR = 3; - /** Short mark */ - static final int SHORT = 4; - /** Integer mark */ - static final int INT = 5; - /** Long mark */ - static final int LONG = 6; - /** Float mark */ - static final int FLOAT = 7; - /** Double mark */ - static final int DOUBLE = 8; - /** String mark */ - static final int STRING = 9; - /** Boolean array mark */ - static final int BOOLEAN_ARRAY = 10; - /** Byte array mark */ - static final int BYTE_ARRAY = 11; - /** Character array mark */ - static final int CHAR_ARRAY = 12; - /** Short array mark */ - static final int SHORT_ARRAY = 13; - /** Integer array mark */ - static final int INT_ARRAY = 14; - /** Long array mark */ - static final int LONG_ARRAY = 15; - /** Float array mark */ - static final int FLOAT_ARRAY = 16; - /** Double array mark */ - static final int DOUBLE_ARRAY = 17; - /** String array mark */ - static final int STRING_ARRAY = 18; - /** Entry mark - start of map or sequence entry */ - static final int ENTRY = 19; - /** End mark - end of sequence or map */ - static final int END = 20; - /** Map mark (built-in data structure) */ - static final int DATA_BUNDLE = 21; - /** Sequence wrapper for bundle */ - static final int SEQUENCE_WRAPPER = 22; - /** Map wrapper for bundle */ - static final int MAP_WRAPPER = 23; - - /** Ionizables */ - @SuppressWarnings("rawtypes") - private static Class[] registered = new Class[256]; - - private static boolean reservedMarkChecking; - - static { - reservedMarkChecking = false; - - // register built-ins - registerType(DATA_BUNDLE, IonBundle.class); - registerType(SEQUENCE_WRAPPER, IonSequenceWrapper.class); - registerType(MAP_WRAPPER, IonMapWrapper.class); - - reservedMarkChecking = true; - } - - - /** - * Register new {@link IonObjBinary} class for writing/loading. - * - * @param mark mark to be used 50..255, unless internal - * @param objClass class of the registered object - */ - public static void registerType(int mark, Class objClass) - { - // negative marks are allowed. - if (mark > 255) throw new IllegalArgumentException("Mark must be < 256."); - if (mark < 0) throw new IllegalArgumentException("Mark must be positive."); - - if (reservedMarkChecking && mark < 50) { - throw new IllegalArgumentException("Marks 0..49 are reserved."); - } - - if (registered[mark] != null) { - throw new IllegalArgumentException("Mark " + mark + " is already in use."); - } - - try { - objClass.getConstructor(); - } catch (NoSuchMethodException | SecurityException e) { - throw new RuntimeException("Class " + Log.str(objClass) + " doesn't have an implicit constructor."); - } - - registered[mark] = objClass; - } - - - /** - * Load binary from file and cast. - */ - public static T fromFile(String path) throws IOException - { - return fromFile(new File(path)); - } - - - /** - * Load binary from file and cast. - */ - public static T fromFile(File file) throws IOException - { - try(InputStream in = new FileInputStream(file)) { - return fromStream(in); - } - } - - - /** - * Load bundled from file and unwrap. - */ - public static T fromFile(String path, Class objClass) throws IOException - { - return fromFile(new File(path), objClass); - } - - - /** - * Load bundled from file and unwrap. - */ - public static T fromFile(File file, Class objClass) throws IOException - { - try(InputStream in = new FileInputStream(file)) { - - return fromStream(in, objClass); - - } - } - - - public static void toFile(String path, IonObjBundled obj) throws IOException - { - toFile(new File(path), obj); - } - - - /** - * Wrap bundled and save to file. - */ - public static void toFile(File file, IonObjBundled obj) throws IOException - { - toFile(file, wrap(obj)); - } - - - /** - * Write binary to file with mark. - */ - public static void toFile(String path, IonObjBinary obj) throws IOException - { - toFile(new File(path), obj); - } - - - /** - * Write binary to file with mark. - */ - public static void toFile(File file, IonObjBinary obj) throws IOException - { - file.getParentFile().mkdirs(); - try(OutputStream out = new FileOutputStream(file)) { - - toStream(out, obj); - - out.flush(); - out.close(); - } catch (final Exception e) { - throw new IOException("Error writing to ION file.", e); - } - } - - - /** - * Load object from stream based on mark, try to cast. - */ - public static T fromStream(InputStream in) throws IOException - { - final IonInput inp = new IonInput(in); - - return (T) inp.readObject(); - } - - - /** - * Load bundled object from stream, unwrap. - */ - public static T fromStream(InputStream in, Class objClass) throws IOException - { - return unwrap((IonBundle) new IonInput(in).readObject(), objClass); - } - - - /** - * Write object to output with a mark. - */ - public static void toStream(OutputStream out, IonObjBinary obj) throws IOException - { - new IonOutput(out).writeObject(obj); - } - - - /** - * Create new bundle and write the object to it. - */ - public static IonBundle wrap(IonObjBundled content) throws IOException - { - final IonBundle ib = new IonBundle(); - content.save(ib); - return ib; - } - - - /** - * Try to unwrap an object from bundle. The object class must have implicit - * accessible constructor. - * - * @param bundle unwrapped bundle - * @param objClass class of desired object - * @return the object unwrapped - * @throws IOException - */ - public static T unwrap(IonBundle bundle, Class objClass) throws IOException - { - try { - final T inst = objClass.newInstance(); - inst.load(bundle); - return inst; - } catch (InstantiationException | IllegalAccessException e) { - throw new IOException("Could not instantiate " + Log.str(objClass) + "."); - } - } - - - @SuppressWarnings("unchecked") - static Class getClassForMark(int mark) - { - return registered[mark]; - } - - - /** - * @return true if the mark is for a registered {@link IonObjBinary} object - */ - static boolean isMarkForBinary(int mark) - { - return registered[mark] != null; - } - - - /** - * Make sure object is registered in the table - * - * @throws IOException if not registered or class mismatch - */ - static void assertRegistered(IonObjBinary obj) throws IOException - { - final int mark = obj.getIonMark(); - - final Class clz = Ion.getClassForMark(mark); - - if (clz == null) { - throw new IOException("Not registered - mark: " + mark + ", class: " + Log.str(obj.getClass())); - } - - if (clz != obj.getClass()) { - throw new IOException("Class mismatch - mark: " + mark + ", class: " + Log.str(obj.getClass())); - } - } - -} diff --git a/src/mightypork/gamecore/util/ion/IonBundle.java b/src/mightypork/gamecore/util/ion/IonBundle.java deleted file mode 100644 index 48b065e..0000000 --- a/src/mightypork/gamecore/util/ion/IonBundle.java +++ /dev/null @@ -1,322 +0,0 @@ -package mightypork.gamecore.util.ion; - - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - - -/** - * Ion data bundle - simplified Map - * - * @author MightyPork - */ -public class IonBundle implements IonObjBinary { - - private final Map backingMap = new HashMap<>(); - - - public void putBundled(String key, IonObjBundled saved) throws IOException - { - final IonBundle ib = new IonBundle(); - saved.save(ib); - put(key, ib); - } - - - public T getBundled(String key, Class objClass) throws IOException - { - return Ion.unwrap(get(key, (IonBundle) null), objClass); - } - - - public void loadBundled(String key, IonObjBundled loaded) throws IOException - { - loaded.load(get(key, new IonBundle())); - } - - - public void loadBundle(String key, IonBundle bundle) - { - if (!containsKey(key)) return; - - final IonBundle ib = get(key, new IonBundle()); - - bundle.clear(); - bundle.putAll(ib); - } - - - public boolean containsKey(Object key) - { - return backingMap.containsKey(key); - } - - - public boolean containsValue(Object value) - { - return backingMap.containsValue(value); - } - - - public Map getMap(String key) - { - final Map m = new HashMap<>(); - loadMap(key, m); - return m; - } - - - public void loadMap(String key, Map filled) - { - final IonMapWrapper imw = get(key, null); - if (imw == null) return; - filled.clear(); - imw.fill(filled); - } - - - public Collection getSequence(String key) - { - final Collection s = new ArrayList<>(); - loadSequence(key, s); - return s; - } - - - public void loadSequence(String key, Collection filled) - { - final IonSequenceWrapper isw = get(key, null); - if (isw == null) return; - filled.clear(); - isw.fill(filled); - } - - - /** - * Get value, or fallback (if none found of with bad type). - * - * @param key - * @param fallback value - * @return value - */ - public T get(String key, T fallback) - { - try { - final T itm = (T) backingMap.get(key); - if (itm == null) return fallback; - return itm; - } catch (final ClassCastException e) { - return fallback; - } - } - - - /** - * Get value, or null (if none found of with bad type). - * - * @param key - * @return value - */ - public T get(String key) - { - return get(key, (T) null); - } - - - public void put(String key, IonObjBinary value) - { - if (key == null || value == null) return; - backingMap.put(key, value); - } - - - public void put(String key, boolean value) - { - backingMap.put(key, value); - } - - - public void put(String key, byte value) - { - backingMap.put(key, value); - } - - - public void put(String key, char value) - { - backingMap.put(key, value); - } - - - public void put(String key, short value) - { - backingMap.put(key, value); - } - - - public void put(String key, int value) - { - backingMap.put(key, value); - } - - - public void put(String key, long value) - { - backingMap.put(key, value); - } - - - public void put(String key, double value) - { - backingMap.put(key, value); - } - - - public void put(String key, float value) - { - backingMap.put(key, value); - } - - - public void put(String key, String value) - { - backingMap.put(key, value); - } - - - public void put(String key, boolean[] value) - { - backingMap.put(key, value); - } - - - public void put(String key, char[] value) - { - backingMap.put(key, value); - } - - - public void put(String key, short[] value) - { - backingMap.put(key, value); - } - - - public void put(String key, int[] value) - { - backingMap.put(key, value); - } - - - public void put(String key, long[] value) - { - backingMap.put(key, value); - } - - - public void put(String key, double[] value) - { - backingMap.put(key, value); - } - - - public void put(String key, float[] value) - { - backingMap.put(key, value); - } - - - public void put(String key, String[] value) - { - backingMap.put(key, value); - } - - - @SuppressWarnings("rawtypes") - public void putSequence(String key, Collection c) - { - backingMap.put(key, new IonSequenceWrapper(c)); - } - - - @SuppressWarnings("rawtypes") - public void putMap(String key, Map m) - { - backingMap.put(key, new IonMapWrapper(m)); - } - - - @Override - public short getIonMark() - { - return Ion.DATA_BUNDLE; - } - - - @Override - public void load(IonInput in) throws IOException - { - in.readMap(backingMap); - } - - - @Override - public void save(IonOutput out) throws IOException - { - out.writeMap(backingMap); - } - - - public int size() - { - return backingMap.size(); - } - - - public boolean isEmpty() - { - return backingMap.isEmpty(); - } - - - public void clear() - { - backingMap.clear(); - } - - - public Object remove(Object key) - { - return backingMap.remove(key); - } - - - public void putAll(IonBundle otherBundle) - { - backingMap.putAll(otherBundle.backingMap); - } - - - @Override - public String toString() - { - return backingMap.toString(); - } - - - @Override - public boolean equals(Object o) - { - return backingMap.equals(o); - } - - - @Override - public int hashCode() - { - return 47 ^ backingMap.hashCode(); - } -} diff --git a/src/mightypork/gamecore/util/ion/IonInput.java b/src/mightypork/gamecore/util/ion/IonInput.java deleted file mode 100644 index c4eef32..0000000 --- a/src/mightypork/gamecore/util/ion/IonInput.java +++ /dev/null @@ -1,454 +0,0 @@ -package mightypork.gamecore.util.ion; - - -import java.io.DataInput; -import java.io.DataInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import mightypork.gamecore.util.error.CorruptDataException; - - -/** - * Ion input stream - * - * @author MightyPork - */ -public class IonInput { - - private final DataInput in; - - - public IonInput(InputStream in) - { - this.in = new DataInputStream(in); - } - - - /** - * Read int 0-255. Suitable when the int was written using - * writeIntByte() method. - * - * @return int - * @throws IOException - */ - public int readIntByte() throws IOException - { - return in.readUnsignedByte(); - } - - - /** - * Read an int 0-65535. Suitable when the int was written using - * writeIntShort() method. - * - * @return int - * @throws IOException - */ - public int readIntShort() throws IOException - { - return in.readUnsignedShort(); - } - - - public boolean readBoolean() throws IOException - { - return in.readBoolean(); - } - - - public byte readByte() throws IOException - { - return in.readByte(); - } - - - public short readShort() throws IOException - { - return in.readShort(); - } - - - public char readChar() throws IOException - { - return in.readChar(); - } - - - public int readInt() throws IOException - { - return in.readInt(); - } - - - public long readLong() throws IOException - { - return in.readLong(); - } - - - public float readFloat() throws IOException - { - return in.readFloat(); - } - - - public double readDouble() throws IOException - { - return in.readDouble(); - } - - - public String readString() throws IOException - { - return in.readUTF(); - } - - - public boolean[] readBooleans() throws IOException - { - final int length = readLength(); - final boolean[] arr = new boolean[length]; - for (int i = 0; i < length; i++) { - arr[i] = in.readBoolean(); - } - return arr; - } - - - public byte[] readBytes() throws IOException - { - final int length = readLength(); - final byte[] arr = new byte[length]; - for (int i = 0; i < length; i++) { - arr[i] = in.readByte(); - } - return arr; - } - - - public char[] readChars() throws IOException - { - final int length = readLength(); - final char[] arr = new char[length]; - for (int i = 0; i < length; i++) { - arr[i] = in.readChar(); - } - return arr; - } - - - public short[] readShorts() throws IOException - { - final int length = readLength(); - final short[] arr = new short[length]; - for (int i = 0; i < length; i++) { - arr[i] = in.readShort(); - } - return arr; - } - - - public int[] readInts() throws IOException - { - final int length = readLength(); - final int[] arr = new int[length]; - for (int i = 0; i < length; i++) { - arr[i] = in.readInt(); - } - return arr; - } - - - public long[] readLongs() throws IOException - { - final int length = readLength(); - final long[] arr = new long[length]; - for (int i = 0; i < length; i++) { - arr[i] = in.readLong(); - } - return arr; - } - - - public float[] readFloats() throws IOException - { - final int length = readLength(); - final float[] arr = new float[length]; - for (int i = 0; i < length; i++) { - arr[i] = in.readFloat(); - } - return arr; - } - - - public double[] readDoubles() throws IOException - { - final int length = readLength(); - final double[] arr = new double[length]; - for (int i = 0; i < length; i++) { - arr[i] = in.readDouble(); - } - return arr; - } - - - public String[] readStrings() throws IOException - { - final int length = readLength(); - final String[] arr = new String[length]; - for (int i = 0; i < length; i++) { - arr[i] = in.readUTF(); - } - return arr; - } - - - public Object[] readObjects() throws IOException - { - final int length = readLength(); - final Object[] arr = new Object[length]; - for (int i = 0; i < length; i++) { - arr[i] = readObject(); - } - return arr; - } - - - /** - * Read bundle without a mark - */ - public IonBundle readBundle() throws IOException - { - final IonBundle ib = new IonBundle(); - ib.load(this); - return ib; - } - - - /** - * Read bundle without a mark, load into a provided one - */ - public void readBundle(IonBundle filled) throws IOException - { - filled.clear(); - filled.load(this); - } - - - private int readMark() throws IOException - { - return readIntByte(); - } - - - private int readLength() throws IOException - { - return readIntShort(); - } - - - /** - *

- * Read object based on mark; if null mark is found, returns default value. - *

- *

- * If, however, an object of invalid or different type is found, an - * exception will be thrown. - *

- * - * @param def default value. - * @return the loaded object - * @throws IOException - */ - @SuppressWarnings("unchecked") - public T readObject(T def) throws IOException - { - try { - final Object o = readObject(); - return (T) (o == null ? def : o); - } catch (final Exception e) { - throw new IOException("Could not load object.", e); - } - } - - - /** - * Read single object, preceded by a mark. - * - * @return the loaded object - * @throws IOException - */ - public Object readObject() throws IOException - { - final int mark = readMark(); - if (Ion.isMarkForBinary(mark)) { - IonObjBinary loaded; - - try { - - loaded = Ion.getClassForMark(mark).newInstance(); - - } catch (InstantiationException | IllegalAccessException e) { - throw new RuntimeException("Couldn not load object with mark: " + mark, e); - } - - loaded.load(this); - return loaded; - } - - switch (mark) { - case Ion.NULL: - return null; - - case Ion.BOOLEAN: - return readBoolean(); - - case Ion.BYTE: - return readByte(); - - case Ion.CHAR: - return readChar(); - - case Ion.SHORT: - return readShort(); - - case Ion.INT: - return readInt(); - - case Ion.LONG: - return readLong(); - - case Ion.FLOAT: - return readFloat(); - - case Ion.DOUBLE: - return readDouble(); - - case Ion.STRING: - return readString(); - - case Ion.BOOLEAN_ARRAY: - return readBooleans(); - - case Ion.BYTE_ARRAY: - return readBytes(); - - case Ion.CHAR_ARRAY: - return readChars(); - - case Ion.SHORT_ARRAY: - return readShorts(); - - case Ion.INT_ARRAY: - return readInts(); - - case Ion.LONG_ARRAY: - return readLongs(); - - case Ion.FLOAT_ARRAY: - return readFloats(); - - case Ion.DOUBLE_ARRAY: - return readDoubles(); - - case Ion.STRING_ARRAY: - return readStrings(); - - default: - throw new CorruptDataException("Invalid mark: " + mark); - } - } - - - /** - * Reads mark and returns true if the mark is ENTRY, false if the mark is - * END. Throws an exception otherwise. - * - * @return mark was ENTRY - * @throws IOException when the mark is neither ENTRY or END. - */ - public boolean hasNextEntry() throws IOException - { - final int mark = readMark(); - if (mark == Ion.ENTRY) return true; - if (mark == Ion.END) return false; - - throw new CorruptDataException("Unexpected mark in sequence: " + mark); - } - - - /** - * Read a sequence of elements into an ArrayList - * - * @return the collection - * @throws IOException - */ - public Collection readSequence() throws IOException - { - return readSequence(new ArrayList()); - } - - - /** - * Load entries into a collection. The collection is cleaned first. - * - * @param filled collection to populate - * @return the collection - * @throws IOException - */ - @SuppressWarnings("unchecked") - public Collection readSequence(Collection filled) throws IOException - { - try { - filled.clear(); - while (hasNextEntry()) { - filled.add((T) readObject()); - } - return filled; - } catch (final ClassCastException e) { - throw new CorruptDataException("Unexpected element type in sequence.", e); - } - } - - - /** - * Read element pairs into a HashMap - * - * @return the map - * @throws IOException - */ - public Map readMap() throws IOException - { - return readMap(new HashMap()); - } - - - /** - * Load data into a map. The map is cleaned first. - * - * @param filled filled map - * @return the map - * @throws IOException - */ - @SuppressWarnings("unchecked") - public Map readMap(Map filled) throws IOException - { - try { - filled.clear(); - while (hasNextEntry()) { - final K key = (K) readObject(); - final V value = (V) readObject(); - - filled.put(key, value); - } - return filled; - } catch (final ClassCastException e) { - throw new CorruptDataException("Unexpected element type in map.", e); - } - } -} diff --git a/src/mightypork/gamecore/util/ion/IonMapWrapper.java b/src/mightypork/gamecore/util/ion/IonMapWrapper.java deleted file mode 100644 index ec505b5..0000000 --- a/src/mightypork/gamecore/util/ion/IonMapWrapper.java +++ /dev/null @@ -1,55 +0,0 @@ -package mightypork.gamecore.util.ion; - - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - - -@SuppressWarnings({ "rawtypes", "unchecked" }) -public class IonMapWrapper implements IonObjBinary { - - private final Map map; - - - public IonMapWrapper() - { - map = new HashMap(); - } - - - public IonMapWrapper(Map saved) - { - map = saved; - } - - - @Override - public void load(IonInput in) throws IOException - { - map.clear(); - in.readMap(map); - } - - - @Override - public void save(IonOutput out) throws IOException - { - out.writeMap(map); - } - - - public void fill(Map o) - { - o.clear(); - o.putAll(map); - } - - - @Override - public short getIonMark() - { - return Ion.MAP_WRAPPER; - } - -} diff --git a/src/mightypork/gamecore/util/ion/IonObjBinary.java b/src/mightypork/gamecore/util/ion/IonObjBinary.java deleted file mode 100644 index 8240dd8..0000000 --- a/src/mightypork/gamecore/util/ion/IonObjBinary.java +++ /dev/null @@ -1,17 +0,0 @@ -package mightypork.gamecore.util.ion; - - -/** - * Binary ion object, with a mark = saveable / loadable on it's own - * - * @author MightyPork - */ -public interface IonObjBinary extends IonObjBlob { - - /** - * Get Ion mark byte. - * - * @return Ion mark byte. - */ - public short getIonMark(); -} diff --git a/src/mightypork/gamecore/util/ion/IonObjBlob.java b/src/mightypork/gamecore/util/ion/IonObjBlob.java deleted file mode 100644 index 834974a..0000000 --- a/src/mightypork/gamecore/util/ion/IonObjBlob.java +++ /dev/null @@ -1,31 +0,0 @@ -package mightypork.gamecore.util.ion; - - -import java.io.IOException; - - -/** - * Binary ion object, with no mark = cannot be loaded on it's own - * - * @author MightyPork - */ -public interface IonObjBlob { - - /** - * Load data from the input stream. - * - * @param in input stream - * @throws IOException - */ - void load(IonInput in) throws IOException; - - - /** - * Store data to output stream (in such way that the load method will later - * be able to read it). - * - * @param out Output stream - * @throws IOException - */ - void save(IonOutput out) throws IOException; -} diff --git a/src/mightypork/gamecore/util/ion/IonObjBundled.java b/src/mightypork/gamecore/util/ion/IonObjBundled.java deleted file mode 100644 index 4d5a462..0000000 --- a/src/mightypork/gamecore/util/ion/IonObjBundled.java +++ /dev/null @@ -1,18 +0,0 @@ -package mightypork.gamecore.util.ion; - - -import java.io.IOException; - - -/** - * Bundled ion object - * - * @author MightyPork - */ -public interface IonObjBundled { - - void load(IonBundle bundle) throws IOException; - - - void save(IonBundle bundle) throws IOException; -} diff --git a/src/mightypork/gamecore/util/ion/IonOutput.java b/src/mightypork/gamecore/util/ion/IonOutput.java deleted file mode 100644 index 60a20d4..0000000 --- a/src/mightypork/gamecore/util/ion/IonOutput.java +++ /dev/null @@ -1,398 +0,0 @@ -package mightypork.gamecore.util.ion; - - -import java.io.DataOutput; -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.util.Collection; -import java.util.Map; -import java.util.Map.Entry; - -import mightypork.gamecore.logging.Log; - - -/** - * Ion output stream - * - * @author MightyPork - */ -public class IonOutput { - - private final DataOutput out; - - - public IonOutput(OutputStream out) - { - this.out = new DataOutputStream(out); - } - - - public void writeBoolean(boolean a) throws IOException - { - out.writeBoolean(a); - } - - - public void writeByte(int a) throws IOException - { - out.writeByte(a); - } - - - public void writeShort(int a) throws IOException - { - out.writeShort(a); - } - - - public void writeChar(int a) throws IOException - { - out.writeChar(a); - } - - - public void writeInt(int a) throws IOException - { - out.writeInt(a); - } - - - public void writeIntShort(int a) throws IOException - { - out.writeShort(a); - } - - - public void writeIntByte(int a) throws IOException - { - out.writeByte(a); - } - - - public void writeLong(long a) throws IOException - { - out.writeLong(a); - } - - - public void writeFloat(float a) throws IOException - { - out.writeFloat(a); - } - - - public void writeDouble(double a) throws IOException - { - out.writeDouble(a); - } - - - public void writeBytes(String a) throws IOException - { - out.writeBytes(a); - } - - - public void writeString(String a) throws IOException - { - out.writeUTF(a); - } - - - public void writeBooleans(boolean[] arr) throws IOException - { - writeLength(arr.length); - for (final boolean a : arr) { - out.writeBoolean(a); - } - } - - - public void writeBytes(byte[] arr) throws IOException - { - writeLength(arr.length); - for (final byte a : arr) { - out.writeByte(a); - } - } - - - public void writeChars(char[] arr) throws IOException - { - writeLength(arr.length); - for (final char a : arr) { - out.writeChar(a); - } - } - - - public void writeShorts(short[] arr) throws IOException - { - writeLength(arr.length); - for (final short a : arr) { - out.writeShort(a); - } - } - - - public void writeInts(int[] arr) throws IOException - { - writeLength(arr.length); - for (final int a : arr) { - out.writeInt(a); - } - } - - - public void writeLongs(long[] arr) throws IOException - { - writeLength(arr.length); - for (final long a : arr) { - out.writeLong(a); - } - } - - - public void writeFloats(float[] arr) throws IOException - { - writeLength(arr.length); - for (final float a : arr) { - out.writeFloat(a); - } - } - - - public void writeDoubles(double[] arr) throws IOException - { - writeLength(arr.length); - for (final double a : arr) { - out.writeDouble(a); - } - } - - - public void writeStrings(String[] arr) throws IOException - { - writeLength(arr.length); - for (final String a : arr) { - out.writeUTF(a); - } - } - - - /** - * Write a bundle without a mark - */ - public void writeBundle(IonBundle bundle) throws IOException - { - bundle.save(this); - } - - - /** - * Write array of objects. Supported are Ionizables, primitive types, - * String, and their arrays. - * - * @param arr array to write - * @throws IOException on IO error or on invalid object type. - */ - public void writeObjects(Object[] arr) throws IOException - { - writeLength(arr.length); - for (final Object a : arr) { - writeObject(a); - } - } - - - public void writeSequence(Collection sequence) throws IOException - { - for (final T element : sequence) { - startEntry(); - writeObject(element); - } - endSequence(); - } - - - public void writeMap(Map map) throws IOException - { - for (final Entry e : map.entrySet()) { - if (e.getValue() == null) { - continue; - } - - startEntry(); - writeObject(e.getKey()); - writeObject(e.getValue()); - } - endSequence(); - } - - - public void endSequence() throws IOException - { - writeMark(Ion.END); - } - - - public void startEntry() throws IOException - { - writeMark(Ion.ENTRY); - } - - - private void writeMark(int mark) throws IOException - { - writeIntByte(mark); - } - - - private void writeLength(int length) throws IOException - { - writeIntShort(length); - } - - - /** - * Write an object. Supported are Ionizable, primitive types, String, and - * their arrays. - * - * @param obj obj to write - * @throws IOException on IO error or invalid object type. - */ - public void writeObject(Object obj) throws IOException - { - if (obj == null) { - writeMark(Ion.NULL); - return; - } - - if (obj instanceof IonObjBinary) { - - final IonObjBinary ionObject = (IonObjBinary) obj; - - Ion.assertRegistered(ionObject); - - writeMark(ionObject.getIonMark()); - ionObject.save(this); - - return; - } - - if (obj instanceof IonObjBundled) { - throw new IOException("Bundled objects cannot be written to ION stream directly at " + obj); - } - - if (obj instanceof Boolean) { - writeMark(Ion.BOOLEAN); - writeBoolean((Boolean) obj); - return; - } - - if (obj instanceof Byte) { - writeMark(Ion.BYTE); - writeByte((Byte) obj); - return; - } - - if (obj instanceof Character) { - writeMark(Ion.CHAR); - writeChar((Character) obj); - return; - } - - if (obj instanceof Short) { - writeMark(Ion.SHORT); - writeShort((Short) obj); - return; - } - - if (obj instanceof Integer) { - writeMark(Ion.INT); - writeInt((Integer) obj); - return; - } - - if (obj instanceof Long) { - writeMark(Ion.LONG); - writeLong((Long) obj); - return; - } - - if (obj instanceof Float) { - writeMark(Ion.FLOAT); - writeFloat((Float) obj); - return; - } - - if (obj instanceof Double) { - writeMark(Ion.DOUBLE); - writeDouble((Double) obj); - return; - } - - if (obj instanceof String) { - writeMark(Ion.STRING); - writeString((String) obj); - return; - } - - if (obj instanceof boolean[]) { - writeMark(Ion.BOOLEAN_ARRAY); - writeBooleans((boolean[]) obj); - return; - } - - if (obj instanceof byte[]) { - writeMark(Ion.BYTE_ARRAY); - writeBytes((byte[]) obj); - return; - } - - if (obj instanceof char[]) { - writeMark(Ion.CHAR_ARRAY); - writeChars((char[]) obj); - return; - } - - if (obj instanceof short[]) { - writeMark(Ion.SHORT_ARRAY); - writeShorts((short[]) obj); - return; - } - - if (obj instanceof int[]) { - writeMark(Ion.INT_ARRAY); - writeInts((int[]) obj); - return; - } - - if (obj instanceof long[]) { - writeMark(Ion.LONG_ARRAY); - writeLongs((long[]) obj); - return; - } - - if (obj instanceof float[]) { - writeMark(Ion.FLOAT_ARRAY); - writeFloats((float[]) obj); - return; - } - - if (obj instanceof double[]) { - writeMark(Ion.DOUBLE_ARRAY); - writeDoubles((double[]) obj); - return; - } - - if (obj instanceof String[]) { - writeMark(Ion.STRING_ARRAY); - writeStrings((String[]) obj); - return; - } - - throw new IOException("Object " + Log.str(obj) + " could not be be written to stream."); - } -} diff --git a/src/mightypork/gamecore/util/ion/IonSequenceWrapper.java b/src/mightypork/gamecore/util/ion/IonSequenceWrapper.java deleted file mode 100644 index 5396f39..0000000 --- a/src/mightypork/gamecore/util/ion/IonSequenceWrapper.java +++ /dev/null @@ -1,55 +0,0 @@ -package mightypork.gamecore.util.ion; - - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; - - -@SuppressWarnings({ "rawtypes", "unchecked" }) -public class IonSequenceWrapper implements IonObjBinary { - - private Collection collection = new ArrayList(); - - - public IonSequenceWrapper() - { - collection = new ArrayList(); - } - - - public IonSequenceWrapper(Collection saved) - { - collection = saved; - } - - - @Override - public void load(IonInput in) throws IOException - { - collection.clear(); - in.readSequence(collection); - } - - - @Override - public void save(IonOutput out) throws IOException - { - out.writeSequence(collection); - } - - - public void fill(Collection o) - { - o.clear(); - o.addAll(collection); - } - - - @Override - public short getIonMark() - { - return Ion.SEQUENCE_WRAPPER; - } - -} diff --git a/src/mightypork/gamecore/util/math/Calc.java b/src/mightypork/gamecore/util/math/Calc.java index 1d40931..f46874c 100644 --- a/src/mightypork/gamecore/util/math/Calc.java +++ b/src/mightypork/gamecore/util/math/Calc.java @@ -14,7 +14,7 @@ import org.lwjgl.BufferUtils; /** * Math utils * - * @author MightyPork + * @author Ondřej Hruška */ public class Calc { @@ -75,7 +75,7 @@ public class Calc { /** * Calc subclass with buffer utils. * - * @author MightyPork + * @author Ondřej Hruška */ public static class Buffers { @@ -120,7 +120,7 @@ public class Calc { /** * Angle calculations for degrees. * - * @author MightyPork + * @author Ondřej Hruška */ public static class Deg { @@ -280,7 +280,7 @@ public class Calc { /** * Angle calculations for radians. * - * @author MightyPork + * @author Ondřej Hruška */ public static class Rad { diff --git a/src/mightypork/gamecore/util/math/Easing.java b/src/mightypork/gamecore/util/math/Easing.java index 24737be..48a9fe5 100644 --- a/src/mightypork/gamecore/util/math/Easing.java +++ b/src/mightypork/gamecore/util/math/Easing.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.annot.FactoryMethod; /** * EasingFunction function. * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class Easing { @@ -62,7 +62,7 @@ public abstract class Easing { /** * Reverse EasingFunction * - * @author MightyPork + * @author Ondřej Hruška */ private static class Reverse extends Easing { @@ -88,7 +88,7 @@ public abstract class Easing { /** * Composite EasingFunction (0-0.5 EasingFunction A, 0.5-1 EasingFunction B) * - * @author MightyPork + * @author Ondřej Hruška */ private static class Composite extends Easing { diff --git a/src/mightypork/gamecore/util/math/Polar.java b/src/mightypork/gamecore/util/math/Polar.java index 7f2c24a..d57a33d 100644 --- a/src/mightypork/gamecore/util/math/Polar.java +++ b/src/mightypork/gamecore/util/math/Polar.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.math.constraints.vect.Vect; /** * Polar coordinate * - * @author MightyPork + * @author Ondřej Hruška */ public class Polar { diff --git a/src/mightypork/gamecore/util/math/Range.java b/src/mightypork/gamecore/util/math/Range.java index 70318a4..e4c3d59 100644 --- a/src/mightypork/gamecore/util/math/Range.java +++ b/src/mightypork/gamecore/util/math/Range.java @@ -7,7 +7,7 @@ import java.util.Random; /** * Numeric range, able to generate random numbers and give min/max values. * - * @author MightyPork + * @author Ondřej Hruška */ public class Range { diff --git a/src/mightypork/gamecore/util/math/algo/Coord.java b/src/mightypork/gamecore/util/math/algo/Coord.java index 7c53a8b..4f03161 100644 --- a/src/mightypork/gamecore/util/math/algo/Coord.java +++ b/src/mightypork/gamecore/util/math/algo/Coord.java @@ -4,24 +4,24 @@ package mightypork.gamecore.util.math.algo; import java.io.IOException; import mightypork.gamecore.util.annot.FactoryMethod; -import mightypork.gamecore.util.ion.IonBundle; -import mightypork.gamecore.util.ion.IonInput; -import mightypork.gamecore.util.ion.IonObjBinary; -import mightypork.gamecore.util.ion.IonObjBundled; -import mightypork.gamecore.util.ion.IonOutput; import mightypork.gamecore.util.math.Calc; import mightypork.gamecore.util.math.constraints.vect.Vect; import mightypork.gamecore.util.math.constraints.vect.VectConst; +import mightypork.ion.IonBundle; +import mightypork.ion.IonInput; +import mightypork.ion.IonObjBinary; +import mightypork.ion.IonObjBundled; +import mightypork.ion.IonOutput; /** * Very simple integer coordinate * - * @author MightyPork + * @author Ondřej Hruška */ -public class Coord implements IonObjBundled, IonObjBinary { +public class Coord implements IonObjBinary, IonObjBundled { - public static final short ION_MARK = 255; + public static final int ION_MARK = 255; public int x; public int y; @@ -180,31 +180,24 @@ public class Coord implements IonObjBundled, IonObjBinary { } - @Override - public void load(IonBundle bundle) throws IOException + public static Coord fromVect(Vect vect) { - x = bundle.get("x", 0); - y = bundle.get("y", 0); + return make((int) Math.floor(vect.x()), (int) Math.floor(vect.y())); } @Override - public void save(IonBundle bundle) throws IOException + public void load(IonBundle in) { - bundle.put("x", x); - bundle.put("y", y); + x = in.get("x", x); + y = in.get("y", y); } @Override - public short getIonMark() + public void save(IonBundle out) { - return ION_MARK; - } - - - public static Coord fromVect(Vect vect) - { - return make((int) Math.floor(vect.x()), (int) Math.floor(vect.y())); + out.put("x", x); + out.put("y", y); } } diff --git a/src/mightypork/gamecore/util/math/algo/Move.java b/src/mightypork/gamecore/util/math/algo/Move.java index d78535b..246aa3f 100644 --- a/src/mightypork/gamecore/util/math/algo/Move.java +++ b/src/mightypork/gamecore/util/math/algo/Move.java @@ -3,20 +3,18 @@ package mightypork.gamecore.util.math.algo; import java.io.IOException; -import mightypork.gamecore.util.ion.IonBundle; -import mightypork.gamecore.util.ion.IonInput; -import mightypork.gamecore.util.ion.IonObjBinary; -import mightypork.gamecore.util.ion.IonObjBundled; -import mightypork.gamecore.util.ion.IonOutput; +import mightypork.ion.IonInput; +import mightypork.ion.IonObjBinary; +import mightypork.ion.IonOutput; /** * Path step.
* Must be binary in order to be saveable in lists. * - * @author MightyPork + * @author Ondřej Hruška */ -public class Move implements IonObjBinary, IonObjBundled { +public class Move implements IonObjBinary { public static final int ION_MARK = 254; @@ -76,13 +74,6 @@ public class Move implements IonObjBinary, IonObjBundled { } - @Override - public short getIonMark() - { - return ION_MARK; - } - - @Override public String toString() { @@ -104,21 +95,4 @@ public class Move implements IonObjBinary, IonObjBundled { out.writeByte(x); out.writeByte(y); } - - - @Override - public void load(IonBundle bundle) throws IOException - { - x = bundle.get("x", x); - y = bundle.get("y", y); - } - - - @Override - public void save(IonBundle bundle) throws IOException - { - bundle.put("x", x); - bundle.put("y", y); - } - } diff --git a/src/mightypork/gamecore/util/math/algo/Moves.java b/src/mightypork/gamecore/util/math/algo/Moves.java index 08f1911..3167a09 100644 --- a/src/mightypork/gamecore/util/math/algo/Moves.java +++ b/src/mightypork/gamecore/util/math/algo/Moves.java @@ -12,7 +12,7 @@ import mightypork.gamecore.util.math.Calc; /** * Move lists, bit masks and other utilities * - * @author MightyPork + * @author Ondřej Hruška */ public class Moves { diff --git a/src/mightypork/gamecore/util/math/algo/pathfinding/PathFinder.java b/src/mightypork/gamecore/util/math/algo/pathfinding/PathFinder.java index 8173d06..c23cb66 100644 --- a/src/mightypork/gamecore/util/math/algo/pathfinding/PathFinder.java +++ b/src/mightypork/gamecore/util/math/algo/pathfinding/PathFinder.java @@ -16,7 +16,7 @@ import mightypork.gamecore.util.math.algo.pathfinding.heuristics.ManhattanHeuris /** * A* pathfinder * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class PathFinder { diff --git a/src/mightypork/gamecore/util/math/algo/pathfinding/PathFinderProxy.java b/src/mightypork/gamecore/util/math/algo/pathfinding/PathFinderProxy.java index 163966b..49f44cc 100644 --- a/src/mightypork/gamecore/util/math/algo/pathfinding/PathFinderProxy.java +++ b/src/mightypork/gamecore/util/math/algo/pathfinding/PathFinderProxy.java @@ -11,7 +11,7 @@ import mightypork.gamecore.util.math.algo.Move; * Pathfinder proxy. Can be used to override individual methods but keep the * rest as is. * - * @author MightyPork + * @author Ondřej Hruška */ public class PathFinderProxy extends PathFinder { diff --git a/src/mightypork/gamecore/util/math/color/Color.java b/src/mightypork/gamecore/util/math/color/Color.java index c439f36..29404b3 100644 --- a/src/mightypork/gamecore/util/math/color/Color.java +++ b/src/mightypork/gamecore/util/math/color/Color.java @@ -13,7 +13,7 @@ import mightypork.gamecore.util.math.constraints.num.Num; * Color.
* All values are 0-1 * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class Color { diff --git a/src/mightypork/gamecore/util/math/color/pal/CGA.java b/src/mightypork/gamecore/util/math/color/pal/CGA.java index aa525a9..6e2cc56 100644 --- a/src/mightypork/gamecore/util/math/color/pal/CGA.java +++ b/src/mightypork/gamecore/util/math/color/pal/CGA.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.math.color.Color; /** * CGA palette * - * @author MightyPork + * @author Ondřej Hruška */ public interface CGA { diff --git a/src/mightypork/gamecore/util/math/color/pal/CMDR.java b/src/mightypork/gamecore/util/math/color/pal/CMDR.java index 63a8833..f03b238 100644 --- a/src/mightypork/gamecore/util/math/color/pal/CMDR.java +++ b/src/mightypork/gamecore/util/math/color/pal/CMDR.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.math.color.Color; /** * COMMODORE palette * - * @author MightyPork + * @author Ondřej Hruška */ public interface CMDR { diff --git a/src/mightypork/gamecore/util/math/color/pal/PAL16.java b/src/mightypork/gamecore/util/math/color/pal/PAL16.java index 08d500c..9f075ce 100644 --- a/src/mightypork/gamecore/util/math/color/pal/PAL16.java +++ b/src/mightypork/gamecore/util/math/color/pal/PAL16.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.math.color.Color; /** * PAL16 palette via http://androidarts.com/palette/16pal.htm * - * @author MightyPork + * @author Ondřej Hruška */ public interface PAL16 { diff --git a/src/mightypork/gamecore/util/math/color/pal/RGB.java b/src/mightypork/gamecore/util/math/color/pal/RGB.java index cdbdaf5..e278ab0 100644 --- a/src/mightypork/gamecore/util/math/color/pal/RGB.java +++ b/src/mightypork/gamecore/util/math/color/pal/RGB.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.math.color.Color; /** * Basic RGB palette * - * @author MightyPork + * @author Ondřej Hruška */ public class RGB { diff --git a/src/mightypork/gamecore/util/math/color/pal/ZX.java b/src/mightypork/gamecore/util/math/color/pal/ZX.java index 5ed4ca2..50a7617 100644 --- a/src/mightypork/gamecore/util/math/color/pal/ZX.java +++ b/src/mightypork/gamecore/util/math/color/pal/ZX.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.math.color.Color; /** * ZX Spectrum palette * - * @author MightyPork + * @author Ondřej Hruška */ public interface ZX { diff --git a/src/mightypork/gamecore/util/math/constraints/ConstraintCache.java b/src/mightypork/gamecore/util/math/constraints/ConstraintCache.java index 024589a..212ee4e 100644 --- a/src/mightypork/gamecore/util/math/constraints/ConstraintCache.java +++ b/src/mightypork/gamecore/util/math/constraints/ConstraintCache.java @@ -4,7 +4,7 @@ package mightypork.gamecore.util.math.constraints; /** * Constraint cache * - * @author MightyPork + * @author Ondřej Hruška * @param constraint type */ public interface ConstraintCache extends Pollable { diff --git a/src/mightypork/gamecore/util/math/constraints/DigestCache.java b/src/mightypork/gamecore/util/math/constraints/DigestCache.java index ea427db..937a940 100644 --- a/src/mightypork/gamecore/util/math/constraints/DigestCache.java +++ b/src/mightypork/gamecore/util/math/constraints/DigestCache.java @@ -4,7 +4,7 @@ package mightypork.gamecore.util.math.constraints; /** * Parametrized implementation of a {@link Digestable} * - * @author MightyPork + * @author Ondřej Hruška * @param digest class */ public abstract class DigestCache implements Digestable { diff --git a/src/mightypork/gamecore/util/math/constraints/Digestable.java b/src/mightypork/gamecore/util/math/constraints/Digestable.java index 287b594..5d3bcb1 100644 --- a/src/mightypork/gamecore/util/math/constraints/Digestable.java +++ b/src/mightypork/gamecore/util/math/constraints/Digestable.java @@ -18,7 +18,7 @@ package mightypork.gamecore.util.math.constraints; * that digest caching is enabled, and a flag that a digest is dirty. *

* - * @author MightyPork + * @author Ondřej Hruška * @param digest class */ public interface Digestable { diff --git a/src/mightypork/gamecore/util/math/constraints/Pollable.java b/src/mightypork/gamecore/util/math/constraints/Pollable.java index c2b98b1..4fca35c 100644 --- a/src/mightypork/gamecore/util/math/constraints/Pollable.java +++ b/src/mightypork/gamecore/util/math/constraints/Pollable.java @@ -4,7 +4,7 @@ package mightypork.gamecore.util.math.constraints; /** * Can be asked to update it's state * - * @author MightyPork + * @author Ondřej Hruška */ public interface Pollable { diff --git a/src/mightypork/gamecore/util/math/constraints/Poller.java b/src/mightypork/gamecore/util/math/constraints/Poller.java index 3b40238..12c6db5 100644 --- a/src/mightypork/gamecore/util/math/constraints/Poller.java +++ b/src/mightypork/gamecore/util/math/constraints/Poller.java @@ -8,7 +8,7 @@ import java.util.Set; /** * Used to poll a number of {@link Pollable}s * - * @author MightyPork + * @author Ondřej Hruška */ public class Poller implements Pollable { diff --git a/src/mightypork/gamecore/util/math/constraints/num/NumConst.java b/src/mightypork/gamecore/util/math/constraints/num/NumConst.java index 7eb42aa..fa31fa9 100644 --- a/src/mightypork/gamecore/util/math/constraints/num/NumConst.java +++ b/src/mightypork/gamecore/util/math/constraints/num/NumConst.java @@ -9,7 +9,7 @@ import mightypork.gamecore.util.math.constraints.num.caching.NumDigest; * It's arranged so that operations with constant arguments yield constant * results. * - * @author MightyPork + * @author Ondřej Hruška */ public class NumConst extends Num { diff --git a/src/mightypork/gamecore/util/math/constraints/num/NumSum.java b/src/mightypork/gamecore/util/math/constraints/num/NumSum.java index 2262896..7dbaad6 100644 --- a/src/mightypork/gamecore/util/math/constraints/num/NumSum.java +++ b/src/mightypork/gamecore/util/math/constraints/num/NumSum.java @@ -8,7 +8,7 @@ import java.util.List; /** * Expandable sum of multiple numbers * - * @author MightyPork + * @author Ondřej Hruška */ public class NumSum extends Num { diff --git a/src/mightypork/gamecore/util/math/constraints/num/caching/AbstractNumCache.java b/src/mightypork/gamecore/util/math/constraints/num/caching/AbstractNumCache.java index d5799a3..085cca2 100644 --- a/src/mightypork/gamecore/util/math/constraints/num/caching/AbstractNumCache.java +++ b/src/mightypork/gamecore/util/math/constraints/num/caching/AbstractNumCache.java @@ -16,7 +16,7 @@ import mightypork.gamecore.util.math.constraints.num.proxy.NumAdapter; * default. *

* - * @author MightyPork + * @author Ondřej Hruška */ public abstract class AbstractNumCache extends NumAdapter implements ConstraintCache { diff --git a/src/mightypork/gamecore/util/math/constraints/num/caching/NumCache.java b/src/mightypork/gamecore/util/math/constraints/num/caching/NumCache.java index f1f70db..4ed9cf4 100644 --- a/src/mightypork/gamecore/util/math/constraints/num/caching/NumCache.java +++ b/src/mightypork/gamecore/util/math/constraints/num/caching/NumCache.java @@ -8,7 +8,7 @@ import mightypork.gamecore.util.math.constraints.num.Num; /** * Num cache implementation * - * @author MightyPork + * @author Ondřej Hruška */ public class NumCache extends AbstractNumCache { diff --git a/src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimated.java b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimated.java index 5c5ba23..41220e7 100644 --- a/src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimated.java +++ b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimated.java @@ -12,7 +12,7 @@ import mightypork.gamecore.util.math.timing.Pauseable; * When both in and out easings are set differently, then they'll be used for * fade-in and fade-out respectively. Otherwise both use the same. * - * @author MightyPork + * @author Ondřej Hruška */ public class NumAnimated extends NumMutable implements Updateable, Pauseable { diff --git a/src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimatedDeg.java b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimatedDeg.java index b49b65d..6c7d60c 100644 --- a/src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimatedDeg.java +++ b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimatedDeg.java @@ -9,7 +9,7 @@ import mightypork.gamecore.util.math.Easing; /** * Degree animator * - * @author MightyPork + * @author Ondřej Hruška */ public class NumAnimatedDeg extends NumAnimated { diff --git a/src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimatedRad.java b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimatedRad.java index cbc6bd5..43474ad 100644 --- a/src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimatedRad.java +++ b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimatedRad.java @@ -9,7 +9,7 @@ import mightypork.gamecore.util.math.Easing; /** * Radians animator * - * @author MightyPork + * @author Ondřej Hruška */ public class NumAnimatedRad extends NumAnimated { diff --git a/src/mightypork/gamecore/util/math/constraints/num/mutable/NumMutable.java b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumMutable.java index a3331e1..d9daeee 100644 --- a/src/mightypork/gamecore/util/math/constraints/num/mutable/NumMutable.java +++ b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumMutable.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.math.constraints.num.Num; /** * Mutable numeric variable * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class NumMutable extends Num { diff --git a/src/mightypork/gamecore/util/math/constraints/num/mutable/NumVar.java b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumVar.java index 4878bd2..997b465 100644 --- a/src/mightypork/gamecore/util/math/constraints/num/mutable/NumVar.java +++ b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumVar.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.math.constraints.num.Num; /** * Mutable numeric variable. * - * @author MightyPork + * @author Ondřej Hruška */ public class NumVar extends NumMutable { diff --git a/src/mightypork/gamecore/util/math/constraints/num/proxy/NumBound.java b/src/mightypork/gamecore/util/math/constraints/num/proxy/NumBound.java index 90952fa..dc6aaff 100644 --- a/src/mightypork/gamecore/util/math/constraints/num/proxy/NumBound.java +++ b/src/mightypork/gamecore/util/math/constraints/num/proxy/NumBound.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.math.constraints.num.Num; /** * Numeric constraint * - * @author MightyPork + * @author Ondřej Hruška */ public interface NumBound { diff --git a/src/mightypork/gamecore/util/math/constraints/num/proxy/PluggableNumBound.java b/src/mightypork/gamecore/util/math/constraints/num/proxy/PluggableNumBound.java index 8006718..494143d 100644 --- a/src/mightypork/gamecore/util/math/constraints/num/proxy/PluggableNumBound.java +++ b/src/mightypork/gamecore/util/math/constraints/num/proxy/PluggableNumBound.java @@ -4,7 +4,7 @@ package mightypork.gamecore.util.math.constraints.num.proxy; /** * Pluggable numeric constraint * - * @author MightyPork + * @author Ondřej Hruška */ public interface PluggableNumBound extends NumBound { diff --git a/src/mightypork/gamecore/util/math/constraints/rect/Rect.java b/src/mightypork/gamecore/util/math/constraints/rect/Rect.java index 8b7ad8f..169bd21 100644 --- a/src/mightypork/gamecore/util/math/constraints/rect/Rect.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/Rect.java @@ -20,7 +20,7 @@ import mightypork.gamecore.util.math.constraints.vect.VectConst; /** * Common methods for all kinds of Rects * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class Rect implements RectBound, Digestable { diff --git a/src/mightypork/gamecore/util/math/constraints/rect/RectConst.java b/src/mightypork/gamecore/util/math/constraints/rect/RectConst.java index 613ac94..578bca7 100644 --- a/src/mightypork/gamecore/util/math/constraints/rect/RectConst.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/RectConst.java @@ -12,7 +12,7 @@ import mightypork.gamecore.util.math.constraints.vect.VectConst; * It's arranged so that operations with constant arguments yield constant * results. * - * @author MightyPork + * @author Ondřej Hruška */ public class RectConst extends Rect { diff --git a/src/mightypork/gamecore/util/math/constraints/rect/builders/TiledRect.java b/src/mightypork/gamecore/util/math/constraints/rect/builders/TiledRect.java index 6256314..92b7d5b 100644 --- a/src/mightypork/gamecore/util/math/constraints/rect/builders/TiledRect.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/builders/TiledRect.java @@ -11,7 +11,7 @@ import mightypork.gamecore.util.math.constraints.vect.Vect; /** * Utility for cutting rect into evenly sized cells. * - * @author MightyPork + * @author Ondřej Hruška */ public class TiledRect extends RectProxy { diff --git a/src/mightypork/gamecore/util/math/constraints/rect/caching/AbstractRectCache.java b/src/mightypork/gamecore/util/math/constraints/rect/caching/AbstractRectCache.java index 1a8993e..6379b2b 100644 --- a/src/mightypork/gamecore/util/math/constraints/rect/caching/AbstractRectCache.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/caching/AbstractRectCache.java @@ -16,7 +16,7 @@ import mightypork.gamecore.util.math.constraints.rect.proxy.RectAdapter; * default. *

* - * @author MightyPork + * @author Ondřej Hruška */ public abstract class AbstractRectCache extends RectAdapter implements ConstraintCache { diff --git a/src/mightypork/gamecore/util/math/constraints/rect/caching/RectCache.java b/src/mightypork/gamecore/util/math/constraints/rect/caching/RectCache.java index 6ebd964..64cb056 100644 --- a/src/mightypork/gamecore/util/math/constraints/rect/caching/RectCache.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/caching/RectCache.java @@ -8,7 +8,7 @@ import mightypork.gamecore.util.math.constraints.rect.Rect; /** * Rect cache implementation * - * @author MightyPork + * @author Ondřej Hruška */ public class RectCache extends AbstractRectCache { diff --git a/src/mightypork/gamecore/util/math/constraints/rect/mutable/RectMutable.java b/src/mightypork/gamecore/util/math/constraints/rect/mutable/RectMutable.java index 9557538..9ee0c02 100644 --- a/src/mightypork/gamecore/util/math/constraints/rect/mutable/RectMutable.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/mutable/RectMutable.java @@ -8,7 +8,7 @@ import mightypork.gamecore.util.math.constraints.vect.Vect; /** * Mutable rectangle; operations change it's state. * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class RectMutable extends Rect { diff --git a/src/mightypork/gamecore/util/math/constraints/rect/proxy/PluggableRectBound.java b/src/mightypork/gamecore/util/math/constraints/rect/proxy/PluggableRectBound.java index 58e3bd0..dd273e8 100644 --- a/src/mightypork/gamecore/util/math/constraints/rect/proxy/PluggableRectBound.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/proxy/PluggableRectBound.java @@ -4,7 +4,7 @@ package mightypork.gamecore.util.math.constraints.rect.proxy; /** * Pluggable rect bound * - * @author MightyPork + * @author Ondřej Hruška */ public interface PluggableRectBound extends RectBound { diff --git a/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectAdapter.java b/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectAdapter.java index 9b8af19..57ff634 100644 --- a/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectAdapter.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectAdapter.java @@ -10,7 +10,7 @@ import mightypork.gamecore.util.math.constraints.vect.proxy.VectAdapter; * Rect proxy with abstract method for plugging in / generating rect * dynamically. * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class RectAdapter extends Rect { diff --git a/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectBound.java b/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectBound.java index 4f2d410..de737a7 100644 --- a/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectBound.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectBound.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.math.constraints.rect.Rect; /** * Rect constraint (ie. region) * - * @author MightyPork + * @author Ondřej Hruška */ public interface RectBound { diff --git a/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectBoundAdapter.java b/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectBoundAdapter.java index 1001624..827cedd 100644 --- a/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectBoundAdapter.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectBoundAdapter.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.math.constraints.rect.Rect; /** * Pluggable rect bound adapter * - * @author MightyPork + * @author Ondřej Hruška */ public class RectBoundAdapter extends RectAdapter implements PluggableRectBound { diff --git a/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectVectAdapter.java b/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectVectAdapter.java index dc2ee86..e6d6645 100644 --- a/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectVectAdapter.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectVectAdapter.java @@ -8,7 +8,7 @@ import mightypork.gamecore.util.math.constraints.vect.Vect; /** * Rect made of two {@link Vect}s * - * @author MightyPork + * @author Ondřej Hruška */ public class RectVectAdapter extends Rect { diff --git a/src/mightypork/gamecore/util/math/constraints/vect/Vect.java b/src/mightypork/gamecore/util/math/constraints/vect/Vect.java index 769d962..320c0b1 100644 --- a/src/mightypork/gamecore/util/math/constraints/vect/Vect.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/Vect.java @@ -19,7 +19,7 @@ import mightypork.gamecore.util.math.constraints.vect.proxy.VectNumAdapter; /** * The most basic Vec methods * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class Vect implements VectBound, Digestable { diff --git a/src/mightypork/gamecore/util/math/constraints/vect/VectConst.java b/src/mightypork/gamecore/util/math/constraints/vect/VectConst.java index 7b1634d..89fc1e3 100644 --- a/src/mightypork/gamecore/util/math/constraints/vect/VectConst.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/VectConst.java @@ -13,7 +13,7 @@ import mightypork.gamecore.util.math.constraints.vect.caching.VectDigest; * It's arranged so that operations with constant arguments yield constant * results. * - * @author MightyPork + * @author Ondřej Hruška */ public final class VectConst extends Vect { diff --git a/src/mightypork/gamecore/util/math/constraints/vect/caching/AbstractVectCache.java b/src/mightypork/gamecore/util/math/constraints/vect/caching/AbstractVectCache.java index da41ac9..389c133 100644 --- a/src/mightypork/gamecore/util/math/constraints/vect/caching/AbstractVectCache.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/caching/AbstractVectCache.java @@ -16,7 +16,7 @@ import mightypork.gamecore.util.math.constraints.vect.proxy.VectAdapter; * default. *

* - * @author MightyPork + * @author Ondřej Hruška */ public abstract class AbstractVectCache extends VectAdapter implements ConstraintCache { diff --git a/src/mightypork/gamecore/util/math/constraints/vect/caching/VectCache.java b/src/mightypork/gamecore/util/math/constraints/vect/caching/VectCache.java index 2b45b22..5c9322f 100644 --- a/src/mightypork/gamecore/util/math/constraints/vect/caching/VectCache.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/caching/VectCache.java @@ -8,7 +8,7 @@ import mightypork.gamecore.util.math.constraints.vect.Vect; /** * Vect cache implementation * - * @author MightyPork + * @author Ondřej Hruška */ public class VectCache extends AbstractVectCache { diff --git a/src/mightypork/gamecore/util/math/constraints/vect/mutable/VectAnimated.java b/src/mightypork/gamecore/util/math/constraints/vect/mutable/VectAnimated.java index 6bdb914..7ba82e8 100644 --- a/src/mightypork/gamecore/util/math/constraints/vect/mutable/VectAnimated.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/mutable/VectAnimated.java @@ -12,7 +12,7 @@ import mightypork.gamecore.util.math.timing.Pauseable; /** * 3D coordinated with support for transitions, mutable. * - * @author MightyPork + * @author Ondřej Hruška */ public class VectAnimated extends VectMutable implements Pauseable, Updateable { diff --git a/src/mightypork/gamecore/util/math/constraints/vect/mutable/VectMutable.java b/src/mightypork/gamecore/util/math/constraints/vect/mutable/VectMutable.java index 52c076e..36f2a08 100644 --- a/src/mightypork/gamecore/util/math/constraints/vect/mutable/VectMutable.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/mutable/VectMutable.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.math.constraints.vect.Vect; /** * Mutable coord * - * @author MightyPork + * @author Ondřej Hruška */ abstract class VectMutable extends Vect { diff --git a/src/mightypork/gamecore/util/math/constraints/vect/mutable/VectVar.java b/src/mightypork/gamecore/util/math/constraints/vect/mutable/VectVar.java index 598b55a..04afa14 100644 --- a/src/mightypork/gamecore/util/math/constraints/vect/mutable/VectVar.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/mutable/VectVar.java @@ -5,7 +5,7 @@ package mightypork.gamecore.util.math.constraints.vect.mutable; * Mutable coordinate.
* All Vec methods (except copy) alter data values and return this instance. * - * @author MightyPork + * @author Ondřej Hruška */ public class VectVar extends VectMutable { diff --git a/src/mightypork/gamecore/util/math/constraints/vect/proxy/PluggableVectBound.java b/src/mightypork/gamecore/util/math/constraints/vect/proxy/PluggableVectBound.java index 0a5b49e..9b71394 100644 --- a/src/mightypork/gamecore/util/math/constraints/vect/proxy/PluggableVectBound.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/proxy/PluggableVectBound.java @@ -4,7 +4,7 @@ package mightypork.gamecore.util.math.constraints.vect.proxy; /** * Pluggable vector constraint * - * @author MightyPork + * @author Ondřej Hruška */ public interface PluggableVectBound extends VectBound { diff --git a/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectAdapter.java b/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectAdapter.java index 4a5de20..1fff05a 100644 --- a/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectAdapter.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectAdapter.java @@ -8,7 +8,7 @@ import mightypork.gamecore.util.math.constraints.vect.Vect; * Vect proxy with abstract method for plugging in / generating coordinates * dynamically. * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class VectAdapter extends Vect { diff --git a/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectBound.java b/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectBound.java index 686fc69..1300cbe 100644 --- a/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectBound.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectBound.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.math.constraints.vect.Vect; /** * Element holding a vector, used for constraint building. * - * @author MightyPork + * @author Ondřej Hruška */ public interface VectBound { diff --git a/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectNumAdapter.java b/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectNumAdapter.java index b08f4ba..b05de90 100644 --- a/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectNumAdapter.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectNumAdapter.java @@ -9,7 +9,7 @@ import mightypork.gamecore.util.math.constraints.vect.Vect; /** * Coord view composed of given {@link NumBound}s, using their current values. * - * @author MightyPork + * @author Ondřej Hruška */ public class VectNumAdapter extends Vect { diff --git a/src/mightypork/gamecore/util/math/noise/NoiseGen.java b/src/mightypork/gamecore/util/math/noise/NoiseGen.java index 5a813bb..038cfed 100644 --- a/src/mightypork/gamecore/util/math/noise/NoiseGen.java +++ b/src/mightypork/gamecore/util/math/noise/NoiseGen.java @@ -4,7 +4,7 @@ package mightypork.gamecore.util.math.noise; /** * 2D Perlin noise generator * - * @author MightyPork + * @author Ondřej Hruška */ public class NoiseGen { diff --git a/src/mightypork/gamecore/util/math/noise/PerlinNoiseGenerator.java b/src/mightypork/gamecore/util/math/noise/PerlinNoiseGenerator.java index b13ec98..3ab40fa 100644 --- a/src/mightypork/gamecore/util/math/noise/PerlinNoiseGenerator.java +++ b/src/mightypork/gamecore/util/math/noise/PerlinNoiseGenerator.java @@ -27,7 +27,7 @@ import java.util.Random; * space by just setting the un-needed dimensions to a fixed value. * * @author Justin Couch - * @edited by MightyPork + * @edited by Ondřej Hruška * @version $Revision: 1.4 $ * @source http://code.j3d.org/download.html */ diff --git a/src/mightypork/gamecore/util/math/timing/AnimatorBounce.java b/src/mightypork/gamecore/util/math/timing/AnimatorBounce.java index 12d6b0a..d04a37a 100644 --- a/src/mightypork/gamecore/util/math/timing/AnimatorBounce.java +++ b/src/mightypork/gamecore/util/math/timing/AnimatorBounce.java @@ -8,7 +8,7 @@ import mightypork.gamecore.util.math.constraints.num.mutable.NumAnimated; /** * Animator that upon reaching max, animates back down and then up again * - * @author MightyPork + * @author Ondřej Hruška */ public class AnimatorBounce extends Animator { diff --git a/src/mightypork/gamecore/util/math/timing/AnimatorRewind.java b/src/mightypork/gamecore/util/math/timing/AnimatorRewind.java index 6ca0299..fa84529 100644 --- a/src/mightypork/gamecore/util/math/timing/AnimatorRewind.java +++ b/src/mightypork/gamecore/util/math/timing/AnimatorRewind.java @@ -9,7 +9,7 @@ import mightypork.gamecore.util.math.constraints.num.mutable.NumAnimated; * Animator that upon reaching top, jumps straight to zero and continues another * cycle. * - * @author MightyPork + * @author Ondřej Hruška */ public class AnimatorRewind extends Animator { diff --git a/src/mightypork/gamecore/util/math/timing/FpsMeter.java b/src/mightypork/gamecore/util/math/timing/FpsMeter.java index 2d04222..16fc927 100644 --- a/src/mightypork/gamecore/util/math/timing/FpsMeter.java +++ b/src/mightypork/gamecore/util/math/timing/FpsMeter.java @@ -5,7 +5,7 @@ package mightypork.gamecore.util.math.timing; * Class for counting FPS in games.
* This class can be used also as a simple frequency meter - output is in Hz. * - * @author MightyPork + * @author Ondřej Hruška */ public class FpsMeter { diff --git a/src/mightypork/gamecore/util/math/timing/Pauseable.java b/src/mightypork/gamecore/util/math/timing/Pauseable.java index 007cb6d..cfe7003 100644 --- a/src/mightypork/gamecore/util/math/timing/Pauseable.java +++ b/src/mightypork/gamecore/util/math/timing/Pauseable.java @@ -4,7 +4,7 @@ package mightypork.gamecore.util.math.timing; /** * Can be paused & resumed * - * @author MightyPork + * @author Ondřej Hruška */ public interface Pauseable { diff --git a/src/mightypork/gamecore/util/math/timing/TimedTask.java b/src/mightypork/gamecore/util/math/timing/TimedTask.java index 4c295f1..cb5aeae 100644 --- a/src/mightypork/gamecore/util/math/timing/TimedTask.java +++ b/src/mightypork/gamecore/util/math/timing/TimedTask.java @@ -8,7 +8,7 @@ import mightypork.gamecore.util.math.constraints.num.mutable.NumAnimated; /** * Delayed runnable controlled by delta timing. * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class TimedTask implements Runnable, Updateable { diff --git a/src/mightypork/gamecore/util/math/timing/TimerDelta.java b/src/mightypork/gamecore/util/math/timing/TimerDelta.java index 015275c..85c1600 100644 --- a/src/mightypork/gamecore/util/math/timing/TimerDelta.java +++ b/src/mightypork/gamecore/util/math/timing/TimerDelta.java @@ -4,7 +4,7 @@ package mightypork.gamecore.util.math.timing; /** * Timer for delta timing * - * @author MightyPork + * @author Ondřej Hruška */ public class TimerDelta { diff --git a/src/mightypork/gamecore/util/math/timing/TimerFps.java b/src/mightypork/gamecore/util/math/timing/TimerFps.java index becdf0a..b167b53 100644 --- a/src/mightypork/gamecore/util/math/timing/TimerFps.java +++ b/src/mightypork/gamecore/util/math/timing/TimerFps.java @@ -4,7 +4,7 @@ package mightypork.gamecore.util.math.timing; /** * Timer for interpolated timing * - * @author MightyPork + * @author Ondřej Hruška */ public class TimerFps { diff --git a/src/mightypork/gamecore/util/objects/Convert.java b/src/mightypork/gamecore/util/objects/Convert.java index 4df136a..a4ad81b 100644 --- a/src/mightypork/gamecore/util/objects/Convert.java +++ b/src/mightypork/gamecore/util/objects/Convert.java @@ -12,7 +12,7 @@ import mightypork.gamecore.util.math.constraints.vect.VectConst; * Utility for converting Object to data types; Can also convert strings to data * types. * - * @author MightyPork + * @author Ondřej Hruška */ public class Convert { diff --git a/src/mightypork/gamecore/util/objects/EnumerationIterator.java b/src/mightypork/gamecore/util/objects/EnumerationIterator.java index 82714dd..75e08a1 100644 --- a/src/mightypork/gamecore/util/objects/EnumerationIterator.java +++ b/src/mightypork/gamecore/util/objects/EnumerationIterator.java @@ -8,7 +8,7 @@ import java.util.Iterator; /** * Helper class for iterationg over an {@link Enumeration} * - * @author MightyPork + * @author Ondřej Hruška * @param target element type (will be cast) */ public class EnumerationIterator implements Iterable { diff --git a/src/mightypork/gamecore/util/objects/MapSort.java b/src/mightypork/gamecore/util/objects/MapSort.java index 73667c5..cc9fb04 100644 --- a/src/mightypork/gamecore/util/objects/MapSort.java +++ b/src/mightypork/gamecore/util/objects/MapSort.java @@ -8,7 +8,7 @@ import java.util.Map.Entry; /** * Map sorting utils * - * @author MightyPork + * @author Ondřej Hruška */ public class MapSort { diff --git a/src/mightypork/gamecore/util/objects/Mutable.java b/src/mightypork/gamecore/util/objects/Mutable.java index 41a3eb1..1039348 100644 --- a/src/mightypork/gamecore/util/objects/Mutable.java +++ b/src/mightypork/gamecore/util/objects/Mutable.java @@ -4,7 +4,7 @@ package mightypork.gamecore.util.objects; /** * Mutable object * - * @author MightyPork + * @author Ondřej Hruška * @param type */ public class Mutable { diff --git a/src/mightypork/gamecore/util/objects/Pair.java b/src/mightypork/gamecore/util/objects/Pair.java index 8eff987..a5c78fe 100644 --- a/src/mightypork/gamecore/util/objects/Pair.java +++ b/src/mightypork/gamecore/util/objects/Pair.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.math.Calc; /** * Structure of 2 objects. * - * @author MightyPork + * @author Ondřej Hruška * @copy (c) 2012 * @param 1st object class * @param 2nd object class diff --git a/src/mightypork/gamecore/util/objects/Triad.java b/src/mightypork/gamecore/util/objects/Triad.java index a242331..fd14003 100644 --- a/src/mightypork/gamecore/util/objects/Triad.java +++ b/src/mightypork/gamecore/util/objects/Triad.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.math.Calc; /** * Structure of 3 objects. * - * @author MightyPork + * @author Ondřej Hruška * @copy (c) 2012 * @param 1st object class * @param 2nd object class diff --git a/src/mightypork/gamecore/util/objects/VarargsParser.java b/src/mightypork/gamecore/util/objects/VarargsParser.java index c5fb12f..c7eaea2 100644 --- a/src/mightypork/gamecore/util/objects/VarargsParser.java +++ b/src/mightypork/gamecore/util/objects/VarargsParser.java @@ -15,7 +15,7 @@ import java.util.Map; * Map<String, Integer> args = new VarargsParser<String, Integer>().parse(array); * * - * @author MightyPork + * @author Ondřej Hruška * @param Type for Map keys * @param Type for Map values */ diff --git a/src/mightypork/gamecore/util/strings/AlphanumComparator.java b/src/mightypork/gamecore/util/strings/AlphanumComparator.java index 7c3d87e..0fa5f3b 100644 --- a/src/mightypork/gamecore/util/strings/AlphanumComparator.java +++ b/src/mightypork/gamecore/util/strings/AlphanumComparator.java @@ -34,7 +34,7 @@ import java.util.Comparator; * @author Daniel Migowski * @author Andre Bogus * @author David Koelle - * @author MightyPork + * @author Ondřej Hruška */ public class AlphanumComparator implements Comparator { diff --git a/src/mightypork/gamecore/util/strings/StringProvider.java b/src/mightypork/gamecore/util/strings/StringProvider.java index b658076..7b70da0 100644 --- a/src/mightypork/gamecore/util/strings/StringProvider.java +++ b/src/mightypork/gamecore/util/strings/StringProvider.java @@ -4,7 +4,7 @@ package mightypork.gamecore.util.strings; /** * Can be used for dynamic string generating * - * @author MightyPork + * @author Ondřej Hruška */ public interface StringProvider { diff --git a/src/mightypork/gamecore/util/strings/StringUtils.java b/src/mightypork/gamecore/util/strings/StringUtils.java index 26c7e70..22e5933 100644 --- a/src/mightypork/gamecore/util/strings/StringUtils.java +++ b/src/mightypork/gamecore/util/strings/StringUtils.java @@ -4,7 +4,7 @@ package mightypork.gamecore.util.strings; /** * General purpose string utilities * - * @author MightyPork + * @author Ondřej Hruška */ public class StringUtils { diff --git a/src/mightypork/gamecore/util/strings/StringWrapper.java b/src/mightypork/gamecore/util/strings/StringWrapper.java index 8c01d68..b7cc4e4 100644 --- a/src/mightypork/gamecore/util/strings/StringWrapper.java +++ b/src/mightypork/gamecore/util/strings/StringWrapper.java @@ -4,7 +4,7 @@ package mightypork.gamecore.util.strings; /** * String provider with constant string * - * @author MightyPork + * @author Ondřej Hruška */ public class StringWrapper implements StringProvider { diff --git a/src/mightypork/gamecore/util/strings/filtering/StringFilter.java b/src/mightypork/gamecore/util/strings/filtering/StringFilter.java index 6baf3e1..52d44f9 100644 --- a/src/mightypork/gamecore/util/strings/filtering/StringFilter.java +++ b/src/mightypork/gamecore/util/strings/filtering/StringFilter.java @@ -4,7 +4,7 @@ package mightypork.gamecore.util.strings.filtering; /** * Utility interface for string filters (accepting filepaths and similar) * - * @author MightyPork + * @author Ondřej Hruška */ public interface StringFilter { diff --git a/src/mightypork/rogue/Const.java b/src/mightypork/rogue/Const.java index 92d8aaf..594de3e 100644 --- a/src/mightypork/rogue/Const.java +++ b/src/mightypork/rogue/Const.java @@ -4,7 +4,7 @@ package mightypork.rogue; /** * Application constants * - * @author MightyPork + * @author Ondřej Hruška */ public final class Const { diff --git a/src/mightypork/rogue/RogueApp.java b/src/mightypork/rogue/RogueApp.java index 349ce38..c127952 100644 --- a/src/mightypork/rogue/RogueApp.java +++ b/src/mightypork/rogue/RogueApp.java @@ -20,7 +20,7 @@ import mightypork.gamecore.render.events.ScreenshotRequestListener; import mightypork.gamecore.render.events.ViewportChangeEvent; import mightypork.gamecore.render.events.ViewportChangeListener; import mightypork.gamecore.resources.Res; -import mightypork.gamecore.util.ion.Ion; +import mightypork.ion.Ion; import mightypork.rogue.RogueStateManager.RogueState; import mightypork.rogue.events.RogueStateRequest; import mightypork.rogue.screens.FpsOverlay; @@ -37,7 +37,7 @@ import mightypork.rogue.world.level.Level; /** * Main class * - * @author MightyPork + * @author Ondřej Hruška */ public final class RogueApp extends BaseApp implements ViewportChangeListener, ScreenshotRequestListener { @@ -61,8 +61,8 @@ public final class RogueApp extends BaseApp implements ViewportChangeListener, S { super.registerIonizables(); - Ion.registerType(Level.ION_MARK, Level.class); - Ion.registerType(Inventory.ION_MARK, Inventory.class); + Ion.register(Level.class); + Ion.register(Inventory.class); } diff --git a/src/mightypork/rogue/events/LoadingOverlayRequest.java b/src/mightypork/rogue/events/LoadingOverlayRequest.java index a42d5c8..46d70ec 100644 --- a/src/mightypork/rogue/events/LoadingOverlayRequest.java +++ b/src/mightypork/rogue/events/LoadingOverlayRequest.java @@ -9,7 +9,7 @@ import mightypork.rogue.screens.LoadingOverlay; /** * Request to execute a given task in a loading overlay * - * @author MightyPork + * @author Ondřej Hruška */ @SingleReceiverEvent public class LoadingOverlayRequest extends BusEvent { diff --git a/src/mightypork/rogue/events/RogueStateRequest.java b/src/mightypork/rogue/events/RogueStateRequest.java index 666b41f..d0733c9 100644 --- a/src/mightypork/rogue/events/RogueStateRequest.java +++ b/src/mightypork/rogue/events/RogueStateRequest.java @@ -9,7 +9,7 @@ import mightypork.rogue.RogueStateManager.RogueState; /** * Request for a game state change * - * @author MightyPork + * @author Ondřej Hruška */ public class RogueStateRequest extends BusEvent { diff --git a/src/mightypork/rogue/screens/FpsOverlay.java b/src/mightypork/rogue/screens/FpsOverlay.java index b338a48..937f55b 100644 --- a/src/mightypork/rogue/screens/FpsOverlay.java +++ b/src/mightypork/rogue/screens/FpsOverlay.java @@ -20,7 +20,7 @@ import mightypork.gamecore.util.strings.StringProvider; /** * FPS indicator overlay * - * @author MightyPork + * @author Ondřej Hruška */ public class FpsOverlay extends Overlay { diff --git a/src/mightypork/rogue/screens/LoadingOverlay.java b/src/mightypork/rogue/screens/LoadingOverlay.java index 25f43b7..ee3e796 100644 --- a/src/mightypork/rogue/screens/LoadingOverlay.java +++ b/src/mightypork/rogue/screens/LoadingOverlay.java @@ -22,7 +22,7 @@ import mightypork.gamecore.util.strings.StringProvider; * Overlay with blue background and loading-info text, that accompanies an async * task. * - * @author MightyPork + * @author Ondřej Hruška */ public class LoadingOverlay extends Overlay { diff --git a/src/mightypork/rogue/screens/game/InvSlot.java b/src/mightypork/rogue/screens/game/InvSlot.java index b498692..8246c82 100644 --- a/src/mightypork/rogue/screens/game/InvSlot.java +++ b/src/mightypork/rogue/screens/game/InvSlot.java @@ -23,7 +23,7 @@ import mightypork.rogue.world.item.ItemType; /** * Button in the ingame nav * - * @author MightyPork + * @author Ondřej Hruška */ public class InvSlot extends ClickableComponent { diff --git a/src/mightypork/rogue/screens/game/LayerWin.java b/src/mightypork/rogue/screens/game/LayerWin.java index 10d2388..e7b486f 100644 --- a/src/mightypork/rogue/screens/game/LayerWin.java +++ b/src/mightypork/rogue/screens/game/LayerWin.java @@ -15,7 +15,6 @@ import mightypork.gamecore.gui.components.painters.TextPainter; import mightypork.gamecore.gui.screens.impl.FadingLayer; import mightypork.gamecore.input.KeyStroke.Edge; import mightypork.gamecore.resources.Res; -import mightypork.gamecore.resources.audio.SoundSystem; import mightypork.gamecore.resources.fonts.GLFont; import mightypork.gamecore.util.math.color.pal.RGB; import mightypork.gamecore.util.math.constraints.num.Num; @@ -82,6 +81,7 @@ public class LayerWin extends FadingLayer { return 300; } + @Override protected void onShowFinished() { diff --git a/src/mightypork/rogue/screens/game/NavButton.java b/src/mightypork/rogue/screens/game/NavButton.java index add7c4b..d877b15 100644 --- a/src/mightypork/rogue/screens/game/NavButton.java +++ b/src/mightypork/rogue/screens/game/NavButton.java @@ -10,7 +10,7 @@ import mightypork.gamecore.resources.textures.TxQuad; /** * Button in the ingame nav * - * @author MightyPork + * @author Ondřej Hruška */ public class NavButton extends ClickableComponent { diff --git a/src/mightypork/rogue/screens/game/ScreenGame.java b/src/mightypork/rogue/screens/game/ScreenGame.java index 294cbf3..cb32fda 100644 --- a/src/mightypork/rogue/screens/game/ScreenGame.java +++ b/src/mightypork/rogue/screens/game/ScreenGame.java @@ -8,12 +8,9 @@ import mightypork.gamecore.core.events.UserQuitRequest; import mightypork.gamecore.core.modules.AppAccess; import mightypork.gamecore.gui.Action; import mightypork.gamecore.gui.ActionGroup; -import mightypork.gamecore.input.KeyStroke; import mightypork.gamecore.input.KeyStroke.Edge; -import mightypork.gamecore.input.Keys; import mightypork.gamecore.logging.Log; import mightypork.gamecore.resources.Res; -import mightypork.gamecore.resources.audio.SoundSystem; import mightypork.gamecore.util.math.color.Color; import mightypork.rogue.Const; import mightypork.rogue.RogueStateManager.RogueState; @@ -36,7 +33,7 @@ public class ScreenGame extends RogueScreen implements PlayerDeathHandler, GameW /** * Game gui state. * - * @author MightyPork + * @author Ondřej Hruška */ public enum GScrState { @@ -311,7 +308,7 @@ public class ScreenGame extends RogueScreen implements PlayerDeathHandler, GameW setState(GScrState.WORLD); hideAllPopups(); - getSoundSystem().fadeOutAllLoops(); + getSoundSystem().fadeOutAllLoops(); Res.getSoundLoop("music.dungeon").fadeIn(); } diff --git a/src/mightypork/rogue/screens/menu/ScreenMainMenu.java b/src/mightypork/rogue/screens/menu/ScreenMainMenu.java index abaabab..8f5d63a 100644 --- a/src/mightypork/rogue/screens/menu/ScreenMainMenu.java +++ b/src/mightypork/rogue/screens/menu/ScreenMainMenu.java @@ -28,7 +28,7 @@ import mightypork.rogue.screens.RogueScreen; /** * Main menu screen * - * @author MightyPork + * @author Ondřej Hruška */ public class ScreenMainMenu extends RogueScreen { @@ -36,7 +36,7 @@ public class ScreenMainMenu extends RogueScreen { /** * The layer * - * @author MightyPork + * @author Ondřej Hruška */ class MenuLayer extends ScreenLayer { @@ -127,7 +127,7 @@ public class ScreenMainMenu extends RogueScreen { } } - + public ScreenMainMenu(AppAccess app) { @@ -136,11 +136,12 @@ public class ScreenMainMenu extends RogueScreen { addLayer(new MenuLayer(this)); } + @Override protected void onScreenEnter() { super.onScreenEnter(); - + getSoundSystem().fadeOutAllLoops(); Res.getSoundLoop("music.menu").fadeIn(); } diff --git a/src/mightypork/rogue/screens/select_world/ScreenSelectWorld.java b/src/mightypork/rogue/screens/select_world/ScreenSelectWorld.java index 182c8c7..b5ce2ed 100644 --- a/src/mightypork/rogue/screens/select_world/ScreenSelectWorld.java +++ b/src/mightypork/rogue/screens/select_world/ScreenSelectWorld.java @@ -25,7 +25,7 @@ import mightypork.rogue.screens.RogueScreen; /** * Main menu screen * - * @author MightyPork + * @author Ondřej Hruška */ public class ScreenSelectWorld extends RogueScreen { diff --git a/src/mightypork/rogue/screens/select_world/WorldSlot.java b/src/mightypork/rogue/screens/select_world/WorldSlot.java index a4ef9b8..0872fef 100644 --- a/src/mightypork/rogue/screens/select_world/WorldSlot.java +++ b/src/mightypork/rogue/screens/select_world/WorldSlot.java @@ -2,7 +2,6 @@ package mightypork.rogue.screens.select_world; import java.io.File; -import java.io.IOException; import mightypork.gamecore.core.modules.AppAccess; import mightypork.gamecore.gui.Action; @@ -15,12 +14,12 @@ import mightypork.gamecore.gui.events.ScreenRequest; import mightypork.gamecore.logging.Log; import mightypork.gamecore.resources.Res; import mightypork.gamecore.resources.fonts.GLFont; -import mightypork.gamecore.util.ion.Ion; -import mightypork.gamecore.util.ion.IonBundle; import mightypork.gamecore.util.math.color.pal.RGB; import mightypork.gamecore.util.math.constraints.num.Num; import mightypork.gamecore.util.math.constraints.rect.Rect; import mightypork.gamecore.util.strings.StringProvider; +import mightypork.ion.Ion; +import mightypork.ion.IonBundle; import mightypork.rogue.events.LoadingOverlayRequest; import mightypork.rogue.world.World; import mightypork.rogue.world.WorldProvider; @@ -111,7 +110,7 @@ public class WorldSlot extends ConstraintLayout { getEventBus().send(new ScreenRequest("game")); - } catch (final IOException t) { + } catch (final Exception t) { Log.e("Could not create & save the world.", t); } @@ -120,12 +119,12 @@ public class WorldSlot extends ConstraintLayout { try { w = new World(); w.setSaveFile(file); - w.load(worldBundle); + w.load((IonBundle) worldBundle.get("world")); WorldProvider.get().setWorld(w); getEventBus().send(new ScreenRequest("game")); - } catch (final IOException e) { + } catch (final Exception e) { Log.e("Could not load the world.", e); } } @@ -171,7 +170,7 @@ public class WorldSlot extends ConstraintLayout { try { worldBundle = Ion.fromFile(file); - final int lvl = worldBundle.get("meta.last_level", -1); + final int lvl = worldBundle.get("level", -1); if (lvl == -1) throw new RuntimeException("Invalid save format."); // let the catch block handle it diff --git a/src/mightypork/rogue/world/Inventory.java b/src/mightypork/rogue/world/Inventory.java index 4f21302..7e3751c 100644 --- a/src/mightypork/rogue/world/Inventory.java +++ b/src/mightypork/rogue/world/Inventory.java @@ -3,9 +3,9 @@ package mightypork.rogue.world; import java.io.IOException; -import mightypork.gamecore.util.ion.IonInput; -import mightypork.gamecore.util.ion.IonObjBinary; -import mightypork.gamecore.util.ion.IonOutput; +import mightypork.ion.IonInput; +import mightypork.ion.IonObjBinary; +import mightypork.ion.IonOutput; import mightypork.rogue.world.item.Item; import mightypork.rogue.world.item.Items; @@ -73,13 +73,6 @@ public class Inventory implements IonObjBinary { } - @Override - public short getIonMark() - { - return ION_MARK; - } - - /** * Get item in a slot * diff --git a/src/mightypork/rogue/world/PlayerData.java b/src/mightypork/rogue/world/PlayerData.java index 6c4a93e..e9e0f11 100644 --- a/src/mightypork/rogue/world/PlayerData.java +++ b/src/mightypork/rogue/world/PlayerData.java @@ -1,17 +1,15 @@ package mightypork.rogue.world; -import java.io.IOException; - -import mightypork.gamecore.util.ion.IonBundle; -import mightypork.gamecore.util.ion.IonObjBundled; +import mightypork.ion.IonBundle; +import mightypork.ion.IonObjBundled; import mightypork.rogue.world.item.Item; /** * Player information stored in world. * - * @author MightyPork + * @author Ondřej Hruška */ public class PlayerData implements IonObjBundled { @@ -31,7 +29,7 @@ public class PlayerData implements IonObjBundled { @Override - public void load(IonBundle bundle) throws IOException + public void load(IonBundle bundle) { eid = bundle.get("eid", -1); level = bundle.get("floor", -1); @@ -42,7 +40,7 @@ public class PlayerData implements IonObjBundled { @Override - public void save(IonBundle bundle) throws IOException + public void save(IonBundle bundle) { bundle.put("eid", eid); bundle.put("floor", level); diff --git a/src/mightypork/rogue/world/PlayerFacade.java b/src/mightypork/rogue/world/PlayerFacade.java index 7c48313..54c41c3 100644 --- a/src/mightypork/rogue/world/PlayerFacade.java +++ b/src/mightypork/rogue/world/PlayerFacade.java @@ -18,7 +18,7 @@ import mightypork.rogue.world.level.Level; /** * Convenient access to player-related methods and data in world. * - * @author MightyPork + * @author Ondřej Hruška */ public class PlayerFacade { diff --git a/src/mightypork/rogue/world/World.java b/src/mightypork/rogue/world/World.java index 9a67a3a..0409dfc 100644 --- a/src/mightypork/rogue/world/World.java +++ b/src/mightypork/rogue/world/World.java @@ -2,7 +2,6 @@ package mightypork.rogue.world; import java.io.File; -import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Random; @@ -13,10 +12,10 @@ import mightypork.gamecore.eventbus.clients.DelegatingClient; import mightypork.gamecore.eventbus.events.Updateable; import mightypork.gamecore.logging.Log; import mightypork.gamecore.util.error.CorruptDataException; -import mightypork.gamecore.util.ion.IonBundle; -import mightypork.gamecore.util.ion.IonObjBundled; import mightypork.gamecore.util.math.algo.Coord; import mightypork.gamecore.util.math.timing.Pauseable; +import mightypork.ion.IonBundle; +import mightypork.ion.IonObjBundled; import mightypork.rogue.world.entity.Entities; import mightypork.rogue.world.entity.Entity; import mightypork.rogue.world.events.GameWinHandler; @@ -27,7 +26,7 @@ import mightypork.rogue.world.level.Level; /** * World object. * - * @author MightyPork + * @author Ondřej Hruška */ public class World implements DelegatingClient, BusAccess, IonObjBundled, Pauseable, Updateable, PlayerDeathHandler, GameWinHandler { @@ -71,7 +70,7 @@ public class World implements DelegatingClient, BusAccess, IonObjBundled, Pausea @Override - public void load(IonBundle in) throws IOException + public void load(IonBundle in) { seed = in.get("seed", seed); eid = in.get("next_eid", eid); @@ -106,7 +105,7 @@ public class World implements DelegatingClient, BusAccess, IonObjBundled, Pausea @Override - public void save(IonBundle out) throws IOException + public void save(IonBundle out) { out.put("seed", seed); out.put("next_eid", eid); diff --git a/src/mightypork/rogue/world/WorldConsole.java b/src/mightypork/rogue/world/WorldConsole.java index 73903a2..1491725 100644 --- a/src/mightypork/rogue/world/WorldConsole.java +++ b/src/mightypork/rogue/world/WorldConsole.java @@ -16,7 +16,7 @@ import mightypork.rogue.world.item.Item; /** * Message log in world view * - * @author MightyPork + * @author Ondřej Hruška */ public class WorldConsole implements Updateable { diff --git a/src/mightypork/rogue/world/WorldProvider.java b/src/mightypork/rogue/world/WorldProvider.java index fab61cb..e09e4a0 100644 --- a/src/mightypork/rogue/world/WorldProvider.java +++ b/src/mightypork/rogue/world/WorldProvider.java @@ -7,7 +7,8 @@ import java.io.IOException; import mightypork.gamecore.eventbus.BusAccess; import mightypork.gamecore.eventbus.clients.RootBusNode; import mightypork.gamecore.logging.Log; -import mightypork.gamecore.util.ion.Ion; +import mightypork.ion.Ion; +import mightypork.ion.IonBundle; import mightypork.rogue.world.gen.WorldCreator; import mightypork.rogue.world.level.Level; @@ -15,7 +16,7 @@ import mightypork.rogue.world.level.Level; /** * Global singleton world holder and storage * - * @author MightyPork + * @author Ondřej Hruška */ public class WorldProvider extends RootBusNode { @@ -92,7 +93,9 @@ public class WorldProvider extends RootBusNode { public void loadWorld(File file) throws IOException { Log.f2("Loading world from: " + file); - setWorld(Ion.fromFile(file, World.class)); + + final IonBundle bu = Ion.fromFile(file); + setWorld(bu.loadBundled("world", new World())); world.setSaveFile(file); } @@ -111,7 +114,12 @@ public class WorldProvider extends RootBusNode { } Log.f2("Saving world to: " + file); - Ion.toFile(file, world); + + final IonBundle bu = new IonBundle(); + bu.put("level", world.getPlayer().getLevelNumber()); + bu.putBundled("world", world); + + Ion.toFile(file, bu); } diff --git a/src/mightypork/rogue/world/WorldRenderer.java b/src/mightypork/rogue/world/WorldRenderer.java index eaad2ac..f11acda 100644 --- a/src/mightypork/rogue/world/WorldRenderer.java +++ b/src/mightypork/rogue/world/WorldRenderer.java @@ -20,7 +20,7 @@ import mightypork.rogue.world.level.render.TileRenderContext; /** * World rendering untility * - * @author MightyPork + * @author Ondřej Hruška */ public class WorldRenderer extends RectProxy { diff --git a/src/mightypork/rogue/world/entity/AiTimer.java b/src/mightypork/rogue/world/entity/AiTimer.java index 0099fb0..0f1c2b1 100644 --- a/src/mightypork/rogue/world/entity/AiTimer.java +++ b/src/mightypork/rogue/world/entity/AiTimer.java @@ -1,11 +1,9 @@ package mightypork.rogue.world.entity; -import java.io.IOException; - -import mightypork.gamecore.util.ion.IonBundle; -import mightypork.gamecore.util.ion.IonObjBundled; import mightypork.gamecore.util.math.timing.TaskRepeater; +import mightypork.ion.IonBundle; +import mightypork.ion.IonObjBundled; public abstract class AiTimer extends TaskRepeater implements IonObjBundled { @@ -21,7 +19,7 @@ public abstract class AiTimer extends TaskRepeater implements IonObjBundled { @Override - public void load(IonBundle bundle) throws IOException + public void load(IonBundle bundle) { final boolean wasPaused = bundle.get("paused", isPaused()); if (wasPaused) { @@ -36,7 +34,7 @@ public abstract class AiTimer extends TaskRepeater implements IonObjBundled { @Override - public void save(IonBundle bundle) throws IOException + public void save(IonBundle bundle) { bundle.put("paused", isPaused()); bundle.put("progress", getProgress()); diff --git a/src/mightypork/rogue/world/entity/Entities.java b/src/mightypork/rogue/world/entity/Entities.java index 847b62a..11b050b 100644 --- a/src/mightypork/rogue/world/entity/Entities.java +++ b/src/mightypork/rogue/world/entity/Entities.java @@ -4,8 +4,8 @@ package mightypork.rogue.world.entity; import java.io.IOException; import java.util.Collection; -import mightypork.gamecore.util.ion.IonInput; -import mightypork.gamecore.util.ion.IonOutput; +import mightypork.ion.IonInput; +import mightypork.ion.IonOutput; import mightypork.rogue.world.entity.impl.EntityBossRat; import mightypork.rogue.world.entity.impl.EntityBrownRat; import mightypork.rogue.world.entity.impl.EntityGrayRat; @@ -15,7 +15,7 @@ import mightypork.rogue.world.entity.impl.EntityPlayer; /** * Entity registry * - * @author MightyPork + * @author Ondřej Hruška */ public final class Entities { diff --git a/src/mightypork/rogue/world/entity/Entity.java b/src/mightypork/rogue/world/entity/Entity.java index 2a8e59e..ffbd83d 100644 --- a/src/mightypork/rogue/world/entity/Entity.java +++ b/src/mightypork/rogue/world/entity/Entity.java @@ -1,7 +1,6 @@ package mightypork.rogue.world.entity; -import java.io.IOException; import java.util.Collection; import java.util.HashMap; import java.util.Map; @@ -11,10 +10,10 @@ import mightypork.gamecore.eventbus.clients.DelegatingClient; import mightypork.gamecore.eventbus.events.Updateable; import mightypork.gamecore.util.annot.DefaultImpl; import mightypork.gamecore.util.error.IllegalValueException; -import mightypork.gamecore.util.ion.IonBundle; -import mightypork.gamecore.util.ion.IonObjBundled; import mightypork.gamecore.util.math.algo.Coord; import mightypork.gamecore.util.math.algo.pathfinding.PathFinder; +import mightypork.ion.IonBundle; +import mightypork.ion.IonObjBundled; import mightypork.rogue.world.World; import mightypork.rogue.world.entity.modules.EntityModuleHealth; import mightypork.rogue.world.entity.modules.EntityModulePosition; @@ -25,7 +24,7 @@ import mightypork.rogue.world.level.render.MapRenderContext; /** * World entity (mob or player). Entities are attached to the event bus. * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class Entity implements IonObjBundled, Updateable, DelegatingClient { @@ -57,7 +56,7 @@ public abstract class Entity implements IonObjBundled, Updateable, DelegatingCli @Override - public final void save(IonBundle bundle) throws IOException + public final void save(IonBundle bundle) { bundle.put("eid", entityId); @@ -80,7 +79,7 @@ public abstract class Entity implements IonObjBundled, Updateable, DelegatingCli @Override - public final void load(IonBundle bundle) throws IOException + public final void load(IonBundle bundle) { entityId = bundle.get("eid", -1); if (entityId < 0) throw new IllegalValueException("Bad entity id: " + entityId); diff --git a/src/mightypork/rogue/world/entity/EntityModel.java b/src/mightypork/rogue/world/entity/EntityModel.java index 008159d..5580220 100644 --- a/src/mightypork/rogue/world/entity/EntityModel.java +++ b/src/mightypork/rogue/world/entity/EntityModel.java @@ -3,16 +3,16 @@ package mightypork.rogue.world.entity; import java.io.IOException; -import mightypork.gamecore.util.ion.IonBundle; -import mightypork.gamecore.util.ion.IonInput; -import mightypork.gamecore.util.ion.IonOutput; +import mightypork.ion.IonBundle; +import mightypork.ion.IonInput; +import mightypork.ion.IonOutput; import mightypork.rogue.world.World; /** * Entity model - builder * - * @author MightyPork + * @author Ondřej Hruška */ public final class EntityModel { diff --git a/src/mightypork/rogue/world/entity/EntityModule.java b/src/mightypork/rogue/world/entity/EntityModule.java index ae37587..e2cd86e 100644 --- a/src/mightypork/rogue/world/entity/EntityModule.java +++ b/src/mightypork/rogue/world/entity/EntityModule.java @@ -1,19 +1,17 @@ package mightypork.rogue.world.entity; -import java.io.IOException; - import mightypork.gamecore.eventbus.events.Updateable; import mightypork.gamecore.util.annot.DefaultImpl; -import mightypork.gamecore.util.ion.IonBundle; -import mightypork.gamecore.util.ion.IonObjBundled; +import mightypork.ion.IonBundle; +import mightypork.ion.IonObjBundled; /** * Abstract entity module
* Modules make up an entity AI and behavior. * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class EntityModule implements IonObjBundled, Updateable { @@ -34,14 +32,14 @@ public abstract class EntityModule implements IonObjBundled, Updateable { @Override @DefaultImpl - public void load(IonBundle bundle) throws IOException + public void load(IonBundle bundle) { } @Override @DefaultImpl - public void save(IonBundle bundle) throws IOException + public void save(IonBundle bundle) { } diff --git a/src/mightypork/rogue/world/entity/EntityPathFinder.java b/src/mightypork/rogue/world/entity/EntityPathFinder.java index af456c4..c961d74 100644 --- a/src/mightypork/rogue/world/entity/EntityPathFinder.java +++ b/src/mightypork/rogue/world/entity/EntityPathFinder.java @@ -13,7 +13,7 @@ import mightypork.gamecore.util.math.algo.pathfinding.PathFinder; /** * Basic Pathfinder implementation for entities * - * @author MightyPork + * @author Ondřej Hruška */ public class EntityPathFinder extends PathFinder { diff --git a/src/mightypork/rogue/world/entity/EntityRenderer.java b/src/mightypork/rogue/world/entity/EntityRenderer.java index deb464c..9fbb43c 100644 --- a/src/mightypork/rogue/world/entity/EntityRenderer.java +++ b/src/mightypork/rogue/world/entity/EntityRenderer.java @@ -7,7 +7,7 @@ import mightypork.rogue.world.level.render.MapRenderContext; /** * Entity renderer * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class EntityRenderer { diff --git a/src/mightypork/rogue/world/entity/EntityType.java b/src/mightypork/rogue/world/entity/EntityType.java index 5375bfd..4427325 100644 --- a/src/mightypork/rogue/world/entity/EntityType.java +++ b/src/mightypork/rogue/world/entity/EntityType.java @@ -4,7 +4,7 @@ package mightypork.rogue.world.entity; /** * Type of an entity * - * @author MightyPork + * @author Ondřej Hruška */ public enum EntityType { diff --git a/src/mightypork/rogue/world/entity/impl/MonsterAi.java b/src/mightypork/rogue/world/entity/impl/MonsterAi.java index 27d6402..3ddf5b8 100644 --- a/src/mightypork/rogue/world/entity/impl/MonsterAi.java +++ b/src/mightypork/rogue/world/entity/impl/MonsterAi.java @@ -1,17 +1,16 @@ package mightypork.rogue.world.entity.impl; -import java.io.IOException; import java.util.List; import mightypork.gamecore.util.annot.DefaultImpl; -import mightypork.gamecore.util.ion.IonBundle; import mightypork.gamecore.util.math.Calc; import mightypork.gamecore.util.math.algo.Coord; import mightypork.gamecore.util.math.algo.Move; import mightypork.gamecore.util.math.algo.Moves; import mightypork.gamecore.util.math.algo.pathfinding.PathFinder; import mightypork.gamecore.util.math.algo.pathfinding.PathFinderProxy; +import mightypork.ion.IonBundle; import mightypork.rogue.world.entity.AiTimer; import mightypork.rogue.world.entity.Entity; import mightypork.rogue.world.entity.EntityModule; @@ -132,7 +131,7 @@ public class MonsterAi extends EntityModule implements EntityMoveListener { @Override - public void save(IonBundle bundle) throws IOException + public void save(IonBundle bundle) { bundle.putBundled("tscan", timerFindPrey); bundle.putBundled("tattack", timerAttack); @@ -144,7 +143,7 @@ public class MonsterAi extends EntityModule implements EntityMoveListener { @Override - public void load(IonBundle bundle) throws IOException + public void load(IonBundle bundle) { bundle.loadBundled("tscan", timerFindPrey); bundle.loadBundled("tattack", timerAttack); diff --git a/src/mightypork/rogue/world/entity/modules/EntityModuleHealth.java b/src/mightypork/rogue/world/entity/modules/EntityModuleHealth.java index 8ea07ad..d3b1e05 100644 --- a/src/mightypork/rogue/world/entity/modules/EntityModuleHealth.java +++ b/src/mightypork/rogue/world/entity/modules/EntityModuleHealth.java @@ -1,11 +1,9 @@ package mightypork.rogue.world.entity.modules; -import java.io.IOException; - import mightypork.gamecore.util.error.IllegalValueException; -import mightypork.gamecore.util.ion.IonBundle; import mightypork.gamecore.util.math.Calc; +import mightypork.ion.IonBundle; import mightypork.rogue.world.entity.Entity; import mightypork.rogue.world.entity.EntityModule; @@ -26,7 +24,7 @@ public class EntityModuleHealth extends EntityModule { @Override - public void load(IonBundle bundle) throws IOException + public void load(IonBundle bundle) { health = bundle.get("health", health); maxHealth = bundle.get("max_health", maxHealth); @@ -35,7 +33,7 @@ public class EntityModuleHealth extends EntityModule { @Override - public void save(IonBundle bundle) throws IOException + public void save(IonBundle bundle) { bundle.put("health", health); bundle.put("max_health", maxHealth); diff --git a/src/mightypork/rogue/world/entity/modules/EntityModulePosition.java b/src/mightypork/rogue/world/entity/modules/EntityModulePosition.java index 1b396e5..ab6236d 100644 --- a/src/mightypork/rogue/world/entity/modules/EntityModulePosition.java +++ b/src/mightypork/rogue/world/entity/modules/EntityModulePosition.java @@ -1,17 +1,16 @@ package mightypork.rogue.world.entity.modules; -import java.io.IOException; import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; import java.util.Queue; import java.util.Set; -import mightypork.gamecore.util.ion.IonBundle; import mightypork.gamecore.util.math.algo.Coord; import mightypork.gamecore.util.math.algo.Move; import mightypork.gamecore.util.math.constraints.vect.VectConst; +import mightypork.ion.IonBundle; import mightypork.rogue.world.entity.Entity; import mightypork.rogue.world.entity.EntityModule; @@ -40,7 +39,7 @@ public class EntityModulePosition extends EntityModule { @Override - public void save(IonBundle bundle) throws IOException + public void save(IonBundle bundle) { bundle.putSequence("path", path); bundle.putBundled("lpos", lastPos); @@ -50,7 +49,7 @@ public class EntityModulePosition extends EntityModule { @Override - public void load(IonBundle bundle) throws IOException + public void load(IonBundle bundle) { bundle.loadSequence("path", path); bundle.loadBundled("lpos", lastPos); diff --git a/src/mightypork/rogue/world/entity/modules/EntityPos.java b/src/mightypork/rogue/world/entity/modules/EntityPos.java index 140cbf9..1837034 100644 --- a/src/mightypork/rogue/world/entity/modules/EntityPos.java +++ b/src/mightypork/rogue/world/entity/modules/EntityPos.java @@ -1,23 +1,21 @@ package mightypork.rogue.world.entity.modules; -import java.io.IOException; - import mightypork.gamecore.eventbus.events.Updateable; -import mightypork.gamecore.util.ion.IonBundle; -import mightypork.gamecore.util.ion.IonObjBundled; import mightypork.gamecore.util.math.Easing; import mightypork.gamecore.util.math.algo.Coord; import mightypork.gamecore.util.math.algo.Move; import mightypork.gamecore.util.math.constraints.vect.Vect; import mightypork.gamecore.util.math.constraints.vect.VectConst; import mightypork.gamecore.util.math.constraints.vect.mutable.VectAnimated; +import mightypork.ion.IonBundle; +import mightypork.ion.IonObjBundled; /** * Entity position * - * @author MightyPork + * @author Ondřej Hruška */ class EntityPos implements IonObjBundled, Updateable { @@ -49,7 +47,7 @@ class EntityPos implements IonObjBundled, Updateable { @Override - public void load(IonBundle in) throws IOException + public void load(IonBundle in) { in.loadBundled("pos", coord); walkOffset.reset(); @@ -57,7 +55,7 @@ class EntityPos implements IonObjBundled, Updateable { @Override - public void save(IonBundle out) throws IOException + public void save(IonBundle out) { out.putBundled("pos", coord); } diff --git a/src/mightypork/rogue/world/entity/render/EntityRendererMobLR.java b/src/mightypork/rogue/world/entity/render/EntityRendererMobLR.java index 431f91e..c00ba0c 100644 --- a/src/mightypork/rogue/world/entity/render/EntityRendererMobLR.java +++ b/src/mightypork/rogue/world/entity/render/EntityRendererMobLR.java @@ -21,7 +21,7 @@ import mightypork.rogue.world.level.render.MapRenderContext; * Renderer for a walking mob with only one strip (right sided), which is * flipped for walking left. * - * @author MightyPork + * @author Ondřej Hruška */ public class EntityRendererMobLR extends EntityRenderer { diff --git a/src/mightypork/rogue/world/events/WorldAscendRequest.java b/src/mightypork/rogue/world/events/WorldAscendRequest.java index eecfc1c..6ad4c9b 100644 --- a/src/mightypork/rogue/world/events/WorldAscendRequest.java +++ b/src/mightypork/rogue/world/events/WorldAscendRequest.java @@ -7,7 +7,7 @@ import mightypork.gamecore.eventbus.BusEvent; /** * Player wants to go up * - * @author MightyPork + * @author Ondřej Hruška */ public class WorldAscendRequest extends BusEvent { diff --git a/src/mightypork/rogue/world/events/WorldPauseRequest.java b/src/mightypork/rogue/world/events/WorldPauseRequest.java index d2ffa94..8b96c31 100644 --- a/src/mightypork/rogue/world/events/WorldPauseRequest.java +++ b/src/mightypork/rogue/world/events/WorldPauseRequest.java @@ -8,7 +8,7 @@ import mightypork.rogue.world.World; /** * Toggle world pause state * - * @author MightyPork + * @author Ondřej Hruška */ public class WorldPauseRequest extends BusEvent { diff --git a/src/mightypork/rogue/world/gen/MapTheme.java b/src/mightypork/rogue/world/gen/MapTheme.java index 22fbf0b..4967692 100644 --- a/src/mightypork/rogue/world/gen/MapTheme.java +++ b/src/mightypork/rogue/world/gen/MapTheme.java @@ -7,7 +7,7 @@ import mightypork.rogue.world.tile.TileModel; /** * Map theme to use for building * - * @author MightyPork + * @author Ondřej Hruška */ public interface MapTheme { diff --git a/src/mightypork/rogue/world/gen/RoomBuilder.java b/src/mightypork/rogue/world/gen/RoomBuilder.java index 7da8a82..c3fbd13 100644 --- a/src/mightypork/rogue/world/gen/RoomBuilder.java +++ b/src/mightypork/rogue/world/gen/RoomBuilder.java @@ -9,7 +9,7 @@ import mightypork.gamecore.util.math.algo.Coord; /** * Room model * - * @author MightyPork + * @author Ondřej Hruška */ public interface RoomBuilder { diff --git a/src/mightypork/rogue/world/gen/RoomEntry.java b/src/mightypork/rogue/world/gen/RoomEntry.java index 56a43fc..8f75567 100644 --- a/src/mightypork/rogue/world/gen/RoomEntry.java +++ b/src/mightypork/rogue/world/gen/RoomEntry.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.math.algo.Coord; /** * Room description entry for {@link ScratchMap} * - * @author MightyPork + * @author Ondřej Hruška */ public class RoomEntry { diff --git a/src/mightypork/rogue/world/gen/ScratchMap.java b/src/mightypork/rogue/world/gen/ScratchMap.java index f4c3fb7..bb29c24 100644 --- a/src/mightypork/rogue/world/gen/ScratchMap.java +++ b/src/mightypork/rogue/world/gen/ScratchMap.java @@ -25,7 +25,7 @@ import mightypork.rogue.world.tile.Tiles; /** * Temporary tile map used for level generation. * - * @author MightyPork + * @author Ondřej Hruška */ public class ScratchMap { diff --git a/src/mightypork/rogue/world/gen/WorldGenError.java b/src/mightypork/rogue/world/gen/WorldGenError.java index 82d3b9a..5ecc284 100644 --- a/src/mightypork/rogue/world/gen/WorldGenError.java +++ b/src/mightypork/rogue/world/gen/WorldGenError.java @@ -4,7 +4,7 @@ package mightypork.rogue.world.gen; /** * Error in world generation * - * @author MightyPork + * @author Ondřej Hruška */ public class WorldGenError extends RuntimeException { diff --git a/src/mightypork/rogue/world/gen/rooms/StorageRoom.java b/src/mightypork/rogue/world/gen/rooms/StorageRoom.java index 5c40fa2..9515808 100644 --- a/src/mightypork/rogue/world/gen/rooms/StorageRoom.java +++ b/src/mightypork/rogue/world/gen/rooms/StorageRoom.java @@ -18,7 +18,7 @@ public class StorageRoom extends SecretRoom { int maxStuff = Calc.randInt(rand, 3, 5); // at least one meat or cheese. - boolean oneMeat = rand.nextBoolean(); + final boolean oneMeat = rand.nextBoolean(); for (int i = 0; i < Calc.randInt(rand, oneMeat ? 1 : 0, 3); i++) { map.addItemInArea(Items.MEAT.createItem(), min, max, 50); diff --git a/src/mightypork/rogue/world/gui/MapView.java b/src/mightypork/rogue/world/gui/MapView.java index a441459..494599f 100644 --- a/src/mightypork/rogue/world/gui/MapView.java +++ b/src/mightypork/rogue/world/gui/MapView.java @@ -30,7 +30,7 @@ import mightypork.rogue.world.gui.interaction.MapInteractionPlugin; /** * Level display component * - * @author MightyPork + * @author Ondřej Hruška */ public class MapView extends InputComponent implements DelegatingClient, MouseButtonHandler, Updateable, WorldAscendRequestListener, WorldDescendRequestListener { diff --git a/src/mightypork/rogue/world/item/Item.java b/src/mightypork/rogue/world/item/Item.java index 8d3881b..502bd84 100644 --- a/src/mightypork/rogue/world/item/Item.java +++ b/src/mightypork/rogue/world/item/Item.java @@ -1,17 +1,12 @@ package mightypork.rogue.world.item; -import java.io.IOException; - import mightypork.gamecore.logging.Log; import mightypork.gamecore.util.annot.DefaultImpl; -import mightypork.gamecore.util.ion.IonBundle; -import mightypork.gamecore.util.ion.IonInput; -import mightypork.gamecore.util.ion.IonObjBlob; -import mightypork.gamecore.util.ion.IonObjBundled; -import mightypork.gamecore.util.ion.IonOutput; import mightypork.gamecore.util.math.Calc; import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.ion.IonBundle; +import mightypork.ion.IonObjBundled; import mightypork.rogue.world.PlayerFacade; @@ -44,7 +39,7 @@ public abstract class Item implements IonObjBundled { @Override @DefaultImpl - public void save(IonBundle out) throws IOException + public void save(IonBundle out) { out.put("c", amount); out.put("u", uses); @@ -53,7 +48,7 @@ public abstract class Item implements IonObjBundled { @Override @DefaultImpl - public void load(IonBundle in) throws IOException + public void load(IonBundle in) { amount = in.get("c", amount); uses = in.get("u", uses); diff --git a/src/mightypork/rogue/world/item/ItemModel.java b/src/mightypork/rogue/world/item/ItemModel.java index 23d5921..c299aaa 100644 --- a/src/mightypork/rogue/world/item/ItemModel.java +++ b/src/mightypork/rogue/world/item/ItemModel.java @@ -3,17 +3,14 @@ package mightypork.rogue.world.item; import java.io.IOException; -import mightypork.gamecore.util.ion.Ion; -import mightypork.gamecore.util.ion.IonBundle; -import mightypork.gamecore.util.ion.IonInput; -import mightypork.gamecore.util.ion.IonOutput; import mightypork.gamecore.util.math.Calc; +import mightypork.ion.IonBundle; /** * Item model (builder) * - * @author MightyPork + * @author Ondřej Hruška */ public final class ItemModel { diff --git a/src/mightypork/rogue/world/item/Items.java b/src/mightypork/rogue/world/item/Items.java index f981d39..63e5927 100644 --- a/src/mightypork/rogue/world/item/Items.java +++ b/src/mightypork/rogue/world/item/Items.java @@ -4,9 +4,9 @@ package mightypork.rogue.world.item; import java.io.IOException; import java.util.Collection; -import mightypork.gamecore.util.ion.IonBundle; -import mightypork.gamecore.util.ion.IonInput; -import mightypork.gamecore.util.ion.IonOutput; +import mightypork.ion.IonBundle; +import mightypork.ion.IonInput; +import mightypork.ion.IonOutput; import mightypork.rogue.world.item.impl.active.ItemHeartPiece; import mightypork.rogue.world.item.impl.food.ItemCheese; import mightypork.rogue.world.item.impl.food.ItemMeat; @@ -17,7 +17,7 @@ import mightypork.rogue.world.item.impl.weapons.*; /** * Item registry * - * @author MightyPork + * @author Ondřej Hruška */ public final class Items { @@ -76,7 +76,7 @@ public final class Items { out.writeIntByte(model.id); - IonBundle ib = new IonBundle(); + final IonBundle ib = new IonBundle(); model.saveItem(ib, item); out.writeBundle(ib); } diff --git a/src/mightypork/rogue/world/level/Level.java b/src/mightypork/rogue/world/level/Level.java index 3d242b4..93ed129 100644 --- a/src/mightypork/rogue/world/level/Level.java +++ b/src/mightypork/rogue/world/level/Level.java @@ -10,10 +10,6 @@ import mightypork.gamecore.eventbus.clients.DelegatingClient; import mightypork.gamecore.eventbus.clients.ToggleableClient; import mightypork.gamecore.eventbus.events.Updateable; import mightypork.gamecore.logging.Log; -import mightypork.gamecore.util.ion.IonBundle; -import mightypork.gamecore.util.ion.IonInput; -import mightypork.gamecore.util.ion.IonObjBinary; -import mightypork.gamecore.util.ion.IonOutput; import mightypork.gamecore.util.math.Calc; import mightypork.gamecore.util.math.algo.Coord; import mightypork.gamecore.util.math.algo.Move; @@ -21,6 +17,10 @@ import mightypork.gamecore.util.math.algo.Moves; import mightypork.gamecore.util.math.algo.floodfill.FloodFill; import mightypork.gamecore.util.math.constraints.vect.Vect; import mightypork.gamecore.util.math.noise.NoiseGen; +import mightypork.ion.IonBundle; +import mightypork.ion.IonInput; +import mightypork.ion.IonObjBinary; +import mightypork.ion.IonOutput; import mightypork.rogue.world.World; import mightypork.rogue.world.entity.Entities; import mightypork.rogue.world.entity.Entity; @@ -35,7 +35,7 @@ import mightypork.rogue.world.tile.Tiles; /** * One level of the dungeon * - * @author MightyPork + * @author Ondřej Hruška */ public class Level implements BusAccess, Updateable, DelegatingClient, ToggleableClient, IonObjBinary { @@ -288,13 +288,6 @@ public class Level implements BusAccess, Updateable, DelegatingClient, Toggleabl } - @Override - public short getIonMark() - { - return ION_MARK; - } - - @Override public void update(double delta) { diff --git a/src/mightypork/rogue/world/level/render/TileRenderContext.java b/src/mightypork/rogue/world/level/render/TileRenderContext.java index 0072355..0220c01 100644 --- a/src/mightypork/rogue/world/level/render/TileRenderContext.java +++ b/src/mightypork/rogue/world/level/render/TileRenderContext.java @@ -13,7 +13,7 @@ import mightypork.rogue.world.tile.Tile; /** * Context for tile rendering. * - * @author MightyPork + * @author Ondřej Hruška */ public final class TileRenderContext extends MapRenderContext implements RectBound { diff --git a/src/mightypork/rogue/world/tile/Tile.java b/src/mightypork/rogue/world/tile/Tile.java index 6deea12..5a9b3e5 100644 --- a/src/mightypork/rogue/world/tile/Tile.java +++ b/src/mightypork/rogue/world/tile/Tile.java @@ -7,10 +7,10 @@ import mightypork.gamecore.eventbus.BusAccess; import mightypork.gamecore.eventbus.EventBus; import mightypork.gamecore.logging.Log; import mightypork.gamecore.util.annot.DefaultImpl; -import mightypork.gamecore.util.ion.IonInput; -import mightypork.gamecore.util.ion.IonObjBlob; -import mightypork.gamecore.util.ion.IonOutput; import mightypork.gamecore.util.math.color.Color; +import mightypork.ion.IonInput; +import mightypork.ion.IonObjBinary; +import mightypork.ion.IonOutput; import mightypork.rogue.Const; import mightypork.rogue.world.World; import mightypork.rogue.world.item.Item; @@ -21,9 +21,9 @@ import mightypork.rogue.world.level.render.TileRenderContext; /** * Tile data bundle. Client only renders. * - * @author MightyPork + * @author Ondřej Hruška */ -public abstract class Tile implements BusAccess, IonObjBlob { +public abstract class Tile implements BusAccess, IonObjBinary { // tmp extras public final TileGenData genData = new TileGenData(); diff --git a/src/mightypork/rogue/world/tile/TileGenData.java b/src/mightypork/rogue/world/tile/TileGenData.java index 1270596..ec8be4c 100644 --- a/src/mightypork/rogue/world/tile/TileGenData.java +++ b/src/mightypork/rogue/world/tile/TileGenData.java @@ -7,7 +7,7 @@ import mightypork.rogue.world.gen.TileProtectLevel; /** * Data storage for world generator * - * @author MightyPork + * @author Ondřej Hruška */ public class TileGenData { diff --git a/src/mightypork/rogue/world/tile/TileModel.java b/src/mightypork/rogue/world/tile/TileModel.java index 8821f48..1b85969 100644 --- a/src/mightypork/rogue/world/tile/TileModel.java +++ b/src/mightypork/rogue/world/tile/TileModel.java @@ -3,14 +3,14 @@ package mightypork.rogue.world.tile; import java.io.IOException; -import mightypork.gamecore.util.ion.IonInput; -import mightypork.gamecore.util.ion.IonOutput; +import mightypork.ion.IonInput; +import mightypork.ion.IonOutput; /** * Tile model (builder) * - * @author MightyPork + * @author Ondřej Hruška */ public final class TileModel { diff --git a/src/mightypork/rogue/world/tile/TileRenderer.java b/src/mightypork/rogue/world/tile/TileRenderer.java index d3dd987..392d5f1 100644 --- a/src/mightypork/rogue/world/tile/TileRenderer.java +++ b/src/mightypork/rogue/world/tile/TileRenderer.java @@ -15,7 +15,7 @@ import mightypork.rogue.world.tile.render.NullTileRenderer; /** * Renderer for a tile; each tile has own renderer. * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class TileRenderer implements Updateable { diff --git a/src/mightypork/rogue/world/tile/TileType.java b/src/mightypork/rogue/world/tile/TileType.java index 4528b51..3bf119f 100644 --- a/src/mightypork/rogue/world/tile/TileType.java +++ b/src/mightypork/rogue/world/tile/TileType.java @@ -7,7 +7,7 @@ import mightypork.gamecore.util.math.color.Color; /** * Kinds of tiles * - * @author MightyPork + * @author Ondřej Hruška */ public enum TileType { diff --git a/src/mightypork/rogue/world/tile/Tiles.java b/src/mightypork/rogue/world/tile/Tiles.java index bf3fcf5..16b12a0 100644 --- a/src/mightypork/rogue/world/tile/Tiles.java +++ b/src/mightypork/rogue/world/tile/Tiles.java @@ -3,8 +3,8 @@ package mightypork.rogue.world.tile; import java.io.IOException; -import mightypork.gamecore.util.ion.IonInput; -import mightypork.gamecore.util.ion.IonOutput; +import mightypork.ion.IonInput; +import mightypork.ion.IonOutput; import mightypork.rogue.world.tile.impl.NullTile; import mightypork.rogue.world.tile.impl.brick.*; @@ -12,7 +12,7 @@ import mightypork.rogue.world.tile.impl.brick.*; /** * Tile registry * - * @author MightyPork + * @author Ondřej Hruška */ public final class Tiles { diff --git a/src/mightypork/rogue/world/tile/impl/TileBaseChest.java b/src/mightypork/rogue/world/tile/impl/TileBaseChest.java index fb12d29..eafbf6e 100644 --- a/src/mightypork/rogue/world/tile/impl/TileBaseChest.java +++ b/src/mightypork/rogue/world/tile/impl/TileBaseChest.java @@ -3,8 +3,8 @@ package mightypork.rogue.world.tile.impl; import java.io.IOException; -import mightypork.gamecore.util.ion.IonInput; -import mightypork.gamecore.util.ion.IonOutput; +import mightypork.ion.IonInput; +import mightypork.ion.IonOutput; import mightypork.rogue.world.tile.TileModel; import mightypork.rogue.world.tile.TileType; diff --git a/src/mightypork/rogue/world/tile/impl/TileBaseDoor.java b/src/mightypork/rogue/world/tile/impl/TileBaseDoor.java index 98eb8e6..b887c7a 100644 --- a/src/mightypork/rogue/world/tile/impl/TileBaseDoor.java +++ b/src/mightypork/rogue/world/tile/impl/TileBaseDoor.java @@ -4,8 +4,8 @@ package mightypork.rogue.world.tile.impl; import java.io.IOException; import mightypork.gamecore.resources.textures.TxSheet; -import mightypork.gamecore.util.ion.IonInput; -import mightypork.gamecore.util.ion.IonOutput; +import mightypork.ion.IonInput; +import mightypork.ion.IonOutput; import mightypork.rogue.world.tile.TileModel; import mightypork.rogue.world.tile.TileRenderer; import mightypork.rogue.world.tile.TileType; diff --git a/src/mightypork/rogue/world/tile/impl/TileBasePassage.java b/src/mightypork/rogue/world/tile/impl/TileBasePassage.java index 23f38b4..cdfdef5 100644 --- a/src/mightypork/rogue/world/tile/impl/TileBasePassage.java +++ b/src/mightypork/rogue/world/tile/impl/TileBasePassage.java @@ -11,7 +11,7 @@ import mightypork.rogue.world.tile.render.BasicTileRenderer; /** * Collapsed wall that's walk-through * - * @author MightyPork + * @author Ondřej Hruška */ public abstract class TileBasePassage extends TileSolid { diff --git a/src/mightypork/rogue/world/tile/impl/TileBaseSecretDoor.java b/src/mightypork/rogue/world/tile/impl/TileBaseSecretDoor.java index c626b44..ae5b9ef 100644 --- a/src/mightypork/rogue/world/tile/impl/TileBaseSecretDoor.java +++ b/src/mightypork/rogue/world/tile/impl/TileBaseSecretDoor.java @@ -4,9 +4,9 @@ package mightypork.rogue.world.tile.impl; import java.io.IOException; import mightypork.gamecore.resources.textures.TxSheet; -import mightypork.gamecore.util.ion.IonInput; -import mightypork.gamecore.util.ion.IonOutput; import mightypork.gamecore.util.math.color.Color; +import mightypork.ion.IonInput; +import mightypork.ion.IonOutput; import mightypork.rogue.world.tile.TileColors; import mightypork.rogue.world.tile.TileModel; diff --git a/src/mightypork/rogue/world/tile/impl/TileWithItems.java b/src/mightypork/rogue/world/tile/impl/TileWithItems.java index a19fb62..54a4051 100644 --- a/src/mightypork/rogue/world/tile/impl/TileWithItems.java +++ b/src/mightypork/rogue/world/tile/impl/TileWithItems.java @@ -4,8 +4,8 @@ package mightypork.rogue.world.tile.impl; import java.io.IOException; import java.util.Stack; -import mightypork.gamecore.util.ion.IonInput; -import mightypork.gamecore.util.ion.IonOutput; +import mightypork.ion.IonInput; +import mightypork.ion.IonOutput; import mightypork.rogue.Const; import mightypork.rogue.world.item.Item; import mightypork.rogue.world.item.Items; diff --git a/src/mightypork/rogue/world/tile/render/NullTileRenderer.java b/src/mightypork/rogue/world/tile/render/NullTileRenderer.java index 5aa7d56..c14dfa9 100644 --- a/src/mightypork/rogue/world/tile/render/NullTileRenderer.java +++ b/src/mightypork/rogue/world/tile/render/NullTileRenderer.java @@ -8,7 +8,7 @@ import mightypork.rogue.world.tile.TileRenderer; /** * Do-nothing tile renderer * - * @author MightyPork + * @author Ondřej Hruška */ public class NullTileRenderer extends TileRenderer { diff --git a/src/mightypork/rogue/world/tile/render/OneFrameTileRenderer.java b/src/mightypork/rogue/world/tile/render/OneFrameTileRenderer.java index b9d1547..72a524f 100644 --- a/src/mightypork/rogue/world/tile/render/OneFrameTileRenderer.java +++ b/src/mightypork/rogue/world/tile/render/OneFrameTileRenderer.java @@ -11,7 +11,7 @@ import mightypork.rogue.world.tile.TileRenderer; /** * Tile that spans across two tiles visually (two-high) * - * @author MightyPork + * @author Ondřej Hruška */ public class OneFrameTileRenderer extends TileRenderer { diff --git a/src/mightypork/rogue/world/tile/render/TwoHighTileRenderer.java b/src/mightypork/rogue/world/tile/render/TwoHighTileRenderer.java index 32b4b32..de48cce 100644 --- a/src/mightypork/rogue/world/tile/render/TwoHighTileRenderer.java +++ b/src/mightypork/rogue/world/tile/render/TwoHighTileRenderer.java @@ -12,7 +12,7 @@ import mightypork.rogue.world.tile.TileRenderer; /** * Tile that spans across two tiles visually (two-high) * - * @author MightyPork + * @author Ondřej Hruška */ public class TwoHighTileRenderer extends TileRenderer {