From a8ed021156c0802a0b69bdb0e249acd742209814 Mon Sep 17 00:00:00 2001 From: ondra Date: Wed, 30 Apr 2014 20:37:09 +0200 Subject: [PATCH] All merged into gamecore and reorganized --- .../gamecore/{control => app}/AppAccess.java | 6 +- .../gamecore/{control => app}/AppModule.java | 6 +- .../{control => app}/AppSubModule.java | 10 +- .../gamecore/{control => app}/BaseApp.java | 45 +++- .../LightAppModule.java} | 10 +- .../GameLoop.java => app/MainLoop.java} | 13 +- .../requests => app}/MainLoopRequest.java | 6 +- .../MainLoopRequestListener.java | 2 +- .../eventbus/BufferedHashSet.java | 2 +- .../eventbus/BusAccess.java | 2 +- .../eventbus/BusEvent.java | 12 +- .../eventbus/EventBus.java | 14 +- .../eventbus/EventChannel.java | 8 +- .../eventbus/clients/BusNode.java | 6 +- .../eventbus/clients/ClientHub.java | 4 +- .../eventbus/clients/DelegatingClient.java | 2 +- .../eventbus/clients/RootBusNode.java | 6 +- .../eventbus/clients/ToggleableClient.java | 2 +- .../eventbus/event_flags/DelayedEvent.java | 2 +- .../eventbus/event_flags/ImmediateEvent.java | 2 +- .../event_flags/NonConsumableEvent.java | 2 +- .../event_flags/SingleReceiverEvent.java | 2 +- .../eventbus/event_flags/UnloggedEvent.java | 2 +- .../events}/DestroyEvent.java | 9 +- .../eventbus/events}/Destroyable.java | 2 +- .../core => eventbus/events}/UpdateEvent.java | 11 +- .../eventbus/events}/Updateable.java | 2 +- .../control => gamecore/gui}/Action.java | 3 +- .../gui}/ActionTrigger.java | 2 +- .../control => gamecore/gui}/Enableable.java | 2 +- .../gui/components/ClickableComponent.java | 8 +- .../gamecore/gui/components/Component.java | 4 +- .../gui/components/InputComponent.java | 4 +- .../gui/components/LayoutComponent.java | 14 +- .../gui/components/PluggableRenderable.java | 6 +- .../gui/components/VisualComponent.java | 14 +- .../gui/components/layout/ColumnHolder.java | 6 +- .../components/layout/ConstraintLayout.java | 4 +- .../gui/components/layout/GridLayout.java | 6 +- .../layout/HorizontalFixedFlowLayout.java | 8 +- .../gui/components/layout/RowHolder.java | 6 +- .../layout/VerticalFixedFlowLayout.java | 8 +- .../gui/components/painters/ImagePainter.java | 2 +- .../gui/components/painters/QuadPainter.java | 4 +- .../gui/components/painters/TextPainter.java | 14 +- .../gui => gui/events}/LayoutChangeEvent.java | 8 +- .../events}/LayoutChangeListener.java | 2 +- .../events}/ScreenRequestEvent.java | 6 +- .../events}/ScreenRequestListener.java | 2 +- .../events}/ViewportChangeEvent.java | 8 +- .../events}/ViewportChangeListener.java | 2 +- .../gamecore/gui/screens/BaseScreen.java | 12 +- .../gui}/screens/CrossfadeOverlay.java | 15 +- .../gui}/screens/CrossfadeRequest.java | 4 +- .../gamecore/gui/screens/LayeredScreen.java | 4 +- .../gamecore/gui/screens/Overlay.java | 12 +- .../gamecore/gui/screens/Screen.java | 4 +- .../gamecore/gui/screens/ScreenLayer.java | 2 +- .../gamecore/gui/screens/ScreenRegistry.java | 16 +- .../gamecore/input/InputSystem.java | 16 +- src/mightypork/gamecore/input/KeyBinder.java | 2 +- src/mightypork/gamecore/input/KeyBinding.java | 4 +- .../gamecore/input/KeyBindingPool.java | 6 +- .../input => input/events}/KeyEvent.java | 6 +- .../input => input/events}/KeyListener.java | 2 +- .../events}/MouseButtonEvent.java | 12 +- .../events}/MouseButtonListener.java | 2 +- .../events}/MouseMotionEvent.java | 10 +- .../events}/MouseMotionListener.java | 2 +- .../{util => gamecore}/logging/Log.java | 16 +- .../{util => gamecore}/logging/LogAlias.java | 2 +- .../SlickLogRedirector.java | 27 +-- .../logging/monitors/BaseLogMonitor.java | 2 +- .../logging/monitors/LogMonitor.java | 2 +- .../logging/monitors/LogToSysoutMonitor.java | 2 +- .../logging/writers/ArchivingLog.java | 4 +- .../logging/writers/LogWriter.java | 4 +- .../logging/writers/SimpleLog.java | 6 +- .../gamecore/render/DisplaySystem.java | 16 +- src/mightypork/gamecore/render/Render.java | 20 +- .../{ => resources}/audio/DeferredAudio.java | 10 +- .../{ => resources}/audio/JointVolume.java | 4 +- .../{ => resources}/audio/SoundBank.java | 12 +- .../{ => resources}/audio/SoundSystem.java | 20 +- .../{ => resources}/audio/Volume.java | 6 +- .../audio/players/BaseAudioPlayer.java | 8 +- .../audio/players/EffectPlayer.java | 8 +- .../audio/players/LoopPlayer.java | 12 +- .../events}/ResourceLoadRequest.java | 8 +- .../events}/ResourceLoadRequestListener.java | 4 +- .../{render => resources}/fonts/FontBank.java | 12 +- .../fonts/FontRenderer.java | 8 +- .../{render => resources}/fonts/GLFont.java | 6 +- .../{render => resources}/fonts/Glyphs.java | 2 +- .../fonts/impl/CachedFont.java | 16 +- .../fonts/impl/DeferredFont.java | 18 +- .../fonts/impl/DeferredFontNative.java | 6 +- .../loading/AsyncResourceLoader.java | 14 +- .../{ => resources}/loading/Deferred.java | 2 +- .../loading/DeferredResource.java | 8 +- .../loading/MustLoadInMainThread.java | 2 +- .../textures/DeferredTexture.java | 10 +- .../textures/FilterMode.java | 2 +- .../textures/GLTexture.java | 6 +- .../textures/QuadGrid.java | 4 +- .../textures/TextureBank.java | 14 +- .../textures/TxQuad.java | 6 +- .../textures/TxSheet.java | 4 +- .../textures/WrapMode.java | 2 +- .../{rogue => gamecore}/util/Utils.java | 4 +- .../util/annot}/DefaultImpl.java | 2 +- .../util/annot}/FactoryMethod.java | 2 +- .../util/error/CorruptedDataException.java | 2 +- .../util/error/IllegalValueException.java | 2 +- .../util/error/KeyAlreadyExistsException.java | 2 +- .../util/files}/FileSuffixFilter.java | 2 +- .../util/files/FileTreeDiff.java | 4 +- .../{ => gamecore}/util/files/FileUtils.java | 10 +- .../util/files/InstanceLock.java | 2 +- .../{ => gamecore}/util/files/OsUtils.java | 2 +- .../util/files/config/PropertyManager.java | 10 +- .../util/files/config/SimpleConfig.java | 6 +- .../util/files/config/SortedProperties.java | 2 +- .../util/files/zip/ZipBuilder.java | 6 +- .../util/files/zip/ZipUtils.java | 10 +- .../files => gamecore/util}/ion/Ion.java | 70 +++--- .../util}/ion/IonBundle.java | 45 ++-- .../files => gamecore/util}/ion/IonInput.java | 6 +- .../util}/ion/IonMapWrapper.java | 4 +- .../util/ion/IonObjBinary.java} | 4 +- .../util/ion/IonObjBlob.java} | 4 +- .../util/ion/IonObjBundled.java} | 4 +- .../util}/ion/IonOutput.java | 10 +- .../util}/ion/IonSequenceWrapper.java | 4 +- .../{ => gamecore}/util/math/Calc.java | 4 +- .../{ => gamecore}/util/math/Easing.java | 4 +- .../{ => gamecore}/util/math/Polar.java | 4 +- .../{ => gamecore}/util/math/Range.java | 2 +- .../util/math/algo}/Coord.java | 92 +++++-- .../gamecore/util/math/algo/Sides.java | 60 +++++ .../gamecore/util/math/algo/Step.java | 117 +++++++++ .../math/algo/floodfill}/FillContext.java | 7 +- .../util/math/algo/floodfill}/FloodFill.java | 10 +- .../math/algo}/pathfinding/Heuristic.java | 4 +- .../math/algo}/pathfinding/PathFinder.java | 18 +- .../algo}/pathfinding/PathFindingContext.java | 7 +- .../pathfinding/PathFindingContextProxy.java | 58 +++++ .../heuristics}/DiagonalHeuristic.java | 5 +- .../heuristics}/ManhattanHeuristic.java | 5 +- .../{ => gamecore}/util/math/color/Color.java | 8 +- .../util/math/color/ColorAlphaAdjuster.java | 4 +- .../util/math/color/ColorHsb.java | 4 +- .../util/math/color/ColorRgb.java | 4 +- .../util/math/color/pal}/CGA.java | 4 +- .../util/math/color/pal}/COMMODORE.java | 4 +- .../util/math/color/pal}/PAL16.java | 4 +- .../util/math/color/pal}/RGB.java | 4 +- .../util/math/color/pal}/ZX.java | 4 +- .../math/constraints/ConstraintCache.java | 2 +- .../util/math/constraints/DigestCache.java | 2 +- .../util/math/constraints/Digestable.java | 2 +- .../util/math/constraints/Pollable.java | 2 +- .../util/math/constraints/Poller.java | 2 +- .../util/math/constraints/num/Num.java | 22 +- .../util/math/constraints/num/NumConst.java | 4 +- .../num/caching/AbstractNumCache.java | 10 +- .../constraints/num/caching/NumCache.java | 6 +- .../constraints/num/caching/NumDigest.java | 4 +- .../constraints/num/mutable/NumAnimated.java | 10 +- .../num/mutable/NumAnimatedDeg.java | 8 +- .../num/mutable/NumAnimatedRad.java | 8 +- .../constraints/num/mutable/NumMutable.java | 4 +- .../math/constraints/num/mutable/NumVar.java | 4 +- .../constraints/num/proxy/NumAdapter.java | 4 +- .../math/constraints/num/proxy/NumBound.java | 4 +- .../num/proxy/NumBoundAdapter.java | 4 +- .../math/constraints/num/proxy/NumProxy.java | 4 +- .../num/proxy/PluggableNumBound.java | 2 +- .../util/math/constraints/rect/Rect.java | 30 +-- .../util/math/constraints/rect/RectConst.java | 10 +- .../constraints/rect/builders/TiledRect.java | 12 +- .../rect/caching/AbstractRectCache.java | 10 +- .../constraints/rect/caching/RectCache.java | 6 +- .../constraints/rect/caching/RectDigest.java | 4 +- .../constraints/rect/mutable/RectMutable.java | 6 +- .../constraints/rect/mutable/RectVar.java | 6 +- .../rect/proxy/PluggableRectBound.java | 2 +- .../constraints/rect/proxy/RectAdapter.java | 8 +- .../constraints/rect/proxy/RectBound.java | 4 +- .../rect/proxy/RectBoundAdapter.java | 4 +- .../constraints/rect/proxy/RectProxy.java | 4 +- .../rect/proxy/RectVectAdapter.java | 6 +- .../util/math/constraints/vect/Vect.java | 28 +-- .../util/math/constraints/vect/VectConst.java | 10 +- .../util/math/constraints/vect/VectProxy.java | 4 +- .../vect/caching/AbstractVectCache.java | 10 +- .../constraints/vect/caching/VectCache.java | 6 +- .../constraints/vect/caching/VectDigest.java | 4 +- .../vect/mutable/VectAnimated.java | 14 +- .../constraints/vect/mutable/VectMutable.java | 4 +- .../constraints/vect/mutable/VectVar.java | 2 +- .../vect/proxy/PluggableVectBound.java | 2 +- .../constraints/vect/proxy/VectAdapter.java | 4 +- .../constraints/vect/proxy/VectBound.java | 4 +- .../vect/proxy/VectBoundAdapter.java | 4 +- .../vect/proxy/VectNumAdapter.java | 8 +- .../util/math/noise/NoiseGen.java | 2 +- .../util/math/noise/PerlinNoiseGenerator.java | 2 +- .../gamecore/util/math/timing/Animator.java | 123 ++++++++++ .../util/math}/timing/AnimatorBounce.java | 6 +- .../util/math}/timing/AnimatorRewind.java | 6 +- .../util/math}/timing/FpsMeter.java | 2 +- .../util/math}/timing/Pauseable.java | 2 +- .../util/math/timing/TaskRepeater.java | 44 ++++ .../util/math}/timing/TimedTask.java | 5 +- .../util/math}/timing/TimerDelta.java | 2 +- .../util/math}/timing/TimerFps.java | 2 +- .../{ => gamecore}/util/objects/Convert.java | 12 +- .../{ => gamecore}/util/objects/MapSort.java | 2 +- .../{ => gamecore}/util/objects/Mutable.java | 2 +- .../util/objects/ObjectUtils.java | 4 +- .../{ => gamecore}/util/objects/Pair.java | 6 +- .../{ => gamecore}/util/objects/Triad.java | 5 +- .../util/objects/VarargsParser.java | 2 +- .../gamecore/util/strings/StringProvider.java | 12 + .../util/strings}/StringUtils.java | 2 +- .../gamecore/util/strings/StringWrapper.java | 25 ++ .../util/strings}/filtering/CharFilter.java | 2 +- .../strings/filtering/CharFilterRegex.java} | 6 +- .../filtering/CharFilterWhitelist.java} | 6 +- .../util/strings}/filtering/StringFilter.java | 4 +- src/mightypork/rogue/App.java | 115 ++++----- src/mightypork/rogue/Config.java | 4 +- src/mightypork/rogue/Const.java | 4 +- .../rogue/{MainLoop.java => GameLoop.java} | 14 +- src/mightypork/rogue/Res.java | 18 +- .../rogue/events/ActionRequest.java | 4 +- src/mightypork/rogue/screens/FpsOverlay.java | 16 +- .../rogue/screens/gamescreen/HeartBar.java | 8 +- .../rogue/screens/gamescreen/HudLayer.java | 4 +- .../rogue/screens/gamescreen/NavItemSlot.java | 20 +- .../rogue/screens/gamescreen/ScreenGame.java | 2 +- .../rogue/screens/gamescreen/WorldLayer.java | 2 +- .../rogue/screens/main_menu/MenuButton.java | 10 +- .../rogue/screens/main_menu/MenuLayer.java | 12 +- .../screens/main_menu/ScreenMainMenu.java | 2 +- .../screens/test_bouncyboxes/BouncyBox.java | 14 +- .../test_bouncyboxes/LayerBouncyBoxes.java | 6 +- .../test_bouncyboxes/ScreenTestBouncy.java | 2 +- .../screens/test_cat_sound/LayerColor.java | 2 +- .../test_cat_sound/LayerFlyingCat.java | 16 +- .../screens/test_cat_sound/ScreenTestCat.java | 2 +- .../test_render/LayerTestGradient.java | 4 +- .../screens/test_render/ScreenTestRender.java | 2 +- src/mightypork/rogue/world/PlayerControl.java | 11 +- src/mightypork/rogue/world/PlayerInfo.java | 6 +- src/mightypork/rogue/world/Sides.java | 60 ----- src/mightypork/rogue/world/World.java | 8 +- src/mightypork/rogue/world/WorldProvider.java | 6 +- src/mightypork/rogue/world/WorldRenderer.java | 15 +- .../rogue/world/entity/AiTimer.java | 44 ++++ .../rogue/world/entity/Entities.java | 6 +- src/mightypork/rogue/world/entity/Entity.java | 140 ++++++++--- .../rogue/world/entity/EntityModel.java | 6 +- .../rogue/world/entity/EntityModule.java | 45 +++- .../entity/EntityPathfindingContext.java | 13 +- .../rogue/world/entity/EntityType.java | 12 + .../rogue/world/entity/PathStep.java | 88 ------- .../SimpleEntityPathFindingContext.java | 2 +- .../world/entity/entities/MonsterAi.java | 226 ++++++++++++++++++ .../world/entity/entities/PlayerEntity.java | 95 ++++++-- .../world/entity/entities/SimpleMonster.java | 38 +++ .../entity/modules/EntityModuleHealth.java | 24 +- .../entity/modules/EntityModulePosition.java | 44 ++-- .../entity/modules/EntityMoveListener.java | 7 +- .../rogue/world/entity/modules/EntityPos.java | 26 +- .../entity/renderers/EntityRendererMobLR.java | 10 +- .../rogue/world/gen/LevelGenerator.java | 2 +- .../rogue/world/gen/RoomBuilder.java | 2 +- src/mightypork/rogue/world/gen/RoomDesc.java | 2 +- .../rogue/world/gen/ScratchMap.java | 26 +- .../rogue/world/gen/rooms/DeadEndRoom.java | 2 +- .../rogue/world/gen/rooms/SimpleRectRoom.java | 4 +- src/mightypork/rogue/world/gui/MapView.java | 27 +-- src/mightypork/rogue/world/gui/Minimap.java | 18 +- .../gui/interaction/MIPClickPathfWalk.java | 4 +- .../world/gui/interaction/MIPKeyWalk.java | 2 +- .../world/gui/interaction/MIPMouseWalk.java | 8 +- .../gui/interaction/MapInteractionPlugin.java | 2 +- src/mightypork/rogue/world/item/Item.java | 10 +- .../rogue/world/item/ItemModel.java | 4 +- src/mightypork/rogue/world/level/Level.java | 81 +++++-- .../rogue/world/level/MapAccess.java | 4 +- .../level/render/EntityRenderContext.java | 2 +- .../world/level/render/MapRenderContext.java | 6 +- .../world/level/render/TileRenderContext.java | 11 +- .../rogue/world/tile/DroppedItemRenderer.java | 10 +- src/mightypork/rogue/world/tile/Tile.java | 12 +- .../rogue/world/tile/TileModel.java | 4 +- .../rogue/world/tile/TileRenderer.java | 6 +- src/mightypork/rogue/world/tile/TileType.java | 6 +- src/mightypork/rogue/world/tile/Tiles.java | 4 +- .../tile/renderers/BasicTileRenderer.java | 4 +- .../tile/renderers/DoorTileRenderer.java | 4 +- .../rogue/world/tile/tiles/GroundTile.java | 4 +- .../world/tile/tiles/LockedDoorTile.java | 4 +- .../util/string/StringProvider.java | 36 --- src/mightypork/util/timing/Animator.java | 87 ------- 308 files changed, 2239 insertions(+), 1439 deletions(-) rename src/mightypork/gamecore/{control => app}/AppAccess.java (79%) rename src/mightypork/gamecore/{control => app}/AppModule.java (85%) rename src/mightypork/gamecore/{control => app}/AppSubModule.java (75%) rename src/mightypork/gamecore/{control => app}/BaseApp.java (85%) rename src/mightypork/gamecore/{control/AppAdapter.java => app/LightAppModule.java} (78%) rename src/mightypork/gamecore/{control/GameLoop.java => app/MainLoop.java} (81%) rename src/mightypork/gamecore/{control/events/requests => app}/MainLoopRequest.java (72%) rename src/mightypork/gamecore/{control/events/requests => app}/MainLoopRequestListener.java (80%) rename src/mightypork/{util/control => gamecore}/eventbus/BufferedHashSet.java (98%) rename src/mightypork/{util/control => gamecore}/eventbus/BusAccess.java (80%) rename src/mightypork/{util/control => gamecore}/eventbus/BusEvent.java (85%) rename src/mightypork/{util/control => gamecore}/eventbus/EventBus.java (95%) rename src/mightypork/{util/control => gamecore}/eventbus/EventChannel.java (95%) rename src/mightypork/{util/control => gamecore}/eventbus/clients/BusNode.java (92%) rename src/mightypork/{util/control => gamecore}/eventbus/clients/ClientHub.java (86%) rename src/mightypork/{util/control => gamecore}/eventbus/clients/DelegatingClient.java (91%) rename src/mightypork/{util/control => gamecore}/eventbus/clients/RootBusNode.java (78%) rename src/mightypork/{util/control => gamecore}/eventbus/clients/ToggleableClient.java (81%) rename src/mightypork/{util/control => gamecore}/eventbus/event_flags/DelayedEvent.java (86%) rename src/mightypork/{util/control => gamecore}/eventbus/event_flags/ImmediateEvent.java (80%) rename src/mightypork/{util/control => gamecore}/eventbus/event_flags/NonConsumableEvent.java (87%) rename src/mightypork/{util/control => gamecore}/eventbus/event_flags/SingleReceiverEvent.java (82%) rename src/mightypork/{util/control => gamecore}/eventbus/event_flags/UnloggedEvent.java (85%) rename src/mightypork/gamecore/{control/events/core => eventbus/events}/DestroyEvent.java (51%) rename src/mightypork/{util/control => gamecore/eventbus/events}/Destroyable.java (80%) rename src/mightypork/gamecore/{control/events/core => eventbus/events}/UpdateEvent.java (57%) rename src/mightypork/{util/timing => gamecore/eventbus/events}/Updateable.java (84%) rename src/mightypork/{util/control => gamecore/gui}/Action.java (94%) rename src/mightypork/{util/control => gamecore/gui}/ActionTrigger.java (87%) rename src/mightypork/{util/control => gamecore/gui}/Enableable.java (91%) rename src/mightypork/gamecore/{control/events/gui => gui/events}/LayoutChangeEvent.java (62%) rename src/mightypork/gamecore/{control/events/gui => gui/events}/LayoutChangeListener.java (61%) rename src/mightypork/gamecore/{control/events/requests => gui/events}/ScreenRequestEvent.java (70%) rename src/mightypork/gamecore/{control/events/requests => gui/events}/ScreenRequestListener.java (78%) rename src/mightypork/gamecore/{control/events/gui => gui/events}/ViewportChangeEvent.java (82%) rename src/mightypork/gamecore/{control/events/gui => gui/events}/ViewportChangeListener.java (82%) rename src/mightypork/{rogue => gamecore/gui}/screens/CrossfadeOverlay.java (78%) rename src/mightypork/{rogue => gamecore/gui}/screens/CrossfadeRequest.java (84%) rename src/mightypork/gamecore/{control/events/input => input/events}/KeyEvent.java (87%) rename src/mightypork/gamecore/{control/events/input => input/events}/KeyListener.java (79%) rename src/mightypork/gamecore/{control/events/input => input/events}/MouseButtonEvent.java (84%) rename src/mightypork/gamecore/{control/events/input => input/events}/MouseButtonListener.java (80%) rename src/mightypork/gamecore/{control/events/input => input/events}/MouseMotionEvent.java (71%) rename src/mightypork/gamecore/{control/events/input => input/events}/MouseMotionListener.java (80%) rename src/mightypork/{util => gamecore}/logging/Log.java (94%) rename src/mightypork/{util => gamecore}/logging/LogAlias.java (91%) rename src/mightypork/gamecore/{control => logging}/SlickLogRedirector.java (57%) rename src/mightypork/{util => gamecore}/logging/monitors/BaseLogMonitor.java (92%) rename src/mightypork/{util => gamecore}/logging/monitors/LogMonitor.java (80%) rename src/mightypork/{util => gamecore}/logging/monitors/LogToSysoutMonitor.java (86%) rename src/mightypork/{util => gamecore}/logging/writers/ArchivingLog.java (96%) rename src/mightypork/{util => gamecore}/logging/writers/LogWriter.java (89%) rename src/mightypork/{util => gamecore}/logging/writers/SimpleLog.java (95%) rename src/mightypork/gamecore/{ => resources}/audio/DeferredAudio.java (94%) rename src/mightypork/gamecore/{ => resources}/audio/JointVolume.java (88%) rename src/mightypork/gamecore/{ => resources}/audio/SoundBank.java (85%) rename src/mightypork/gamecore/{ => resources}/audio/SoundSystem.java (89%) rename src/mightypork/gamecore/{ => resources}/audio/Volume.java (66%) rename src/mightypork/gamecore/{ => resources}/audio/players/BaseAudioPlayer.java (88%) rename src/mightypork/gamecore/{ => resources}/audio/players/EffectPlayer.java (84%) rename src/mightypork/gamecore/{ => resources}/audio/players/LoopPlayer.java (88%) rename src/mightypork/gamecore/{control/events/requests => resources/events}/ResourceLoadRequest.java (67%) rename src/mightypork/gamecore/{control/events/requests => resources/events}/ResourceLoadRequestListener.java (68%) rename src/mightypork/gamecore/{render => resources}/fonts/FontBank.java (81%) rename src/mightypork/gamecore/{render => resources}/fonts/FontRenderer.java (94%) rename src/mightypork/gamecore/{render => resources}/fonts/GLFont.java (80%) rename src/mightypork/gamecore/{render => resources}/fonts/Glyphs.java (95%) rename src/mightypork/gamecore/{render => resources}/fonts/impl/CachedFont.java (95%) rename src/mightypork/gamecore/{render => resources}/fonts/impl/DeferredFont.java (88%) rename src/mightypork/gamecore/{render => resources}/fonts/impl/DeferredFontNative.java (85%) rename src/mightypork/gamecore/{ => resources}/loading/AsyncResourceLoader.java (87%) rename src/mightypork/gamecore/{ => resources}/loading/Deferred.java (85%) rename src/mightypork/gamecore/{ => resources}/loading/DeferredResource.java (92%) rename src/mightypork/gamecore/{ => resources}/loading/MustLoadInMainThread.java (86%) rename src/mightypork/gamecore/{render => resources}/textures/DeferredTexture.java (90%) rename src/mightypork/gamecore/{render => resources}/textures/FilterMode.java (84%) rename src/mightypork/gamecore/{render => resources}/textures/GLTexture.java (88%) rename src/mightypork/gamecore/{render => resources}/textures/QuadGrid.java (95%) rename src/mightypork/gamecore/{render => resources}/textures/TextureBank.java (88%) rename src/mightypork/gamecore/{render => resources}/textures/TxQuad.java (93%) rename src/mightypork/gamecore/{render => resources}/textures/TxSheet.java (96%) rename src/mightypork/gamecore/{render => resources}/textures/WrapMode.java (83%) rename src/mightypork/{rogue => gamecore}/util/Utils.java (77%) rename src/mightypork/{util/annotations => gamecore/util/annot}/DefaultImpl.java (93%) rename src/mightypork/{util/annotations => gamecore/util/annot}/FactoryMethod.java (91%) rename src/mightypork/{ => gamecore}/util/error/CorruptedDataException.java (92%) rename src/mightypork/{ => gamecore}/util/error/IllegalValueException.java (93%) rename src/mightypork/{ => gamecore}/util/error/KeyAlreadyExistsException.java (90%) rename src/mightypork/{util/string/filtering => gamecore/util/files}/FileSuffixFilter.java (94%) rename src/mightypork/{ => gamecore}/util/files/FileTreeDiff.java (97%) rename src/mightypork/{ => gamecore}/util/files/FileUtils.java (97%) rename src/mightypork/{ => gamecore}/util/files/InstanceLock.java (96%) rename src/mightypork/{ => gamecore}/util/files/OsUtils.java (98%) rename src/mightypork/{ => gamecore}/util/files/config/PropertyManager.java (97%) rename src/mightypork/{ => gamecore}/util/files/config/SimpleConfig.java (97%) rename src/mightypork/{ => gamecore}/util/files/config/SortedProperties.java (99%) rename src/mightypork/{ => gamecore}/util/files/zip/ZipBuilder.java (95%) rename src/mightypork/{ => gamecore}/util/files/zip/ZipUtils.java (93%) rename src/mightypork/{util/files => gamecore/util}/ion/Ion.java (67%) rename src/mightypork/{util/files => gamecore/util}/ion/IonBundle.java (84%) rename src/mightypork/{util/files => gamecore/util}/ion/IonInput.java (98%) rename src/mightypork/{util/files => gamecore/util}/ion/IonMapWrapper.java (87%) rename src/mightypork/{util/files/ion/IonBinary.java => gamecore/util/ion/IonObjBinary.java} (69%) rename src/mightypork/{util/files/ion/IonBinaryHeadless.java => gamecore/util/ion/IonObjBlob.java} (87%) rename src/mightypork/{util/files/ion/IonBundled.java => gamecore/util/ion/IonObjBundled.java} (73%) rename src/mightypork/{util/files => gamecore/util}/ion/IonOutput.java (95%) rename src/mightypork/{util/files => gamecore/util}/ion/IonSequenceWrapper.java (88%) rename src/mightypork/{ => gamecore}/util/math/Calc.java (99%) rename src/mightypork/{ => gamecore}/util/math/Easing.java (98%) rename src/mightypork/{ => gamecore}/util/math/Polar.java (96%) rename src/mightypork/{ => gamecore}/util/math/Range.java (98%) rename src/mightypork/{rogue/world => gamecore/util/math/algo}/Coord.java (58%) create mode 100644 src/mightypork/gamecore/util/math/algo/Sides.java create mode 100644 src/mightypork/gamecore/util/math/algo/Step.java rename src/mightypork/{rogue/world/pathfinding => gamecore/util/math/algo/floodfill}/FillContext.java (67%) rename src/mightypork/{rogue/world/pathfinding => gamecore/util/math/algo/floodfill}/FloodFill.java (84%) rename src/mightypork/{rogue/world => gamecore/util/math/algo}/pathfinding/Heuristic.java (72%) rename src/mightypork/{rogue/world => gamecore/util/math/algo}/pathfinding/PathFinder.java (85%) rename src/mightypork/{rogue/world => gamecore/util/math/algo}/pathfinding/PathFindingContext.java (74%) create mode 100644 src/mightypork/gamecore/util/math/algo/pathfinding/PathFindingContextProxy.java rename src/mightypork/{rogue/world/pathfinding => gamecore/util/math/algo/pathfinding/heuristics}/DiagonalHeuristic.java (53%) rename src/mightypork/{rogue/world/pathfinding => gamecore/util/math/algo/pathfinding/heuristics}/ManhattanHeuristic.java (51%) rename src/mightypork/{ => gamecore}/util/math/color/Color.java (96%) rename src/mightypork/{ => gamecore}/util/math/color/ColorAlphaAdjuster.java (83%) rename src/mightypork/{ => gamecore}/util/math/color/ColorHsb.java (88%) rename src/mightypork/{ => gamecore}/util/math/color/ColorRgb.java (82%) rename src/mightypork/{util/math/color => gamecore/util/math/color/pal}/CGA.java (88%) rename src/mightypork/{util/math/color => gamecore/util/math/color/pal}/COMMODORE.java (88%) rename src/mightypork/{util/math/color => gamecore/util/math/color/pal}/PAL16.java (89%) rename src/mightypork/{util/math/color => gamecore/util/math/color/pal}/RGB.java (85%) rename src/mightypork/{util/math/color => gamecore/util/math/color/pal}/ZX.java (88%) rename src/mightypork/{ => gamecore}/util/math/constraints/ConstraintCache.java (92%) rename src/mightypork/{ => gamecore}/util/math/constraints/DigestCache.java (94%) rename src/mightypork/{ => gamecore}/util/math/constraints/Digestable.java (96%) rename src/mightypork/{ => gamecore}/util/math/constraints/Pollable.java (75%) rename src/mightypork/{ => gamecore}/util/math/constraints/Poller.java (91%) rename src/mightypork/{ => gamecore}/util/math/constraints/num/Num.java (93%) rename src/mightypork/{ => gamecore}/util/math/constraints/num/NumConst.java (96%) rename src/mightypork/{ => gamecore}/util/math/constraints/num/caching/AbstractNumCache.java (79%) rename src/mightypork/{ => gamecore}/util/math/constraints/num/caching/NumCache.java (67%) rename src/mightypork/{ => gamecore}/util/math/constraints/num/caching/NumDigest.java (64%) rename src/mightypork/{ => gamecore}/util/math/constraints/num/mutable/NumAnimated.java (96%) rename src/mightypork/{ => gamecore}/util/math/constraints/num/mutable/NumAnimatedDeg.java (79%) rename src/mightypork/{ => gamecore}/util/math/constraints/num/mutable/NumAnimatedRad.java (79%) rename src/mightypork/{ => gamecore}/util/math/constraints/num/mutable/NumMutable.java (77%) rename src/mightypork/{ => gamecore}/util/math/constraints/num/mutable/NumVar.java (76%) rename src/mightypork/{ => gamecore}/util/math/constraints/num/proxy/NumAdapter.java (58%) rename src/mightypork/{ => gamecore}/util/math/constraints/num/proxy/NumBound.java (54%) rename src/mightypork/{ => gamecore}/util/math/constraints/num/proxy/NumBoundAdapter.java (76%) rename src/mightypork/{ => gamecore}/util/math/constraints/num/proxy/NumProxy.java (63%) rename src/mightypork/{ => gamecore}/util/math/constraints/num/proxy/PluggableNumBound.java (76%) rename src/mightypork/{ => gamecore}/util/math/constraints/rect/Rect.java (94%) rename src/mightypork/{ => gamecore}/util/math/constraints/rect/RectConst.java (95%) rename src/mightypork/{ => gamecore}/util/math/constraints/rect/builders/TiledRect.java (88%) rename src/mightypork/{ => gamecore}/util/math/constraints/rect/caching/AbstractRectCache.java (76%) rename src/mightypork/{ => gamecore}/util/math/constraints/rect/caching/RectCache.java (67%) rename src/mightypork/{ => gamecore}/util/math/constraints/rect/caching/RectDigest.java (85%) rename src/mightypork/{ => gamecore}/util/math/constraints/rect/mutable/RectMutable.java (88%) rename src/mightypork/{ => gamecore}/util/math/constraints/rect/mutable/RectVar.java (77%) rename src/mightypork/{ => gamecore}/util/math/constraints/rect/proxy/PluggableRectBound.java (76%) rename src/mightypork/{ => gamecore}/util/math/constraints/rect/proxy/RectAdapter.java (77%) rename src/mightypork/{ => gamecore}/util/math/constraints/rect/proxy/RectBound.java (55%) rename src/mightypork/{ => gamecore}/util/math/constraints/rect/proxy/RectBoundAdapter.java (78%) rename src/mightypork/{ => gamecore}/util/math/constraints/rect/proxy/RectProxy.java (63%) rename src/mightypork/{ => gamecore}/util/math/constraints/rect/proxy/RectVectAdapter.java (68%) rename src/mightypork/{ => gamecore}/util/math/constraints/vect/Vect.java (94%) rename src/mightypork/{ => gamecore}/util/math/constraints/vect/VectConst.java (94%) rename src/mightypork/{ => gamecore}/util/math/constraints/vect/VectProxy.java (62%) rename src/mightypork/{ => gamecore}/util/math/constraints/vect/caching/AbstractVectCache.java (76%) rename src/mightypork/{ => gamecore}/util/math/constraints/vect/caching/VectCache.java (68%) rename src/mightypork/{ => gamecore}/util/math/constraints/vect/caching/VectDigest.java (71%) rename src/mightypork/{ => gamecore}/util/math/constraints/vect/mutable/VectAnimated.java (91%) rename src/mightypork/{ => gamecore}/util/math/constraints/vect/mutable/VectMutable.java (89%) rename src/mightypork/{ => gamecore}/util/math/constraints/vect/mutable/VectVar.java (93%) rename src/mightypork/{ => gamecore}/util/math/constraints/vect/proxy/PluggableVectBound.java (76%) rename src/mightypork/{ => gamecore}/util/math/constraints/vect/proxy/VectAdapter.java (79%) rename src/mightypork/{ => gamecore}/util/math/constraints/vect/proxy/VectBound.java (61%) rename src/mightypork/{ => gamecore}/util/math/constraints/vect/proxy/VectBoundAdapter.java (76%) rename src/mightypork/{ => gamecore}/util/math/constraints/vect/proxy/VectNumAdapter.java (73%) rename src/mightypork/{ => gamecore}/util/math/noise/NoiseGen.java (98%) rename src/mightypork/{ => gamecore}/util/math/noise/PerlinNoiseGenerator.java (99%) create mode 100644 src/mightypork/gamecore/util/math/timing/Animator.java rename src/mightypork/{util => gamecore/util/math}/timing/AnimatorBounce.java (81%) rename src/mightypork/{util => gamecore/util/math}/timing/AnimatorRewind.java (79%) rename src/mightypork/{util => gamecore/util/math}/timing/FpsMeter.java (93%) rename src/mightypork/{util => gamecore/util/math}/timing/Pauseable.java (85%) create mode 100644 src/mightypork/gamecore/util/math/timing/TaskRepeater.java rename src/mightypork/{util => gamecore/util/math}/timing/TimedTask.java (77%) rename src/mightypork/{util => gamecore/util/math}/timing/TimerDelta.java (93%) rename src/mightypork/{util => gamecore/util/math}/timing/TimerFps.java (97%) rename src/mightypork/{ => gamecore}/util/objects/Convert.java (95%) rename src/mightypork/{ => gamecore}/util/objects/MapSort.java (97%) rename src/mightypork/{ => gamecore}/util/objects/Mutable.java (96%) rename src/mightypork/{ => gamecore}/util/objects/ObjectUtils.java (90%) rename src/mightypork/{ => gamecore}/util/objects/Pair.java (91%) rename src/mightypork/{ => gamecore}/util/objects/Triad.java (92%) rename src/mightypork/{ => gamecore}/util/objects/VarargsParser.java (97%) create mode 100644 src/mightypork/gamecore/util/strings/StringProvider.java rename src/mightypork/{util/string => gamecore/util/strings}/StringUtils.java (98%) create mode 100644 src/mightypork/gamecore/util/strings/StringWrapper.java rename src/mightypork/{util/string => gamecore/util/strings}/filtering/CharFilter.java (57%) rename src/mightypork/{util/string/filtering/RegexCharFilter.java => gamecore/util/strings/filtering/CharFilterRegex.java} (55%) rename src/mightypork/{util/string/filtering/WhitelistCharFilter.java => gamecore/util/strings/filtering/CharFilterWhitelist.java} (54%) rename src/mightypork/{util/string => gamecore/util/strings}/filtering/StringFilter.java (61%) rename src/mightypork/rogue/{MainLoop.java => GameLoop.java} (86%) delete mode 100644 src/mightypork/rogue/world/Sides.java create mode 100644 src/mightypork/rogue/world/entity/AiTimer.java create mode 100644 src/mightypork/rogue/world/entity/EntityType.java delete mode 100644 src/mightypork/rogue/world/entity/PathStep.java create mode 100644 src/mightypork/rogue/world/entity/entities/MonsterAi.java create mode 100644 src/mightypork/rogue/world/entity/entities/SimpleMonster.java delete mode 100644 src/mightypork/util/string/StringProvider.java delete mode 100644 src/mightypork/util/timing/Animator.java diff --git a/src/mightypork/gamecore/control/AppAccess.java b/src/mightypork/gamecore/app/AppAccess.java similarity index 79% rename from src/mightypork/gamecore/control/AppAccess.java rename to src/mightypork/gamecore/app/AppAccess.java index 0511089..cb24f23 100644 --- a/src/mightypork/gamecore/control/AppAccess.java +++ b/src/mightypork/gamecore/app/AppAccess.java @@ -1,10 +1,10 @@ -package mightypork.gamecore.control; +package mightypork.gamecore.app; -import mightypork.gamecore.audio.SoundSystem; +import mightypork.gamecore.eventbus.BusAccess; import mightypork.gamecore.input.InputSystem; import mightypork.gamecore.render.DisplaySystem; -import mightypork.util.control.eventbus.BusAccess; +import mightypork.gamecore.resources.audio.SoundSystem; /** diff --git a/src/mightypork/gamecore/control/AppModule.java b/src/mightypork/gamecore/app/AppModule.java similarity index 85% rename from src/mightypork/gamecore/control/AppModule.java rename to src/mightypork/gamecore/app/AppModule.java index 002e64a..2da80c2 100644 --- a/src/mightypork/gamecore/control/AppModule.java +++ b/src/mightypork/gamecore/app/AppModule.java @@ -1,10 +1,10 @@ -package mightypork.gamecore.control; +package mightypork.gamecore.app; -import mightypork.gamecore.audio.SoundSystem; +import mightypork.gamecore.eventbus.clients.RootBusNode; import mightypork.gamecore.input.InputSystem; import mightypork.gamecore.render.DisplaySystem; -import mightypork.util.control.eventbus.clients.RootBusNode; +import mightypork.gamecore.resources.audio.SoundSystem; /** diff --git a/src/mightypork/gamecore/control/AppSubModule.java b/src/mightypork/gamecore/app/AppSubModule.java similarity index 75% rename from src/mightypork/gamecore/control/AppSubModule.java rename to src/mightypork/gamecore/app/AppSubModule.java index 634813a..c9d7558 100644 --- a/src/mightypork/gamecore/control/AppSubModule.java +++ b/src/mightypork/gamecore/app/AppSubModule.java @@ -1,12 +1,12 @@ -package mightypork.gamecore.control; +package mightypork.gamecore.app; -import mightypork.gamecore.audio.SoundSystem; +import mightypork.gamecore.eventbus.clients.BusNode; +import mightypork.gamecore.eventbus.clients.DelegatingClient; +import mightypork.gamecore.eventbus.clients.RootBusNode; import mightypork.gamecore.input.InputSystem; import mightypork.gamecore.render.DisplaySystem; -import mightypork.util.control.eventbus.clients.BusNode; -import mightypork.util.control.eventbus.clients.DelegatingClient; -import mightypork.util.control.eventbus.clients.RootBusNode; +import mightypork.gamecore.resources.audio.SoundSystem; /** diff --git a/src/mightypork/gamecore/control/BaseApp.java b/src/mightypork/gamecore/app/BaseApp.java similarity index 85% rename from src/mightypork/gamecore/control/BaseApp.java rename to src/mightypork/gamecore/app/BaseApp.java index 0f51d00..3060a40 100644 --- a/src/mightypork/gamecore/control/BaseApp.java +++ b/src/mightypork/gamecore/app/BaseApp.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.control; +package mightypork.gamecore.app; import java.io.File; @@ -7,16 +7,21 @@ import java.util.logging.Level; import javax.swing.JOptionPane; -import mightypork.gamecore.audio.SoundSystem; -import mightypork.gamecore.control.events.core.DestroyEvent; +import mightypork.gamecore.eventbus.EventBus; +import mightypork.gamecore.eventbus.events.DestroyEvent; +import mightypork.gamecore.gui.screens.CrossfadeOverlay; import mightypork.gamecore.gui.screens.ScreenRegistry; import mightypork.gamecore.input.InputSystem; +import mightypork.gamecore.logging.Log; +import mightypork.gamecore.logging.SlickLogRedirector; +import mightypork.gamecore.logging.writers.LogWriter; import mightypork.gamecore.render.DisplaySystem; -import mightypork.util.annotations.DefaultImpl; -import mightypork.util.control.eventbus.EventBus; -import mightypork.util.files.InstanceLock; -import mightypork.util.logging.Log; -import mightypork.util.logging.writers.LogWriter; +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.Step; /** @@ -32,7 +37,7 @@ public abstract class BaseApp implements AppAccess, UncaughtExceptionHandler { private DisplaySystem displaySystem; private SoundSystem soundSystem; private EventBus eventBus; - private GameLoop gameLoop; + private MainLoop gameLoop; private ScreenRegistry screenRegistry; @@ -77,6 +82,14 @@ public abstract class BaseApp implements AppAccess, UncaughtExceptionHandler { // only here it makes sense to log. Log.i("=== Commencing initialization sequence ==="); + + /* + * Ionizables + */ + Log.f3("initializing ION..."); + registerIonizables(); + + /* * Event bus */ @@ -112,7 +125,7 @@ public abstract class BaseApp implements AppAccess, UncaughtExceptionHandler { */ Log.f1("Creating Screen Registry and Game Loop..."); screenRegistry = new ScreenRegistry(this); - gameLoop = createLoop(); + gameLoop = createMainLoop(); gameLoop.setRootRenderable(screenRegistry); /* @@ -135,7 +148,14 @@ public abstract class BaseApp implements AppAccess, UncaughtExceptionHandler { Log.i("=== Initialized sequence completed ==="); } - + @DefaultImpl + protected void registerIonizables() + { + Ion.registerType(Coord.ION_MARK, Coord.class); + Ion.registerType(Step.ION_MARK, Step.class); + } + + /** * Called at the beginning of the initialization sequence, right after lock * was obtained. @@ -221,6 +241,7 @@ public abstract class BaseApp implements AppAccess, UncaughtExceptionHandler { @DefaultImpl protected void initScreens(ScreenRegistry screens) { + screens.addOverlay(new CrossfadeOverlay(this)); } @@ -229,7 +250,7 @@ public abstract class BaseApp implements AppAccess, UncaughtExceptionHandler { * * @return the game loop. */ - protected abstract GameLoop createLoop(); + protected abstract MainLoop createMainLoop(); /** diff --git a/src/mightypork/gamecore/control/AppAdapter.java b/src/mightypork/gamecore/app/LightAppModule.java similarity index 78% rename from src/mightypork/gamecore/control/AppAdapter.java rename to src/mightypork/gamecore/app/LightAppModule.java index 2b7f288..3c1eeac 100644 --- a/src/mightypork/gamecore/control/AppAdapter.java +++ b/src/mightypork/gamecore/app/LightAppModule.java @@ -1,10 +1,10 @@ -package mightypork.gamecore.control; +package mightypork.gamecore.app; -import mightypork.gamecore.audio.SoundSystem; +import mightypork.gamecore.eventbus.EventBus; import mightypork.gamecore.input.InputSystem; import mightypork.gamecore.render.DisplaySystem; -import mightypork.util.control.eventbus.EventBus; +import mightypork.gamecore.resources.audio.SoundSystem; /** @@ -12,7 +12,7 @@ import mightypork.util.control.eventbus.EventBus; * * @author MightyPork */ -public class AppAdapter implements AppAccess { +public class LightAppModule implements AppAccess { private final AppAccess app; @@ -20,7 +20,7 @@ public class AppAdapter implements AppAccess { /** * @param app app access */ - public AppAdapter(AppAccess app) + public LightAppModule(AppAccess app) { if (app == null) throw new NullPointerException("AppAccess instance cannot be null."); diff --git a/src/mightypork/gamecore/control/GameLoop.java b/src/mightypork/gamecore/app/MainLoop.java similarity index 81% rename from src/mightypork/gamecore/control/GameLoop.java rename to src/mightypork/gamecore/app/MainLoop.java index cd7d702..5df5902 100644 --- a/src/mightypork/gamecore/control/GameLoop.java +++ b/src/mightypork/gamecore/app/MainLoop.java @@ -1,15 +1,14 @@ -package mightypork.gamecore.control; +package mightypork.gamecore.app; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; -import mightypork.gamecore.control.events.core.UpdateEvent; -import mightypork.gamecore.control.events.requests.MainLoopRequestListener; +import mightypork.gamecore.eventbus.events.UpdateEvent; import mightypork.gamecore.gui.screens.ScreenRegistry; import mightypork.gamecore.render.Renderable; -import mightypork.util.annotations.DefaultImpl; -import mightypork.util.timing.TimerDelta; +import mightypork.gamecore.util.annot.DefaultImpl; +import mightypork.gamecore.util.math.timing.TimerDelta; /** @@ -17,7 +16,7 @@ import mightypork.util.timing.TimerDelta; * * @author MightyPork */ -public abstract class GameLoop extends AppModule implements MainLoopRequestListener { +public abstract class MainLoop extends AppModule implements MainLoopRequestListener { private final Queue taskQueue = new ConcurrentLinkedQueue<>(); private TimerDelta timer; @@ -28,7 +27,7 @@ public abstract class GameLoop extends AppModule implements MainLoopRequestListe /** * @param app {@link AppAccess} instance */ - public GameLoop(AppAccess app) + public MainLoop(AppAccess app) { super(app); } diff --git a/src/mightypork/gamecore/control/events/requests/MainLoopRequest.java b/src/mightypork/gamecore/app/MainLoopRequest.java similarity index 72% rename from src/mightypork/gamecore/control/events/requests/MainLoopRequest.java rename to src/mightypork/gamecore/app/MainLoopRequest.java index 760b9b3..e251325 100644 --- a/src/mightypork/gamecore/control/events/requests/MainLoopRequest.java +++ b/src/mightypork/gamecore/app/MainLoopRequest.java @@ -1,8 +1,8 @@ -package mightypork.gamecore.control.events.requests; +package mightypork.gamecore.app; -import mightypork.util.control.eventbus.BusEvent; -import mightypork.util.control.eventbus.event_flags.SingleReceiverEvent; +import mightypork.gamecore.eventbus.BusEvent; +import mightypork.gamecore.eventbus.event_flags.SingleReceiverEvent; /** diff --git a/src/mightypork/gamecore/control/events/requests/MainLoopRequestListener.java b/src/mightypork/gamecore/app/MainLoopRequestListener.java similarity index 80% rename from src/mightypork/gamecore/control/events/requests/MainLoopRequestListener.java rename to src/mightypork/gamecore/app/MainLoopRequestListener.java index fa9d66a..b6c4f01 100644 --- a/src/mightypork/gamecore/control/events/requests/MainLoopRequestListener.java +++ b/src/mightypork/gamecore/app/MainLoopRequestListener.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.control.events.requests; +package mightypork.gamecore.app; /** diff --git a/src/mightypork/util/control/eventbus/BufferedHashSet.java b/src/mightypork/gamecore/eventbus/BufferedHashSet.java similarity index 98% rename from src/mightypork/util/control/eventbus/BufferedHashSet.java rename to src/mightypork/gamecore/eventbus/BufferedHashSet.java index ef0d167..31fadc1 100644 --- a/src/mightypork/util/control/eventbus/BufferedHashSet.java +++ b/src/mightypork/gamecore/eventbus/BufferedHashSet.java @@ -1,4 +1,4 @@ -package mightypork.util.control.eventbus; +package mightypork.gamecore.eventbus; import java.util.Collection; diff --git a/src/mightypork/util/control/eventbus/BusAccess.java b/src/mightypork/gamecore/eventbus/BusAccess.java similarity index 80% rename from src/mightypork/util/control/eventbus/BusAccess.java rename to src/mightypork/gamecore/eventbus/BusAccess.java index e605e05..dbd2718 100644 --- a/src/mightypork/util/control/eventbus/BusAccess.java +++ b/src/mightypork/gamecore/eventbus/BusAccess.java @@ -1,4 +1,4 @@ -package mightypork.util.control.eventbus; +package mightypork.gamecore.eventbus; /** diff --git a/src/mightypork/util/control/eventbus/BusEvent.java b/src/mightypork/gamecore/eventbus/BusEvent.java similarity index 85% rename from src/mightypork/util/control/eventbus/BusEvent.java rename to src/mightypork/gamecore/eventbus/BusEvent.java index b9aa37e..8cab991 100644 --- a/src/mightypork/util/control/eventbus/BusEvent.java +++ b/src/mightypork/gamecore/eventbus/BusEvent.java @@ -1,11 +1,11 @@ -package mightypork.util.control.eventbus; +package mightypork.gamecore.eventbus; -import mightypork.util.control.eventbus.event_flags.DelayedEvent; -import mightypork.util.control.eventbus.event_flags.ImmediateEvent; -import mightypork.util.control.eventbus.event_flags.NonConsumableEvent; -import mightypork.util.control.eventbus.event_flags.SingleReceiverEvent; -import mightypork.util.control.eventbus.event_flags.UnloggedEvent; +import mightypork.gamecore.eventbus.event_flags.DelayedEvent; +import mightypork.gamecore.eventbus.event_flags.ImmediateEvent; +import mightypork.gamecore.eventbus.event_flags.NonConsumableEvent; +import mightypork.gamecore.eventbus.event_flags.SingleReceiverEvent; +import mightypork.gamecore.eventbus.event_flags.UnloggedEvent; /** diff --git a/src/mightypork/util/control/eventbus/EventBus.java b/src/mightypork/gamecore/eventbus/EventBus.java similarity index 95% rename from src/mightypork/util/control/eventbus/EventBus.java rename to src/mightypork/gamecore/eventbus/EventBus.java index c6ce22a..ae95174 100644 --- a/src/mightypork/util/control/eventbus/EventBus.java +++ b/src/mightypork/gamecore/eventbus/EventBus.java @@ -1,4 +1,4 @@ -package mightypork.util.control.eventbus; +package mightypork.gamecore.eventbus; import java.lang.reflect.ParameterizedType; @@ -8,12 +8,12 @@ import java.util.concurrent.DelayQueue; import java.util.concurrent.Delayed; import java.util.concurrent.TimeUnit; -import mightypork.util.control.Destroyable; -import mightypork.util.control.eventbus.clients.DelegatingClient; -import mightypork.util.control.eventbus.event_flags.DelayedEvent; -import mightypork.util.control.eventbus.event_flags.ImmediateEvent; -import mightypork.util.control.eventbus.event_flags.UnloggedEvent; -import mightypork.util.logging.Log; +import mightypork.gamecore.eventbus.clients.DelegatingClient; +import mightypork.gamecore.eventbus.event_flags.DelayedEvent; +import mightypork.gamecore.eventbus.event_flags.ImmediateEvent; +import mightypork.gamecore.eventbus.event_flags.UnloggedEvent; +import mightypork.gamecore.eventbus.events.Destroyable; +import mightypork.gamecore.logging.Log; /** diff --git a/src/mightypork/util/control/eventbus/EventChannel.java b/src/mightypork/gamecore/eventbus/EventChannel.java similarity index 95% rename from src/mightypork/util/control/eventbus/EventChannel.java rename to src/mightypork/gamecore/eventbus/EventChannel.java index e24d96d..e9ea588 100644 --- a/src/mightypork/util/control/eventbus/EventChannel.java +++ b/src/mightypork/gamecore/eventbus/EventChannel.java @@ -1,12 +1,12 @@ -package mightypork.util.control.eventbus; +package mightypork.gamecore.eventbus; import java.util.Collection; import java.util.HashSet; -import mightypork.util.control.eventbus.clients.DelegatingClient; -import mightypork.util.control.eventbus.clients.ToggleableClient; -import mightypork.util.logging.Log; +import mightypork.gamecore.eventbus.clients.DelegatingClient; +import mightypork.gamecore.eventbus.clients.ToggleableClient; +import mightypork.gamecore.logging.Log; /** diff --git a/src/mightypork/util/control/eventbus/clients/BusNode.java b/src/mightypork/gamecore/eventbus/clients/BusNode.java similarity index 92% rename from src/mightypork/util/control/eventbus/clients/BusNode.java rename to src/mightypork/gamecore/eventbus/clients/BusNode.java index 51d6d52..063323c 100644 --- a/src/mightypork/util/control/eventbus/clients/BusNode.java +++ b/src/mightypork/gamecore/eventbus/clients/BusNode.java @@ -1,12 +1,12 @@ -package mightypork.util.control.eventbus.clients; +package mightypork.gamecore.eventbus.clients; import java.util.Collection; import java.util.LinkedHashSet; import java.util.Set; -import mightypork.util.control.eventbus.BusAccess; -import mightypork.util.control.eventbus.EventBus; +import mightypork.gamecore.eventbus.BusAccess; +import mightypork.gamecore.eventbus.EventBus; /** diff --git a/src/mightypork/util/control/eventbus/clients/ClientHub.java b/src/mightypork/gamecore/eventbus/clients/ClientHub.java similarity index 86% rename from src/mightypork/util/control/eventbus/clients/ClientHub.java rename to src/mightypork/gamecore/eventbus/clients/ClientHub.java index 59fe902..279770b 100644 --- a/src/mightypork/util/control/eventbus/clients/ClientHub.java +++ b/src/mightypork/gamecore/eventbus/clients/ClientHub.java @@ -1,9 +1,9 @@ -package mightypork.util.control.eventbus.clients; +package mightypork.gamecore.eventbus.clients; import java.util.Collection; -import mightypork.util.control.eventbus.EventBus; +import mightypork.gamecore.eventbus.EventBus; /** diff --git a/src/mightypork/util/control/eventbus/clients/DelegatingClient.java b/src/mightypork/gamecore/eventbus/clients/DelegatingClient.java similarity index 91% rename from src/mightypork/util/control/eventbus/clients/DelegatingClient.java rename to src/mightypork/gamecore/eventbus/clients/DelegatingClient.java index 63c665f..76fe5ab 100644 --- a/src/mightypork/util/control/eventbus/clients/DelegatingClient.java +++ b/src/mightypork/gamecore/eventbus/clients/DelegatingClient.java @@ -1,4 +1,4 @@ -package mightypork.util.control.eventbus.clients; +package mightypork.gamecore.eventbus.clients; import java.util.Collection; diff --git a/src/mightypork/util/control/eventbus/clients/RootBusNode.java b/src/mightypork/gamecore/eventbus/clients/RootBusNode.java similarity index 78% rename from src/mightypork/util/control/eventbus/clients/RootBusNode.java rename to src/mightypork/gamecore/eventbus/clients/RootBusNode.java index 67ab46f..c598037 100644 --- a/src/mightypork/util/control/eventbus/clients/RootBusNode.java +++ b/src/mightypork/gamecore/eventbus/clients/RootBusNode.java @@ -1,8 +1,8 @@ -package mightypork.util.control.eventbus.clients; +package mightypork.gamecore.eventbus.clients; -import mightypork.util.control.Destroyable; -import mightypork.util.control.eventbus.BusAccess; +import mightypork.gamecore.eventbus.BusAccess; +import mightypork.gamecore.eventbus.events.Destroyable; /** diff --git a/src/mightypork/util/control/eventbus/clients/ToggleableClient.java b/src/mightypork/gamecore/eventbus/clients/ToggleableClient.java similarity index 81% rename from src/mightypork/util/control/eventbus/clients/ToggleableClient.java rename to src/mightypork/gamecore/eventbus/clients/ToggleableClient.java index 1ef61ec..3bc6286 100644 --- a/src/mightypork/util/control/eventbus/clients/ToggleableClient.java +++ b/src/mightypork/gamecore/eventbus/clients/ToggleableClient.java @@ -1,4 +1,4 @@ -package mightypork.util.control.eventbus.clients; +package mightypork.gamecore.eventbus.clients; /** diff --git a/src/mightypork/util/control/eventbus/event_flags/DelayedEvent.java b/src/mightypork/gamecore/eventbus/event_flags/DelayedEvent.java similarity index 86% rename from src/mightypork/util/control/eventbus/event_flags/DelayedEvent.java rename to src/mightypork/gamecore/eventbus/event_flags/DelayedEvent.java index 36fd340..7644645 100644 --- a/src/mightypork/util/control/eventbus/event_flags/DelayedEvent.java +++ b/src/mightypork/gamecore/eventbus/event_flags/DelayedEvent.java @@ -1,4 +1,4 @@ -package mightypork.util.control.eventbus.event_flags; +package mightypork.gamecore.eventbus.event_flags; import java.lang.annotation.*; diff --git a/src/mightypork/util/control/eventbus/event_flags/ImmediateEvent.java b/src/mightypork/gamecore/eventbus/event_flags/ImmediateEvent.java similarity index 80% rename from src/mightypork/util/control/eventbus/event_flags/ImmediateEvent.java rename to src/mightypork/gamecore/eventbus/event_flags/ImmediateEvent.java index 9884bae..5564b7c 100644 --- a/src/mightypork/util/control/eventbus/event_flags/ImmediateEvent.java +++ b/src/mightypork/gamecore/eventbus/event_flags/ImmediateEvent.java @@ -1,4 +1,4 @@ -package mightypork.util.control.eventbus.event_flags; +package mightypork.gamecore.eventbus.event_flags; import java.lang.annotation.*; diff --git a/src/mightypork/util/control/eventbus/event_flags/NonConsumableEvent.java b/src/mightypork/gamecore/eventbus/event_flags/NonConsumableEvent.java similarity index 87% rename from src/mightypork/util/control/eventbus/event_flags/NonConsumableEvent.java rename to src/mightypork/gamecore/eventbus/event_flags/NonConsumableEvent.java index 987e86b..adc2888 100644 --- a/src/mightypork/util/control/eventbus/event_flags/NonConsumableEvent.java +++ b/src/mightypork/gamecore/eventbus/event_flags/NonConsumableEvent.java @@ -1,4 +1,4 @@ -package mightypork.util.control.eventbus.event_flags; +package mightypork.gamecore.eventbus.event_flags; import java.lang.annotation.Documented; diff --git a/src/mightypork/util/control/eventbus/event_flags/SingleReceiverEvent.java b/src/mightypork/gamecore/eventbus/event_flags/SingleReceiverEvent.java similarity index 82% rename from src/mightypork/util/control/eventbus/event_flags/SingleReceiverEvent.java rename to src/mightypork/gamecore/eventbus/event_flags/SingleReceiverEvent.java index cd7fa43..ba5a289 100644 --- a/src/mightypork/util/control/eventbus/event_flags/SingleReceiverEvent.java +++ b/src/mightypork/gamecore/eventbus/event_flags/SingleReceiverEvent.java @@ -1,4 +1,4 @@ -package mightypork.util.control.eventbus.event_flags; +package mightypork.gamecore.eventbus.event_flags; import java.lang.annotation.*; diff --git a/src/mightypork/util/control/eventbus/event_flags/UnloggedEvent.java b/src/mightypork/gamecore/eventbus/event_flags/UnloggedEvent.java similarity index 85% rename from src/mightypork/util/control/eventbus/event_flags/UnloggedEvent.java rename to src/mightypork/gamecore/eventbus/event_flags/UnloggedEvent.java index b07deaa..dd4d78b 100644 --- a/src/mightypork/util/control/eventbus/event_flags/UnloggedEvent.java +++ b/src/mightypork/gamecore/eventbus/event_flags/UnloggedEvent.java @@ -1,4 +1,4 @@ -package mightypork.util.control.eventbus.event_flags; +package mightypork.gamecore.eventbus.event_flags; import java.lang.annotation.*; diff --git a/src/mightypork/gamecore/control/events/core/DestroyEvent.java b/src/mightypork/gamecore/eventbus/events/DestroyEvent.java similarity index 51% rename from src/mightypork/gamecore/control/events/core/DestroyEvent.java rename to src/mightypork/gamecore/eventbus/events/DestroyEvent.java index cb9e1e1..7e6e206 100644 --- a/src/mightypork/gamecore/control/events/core/DestroyEvent.java +++ b/src/mightypork/gamecore/eventbus/events/DestroyEvent.java @@ -1,10 +1,9 @@ -package mightypork.gamecore.control.events.core; +package mightypork.gamecore.eventbus.events; -import mightypork.util.control.Destroyable; -import mightypork.util.control.eventbus.BusEvent; -import mightypork.util.control.eventbus.event_flags.ImmediateEvent; -import mightypork.util.control.eventbus.event_flags.NonConsumableEvent; +import mightypork.gamecore.eventbus.BusEvent; +import mightypork.gamecore.eventbus.event_flags.ImmediateEvent; +import mightypork.gamecore.eventbus.event_flags.NonConsumableEvent; /** diff --git a/src/mightypork/util/control/Destroyable.java b/src/mightypork/gamecore/eventbus/events/Destroyable.java similarity index 80% rename from src/mightypork/util/control/Destroyable.java rename to src/mightypork/gamecore/eventbus/events/Destroyable.java index cb085ab..01c5a4a 100644 --- a/src/mightypork/util/control/Destroyable.java +++ b/src/mightypork/gamecore/eventbus/events/Destroyable.java @@ -1,4 +1,4 @@ -package mightypork.util.control; +package mightypork.gamecore.eventbus.events; /** diff --git a/src/mightypork/gamecore/control/events/core/UpdateEvent.java b/src/mightypork/gamecore/eventbus/events/UpdateEvent.java similarity index 57% rename from src/mightypork/gamecore/control/events/core/UpdateEvent.java rename to src/mightypork/gamecore/eventbus/events/UpdateEvent.java index 56a0ffe..e4b9f40 100644 --- a/src/mightypork/gamecore/control/events/core/UpdateEvent.java +++ b/src/mightypork/gamecore/eventbus/events/UpdateEvent.java @@ -1,11 +1,10 @@ -package mightypork.gamecore.control.events.core; +package mightypork.gamecore.eventbus.events; -import mightypork.util.control.eventbus.BusEvent; -import mightypork.util.control.eventbus.event_flags.ImmediateEvent; -import mightypork.util.control.eventbus.event_flags.NonConsumableEvent; -import mightypork.util.control.eventbus.event_flags.UnloggedEvent; -import mightypork.util.timing.Updateable; +import mightypork.gamecore.eventbus.BusEvent; +import mightypork.gamecore.eventbus.event_flags.ImmediateEvent; +import mightypork.gamecore.eventbus.event_flags.NonConsumableEvent; +import mightypork.gamecore.eventbus.event_flags.UnloggedEvent; /** diff --git a/src/mightypork/util/timing/Updateable.java b/src/mightypork/gamecore/eventbus/events/Updateable.java similarity index 84% rename from src/mightypork/util/timing/Updateable.java rename to src/mightypork/gamecore/eventbus/events/Updateable.java index 17337a5..e6050a2 100644 --- a/src/mightypork/util/timing/Updateable.java +++ b/src/mightypork/gamecore/eventbus/events/Updateable.java @@ -1,4 +1,4 @@ -package mightypork.util.timing; +package mightypork.gamecore.eventbus.events; /** diff --git a/src/mightypork/util/control/Action.java b/src/mightypork/gamecore/gui/Action.java similarity index 94% rename from src/mightypork/util/control/Action.java rename to src/mightypork/gamecore/gui/Action.java index 780b491..0c8952a 100644 --- a/src/mightypork/util/control/Action.java +++ b/src/mightypork/gamecore/gui/Action.java @@ -1,4 +1,5 @@ -package mightypork.util.control; +package mightypork.gamecore.gui; + /** diff --git a/src/mightypork/util/control/ActionTrigger.java b/src/mightypork/gamecore/gui/ActionTrigger.java similarity index 87% rename from src/mightypork/util/control/ActionTrigger.java rename to src/mightypork/gamecore/gui/ActionTrigger.java index d86c90b..4a6ff27 100644 --- a/src/mightypork/util/control/ActionTrigger.java +++ b/src/mightypork/gamecore/gui/ActionTrigger.java @@ -1,4 +1,4 @@ -package mightypork.util.control; +package mightypork.gamecore.gui; /** diff --git a/src/mightypork/util/control/Enableable.java b/src/mightypork/gamecore/gui/Enableable.java similarity index 91% rename from src/mightypork/util/control/Enableable.java rename to src/mightypork/gamecore/gui/Enableable.java index 42eaddd..66bb7a4 100644 --- a/src/mightypork/util/control/Enableable.java +++ b/src/mightypork/gamecore/gui/Enableable.java @@ -1,4 +1,4 @@ -package mightypork.util.control; +package mightypork.gamecore.gui; /** diff --git a/src/mightypork/gamecore/gui/components/ClickableComponent.java b/src/mightypork/gamecore/gui/components/ClickableComponent.java index 3cdd747..2691d5f 100644 --- a/src/mightypork/gamecore/gui/components/ClickableComponent.java +++ b/src/mightypork/gamecore/gui/components/ClickableComponent.java @@ -1,10 +1,10 @@ package mightypork.gamecore.gui.components; -import mightypork.gamecore.control.events.input.MouseButtonEvent; -import mightypork.gamecore.control.events.input.MouseButtonListener; -import mightypork.util.control.Action; -import mightypork.util.control.ActionTrigger; +import mightypork.gamecore.gui.Action; +import mightypork.gamecore.gui.ActionTrigger; +import mightypork.gamecore.input.events.MouseButtonEvent; +import mightypork.gamecore.input.events.MouseButtonListener; public abstract class ClickableComponent extends InputComponent implements ActionTrigger, MouseButtonListener { diff --git a/src/mightypork/gamecore/gui/components/Component.java b/src/mightypork/gamecore/gui/components/Component.java index 3e1629f..b101316 100644 --- a/src/mightypork/gamecore/gui/components/Component.java +++ b/src/mightypork/gamecore/gui/components/Component.java @@ -2,8 +2,8 @@ package mightypork.gamecore.gui.components; import mightypork.gamecore.gui.Hideable; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.rect.proxy.RectBound; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; /** diff --git a/src/mightypork/gamecore/gui/components/InputComponent.java b/src/mightypork/gamecore/gui/components/InputComponent.java index 78c6142..b1f6ea9 100644 --- a/src/mightypork/gamecore/gui/components/InputComponent.java +++ b/src/mightypork/gamecore/gui/components/InputComponent.java @@ -1,8 +1,8 @@ package mightypork.gamecore.gui.components; -import mightypork.util.control.Enableable; -import mightypork.util.control.eventbus.clients.ToggleableClient; +import mightypork.gamecore.eventbus.clients.ToggleableClient; +import mightypork.gamecore.gui.Enableable; public abstract class InputComponent extends VisualComponent implements Enableable, ToggleableClient { diff --git a/src/mightypork/gamecore/gui/components/LayoutComponent.java b/src/mightypork/gamecore/gui/components/LayoutComponent.java index 990a664..bcec65a 100644 --- a/src/mightypork/gamecore/gui/components/LayoutComponent.java +++ b/src/mightypork/gamecore/gui/components/LayoutComponent.java @@ -4,15 +4,15 @@ package mightypork.gamecore.gui.components; import java.util.Collection; import java.util.LinkedList; -import mightypork.gamecore.audio.SoundSystem; -import mightypork.gamecore.control.AppAccess; -import mightypork.gamecore.control.AppSubModule; +import mightypork.gamecore.app.AppAccess; +import mightypork.gamecore.app.AppSubModule; +import mightypork.gamecore.eventbus.EventBus; +import mightypork.gamecore.eventbus.clients.ClientHub; +import mightypork.gamecore.gui.Enableable; import mightypork.gamecore.input.InputSystem; import mightypork.gamecore.render.DisplaySystem; -import mightypork.util.control.Enableable; -import mightypork.util.control.eventbus.EventBus; -import mightypork.util.control.eventbus.clients.ClientHub; -import mightypork.util.math.constraints.rect.proxy.RectBound; +import mightypork.gamecore.resources.audio.SoundSystem; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; public abstract class LayoutComponent extends VisualComponent implements Enableable, ClientHub, AppAccess { diff --git a/src/mightypork/gamecore/gui/components/PluggableRenderable.java b/src/mightypork/gamecore/gui/components/PluggableRenderable.java index 042042d..cad978a 100644 --- a/src/mightypork/gamecore/gui/components/PluggableRenderable.java +++ b/src/mightypork/gamecore/gui/components/PluggableRenderable.java @@ -2,9 +2,9 @@ package mightypork.gamecore.gui.components; import mightypork.gamecore.render.Renderable; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.rect.proxy.PluggableRectBound; -import mightypork.util.math.constraints.rect.proxy.RectBound; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.proxy.PluggableRectBound; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; /** diff --git a/src/mightypork/gamecore/gui/components/VisualComponent.java b/src/mightypork/gamecore/gui/components/VisualComponent.java index 62cfd5e..c46b071 100644 --- a/src/mightypork/gamecore/gui/components/VisualComponent.java +++ b/src/mightypork/gamecore/gui/components/VisualComponent.java @@ -1,15 +1,15 @@ package mightypork.gamecore.gui.components; -import mightypork.gamecore.control.events.gui.LayoutChangeEvent; -import mightypork.gamecore.control.events.gui.LayoutChangeListener; +import mightypork.gamecore.gui.events.LayoutChangeEvent; +import mightypork.gamecore.gui.events.LayoutChangeListener; import mightypork.gamecore.input.InputSystem; import mightypork.gamecore.render.Renderable; -import mightypork.util.annotations.DefaultImpl; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.rect.caching.AbstractRectCache; -import mightypork.util.math.constraints.rect.proxy.RectBound; -import mightypork.util.math.constraints.rect.proxy.RectBoundAdapter; +import mightypork.gamecore.util.annot.DefaultImpl; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.caching.AbstractRectCache; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBoundAdapter; /** diff --git a/src/mightypork/gamecore/gui/components/layout/ColumnHolder.java b/src/mightypork/gamecore/gui/components/layout/ColumnHolder.java index ea0bebc..b6240d0 100644 --- a/src/mightypork/gamecore/gui/components/layout/ColumnHolder.java +++ b/src/mightypork/gamecore/gui/components/layout/ColumnHolder.java @@ -1,11 +1,11 @@ package mightypork.gamecore.gui.components.layout; -import mightypork.gamecore.control.AppAccess; +import mightypork.gamecore.app.AppAccess; import mightypork.gamecore.gui.components.Component; import mightypork.gamecore.gui.components.LayoutComponent; -import mightypork.util.math.constraints.rect.builders.TiledRect; -import mightypork.util.math.constraints.rect.proxy.RectBound; +import mightypork.gamecore.util.math.constraints.rect.builders.TiledRect; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; /** diff --git a/src/mightypork/gamecore/gui/components/layout/ConstraintLayout.java b/src/mightypork/gamecore/gui/components/layout/ConstraintLayout.java index 5059f5b..4ad6557 100644 --- a/src/mightypork/gamecore/gui/components/layout/ConstraintLayout.java +++ b/src/mightypork/gamecore/gui/components/layout/ConstraintLayout.java @@ -1,10 +1,10 @@ package mightypork.gamecore.gui.components.layout; -import mightypork.gamecore.control.AppAccess; +import mightypork.gamecore.app.AppAccess; import mightypork.gamecore.gui.components.Component; import mightypork.gamecore.gui.components.LayoutComponent; -import mightypork.util.math.constraints.rect.proxy.RectBound; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; /** diff --git a/src/mightypork/gamecore/gui/components/layout/GridLayout.java b/src/mightypork/gamecore/gui/components/layout/GridLayout.java index f154be4..db21534 100644 --- a/src/mightypork/gamecore/gui/components/layout/GridLayout.java +++ b/src/mightypork/gamecore/gui/components/layout/GridLayout.java @@ -1,11 +1,11 @@ package mightypork.gamecore.gui.components.layout; -import mightypork.gamecore.control.AppAccess; +import mightypork.gamecore.app.AppAccess; import mightypork.gamecore.gui.components.Component; import mightypork.gamecore.gui.components.LayoutComponent; -import mightypork.util.math.constraints.rect.builders.TiledRect; -import mightypork.util.math.constraints.rect.proxy.RectBound; +import mightypork.gamecore.util.math.constraints.rect.builders.TiledRect; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; /** diff --git a/src/mightypork/gamecore/gui/components/layout/HorizontalFixedFlowLayout.java b/src/mightypork/gamecore/gui/components/layout/HorizontalFixedFlowLayout.java index 6b59293..79f903e 100644 --- a/src/mightypork/gamecore/gui/components/layout/HorizontalFixedFlowLayout.java +++ b/src/mightypork/gamecore/gui/components/layout/HorizontalFixedFlowLayout.java @@ -1,13 +1,13 @@ package mightypork.gamecore.gui.components.layout; -import mightypork.gamecore.control.AppAccess; +import mightypork.gamecore.app.AppAccess; import mightypork.gamecore.gui.AlignX; import mightypork.gamecore.gui.components.Component; import mightypork.gamecore.gui.components.LayoutComponent; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.rect.proxy.RectBound; +import mightypork.gamecore.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; /** diff --git a/src/mightypork/gamecore/gui/components/layout/RowHolder.java b/src/mightypork/gamecore/gui/components/layout/RowHolder.java index c4d60fa..2184656 100644 --- a/src/mightypork/gamecore/gui/components/layout/RowHolder.java +++ b/src/mightypork/gamecore/gui/components/layout/RowHolder.java @@ -1,11 +1,11 @@ package mightypork.gamecore.gui.components.layout; -import mightypork.gamecore.control.AppAccess; +import mightypork.gamecore.app.AppAccess; import mightypork.gamecore.gui.components.Component; import mightypork.gamecore.gui.components.LayoutComponent; -import mightypork.util.math.constraints.rect.builders.TiledRect; -import mightypork.util.math.constraints.rect.proxy.RectBound; +import mightypork.gamecore.util.math.constraints.rect.builders.TiledRect; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; /** diff --git a/src/mightypork/gamecore/gui/components/layout/VerticalFixedFlowLayout.java b/src/mightypork/gamecore/gui/components/layout/VerticalFixedFlowLayout.java index a875acf..4feb5df 100644 --- a/src/mightypork/gamecore/gui/components/layout/VerticalFixedFlowLayout.java +++ b/src/mightypork/gamecore/gui/components/layout/VerticalFixedFlowLayout.java @@ -1,13 +1,13 @@ package mightypork.gamecore.gui.components.layout; -import mightypork.gamecore.control.AppAccess; +import mightypork.gamecore.app.AppAccess; import mightypork.gamecore.gui.AlignY; import mightypork.gamecore.gui.components.Component; import mightypork.gamecore.gui.components.LayoutComponent; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.rect.proxy.RectBound; +import mightypork.gamecore.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; /** diff --git a/src/mightypork/gamecore/gui/components/painters/ImagePainter.java b/src/mightypork/gamecore/gui/components/painters/ImagePainter.java index 9de3150..9694810 100644 --- a/src/mightypork/gamecore/gui/components/painters/ImagePainter.java +++ b/src/mightypork/gamecore/gui/components/painters/ImagePainter.java @@ -3,7 +3,7 @@ package mightypork.gamecore.gui.components.painters; import mightypork.gamecore.gui.components.VisualComponent; import mightypork.gamecore.render.Render; -import mightypork.gamecore.render.textures.TxQuad; +import mightypork.gamecore.resources.textures.TxQuad; /** diff --git a/src/mightypork/gamecore/gui/components/painters/QuadPainter.java b/src/mightypork/gamecore/gui/components/painters/QuadPainter.java index 94d78e9..0bceed9 100644 --- a/src/mightypork/gamecore/gui/components/painters/QuadPainter.java +++ b/src/mightypork/gamecore/gui/components/painters/QuadPainter.java @@ -3,8 +3,8 @@ package mightypork.gamecore.gui.components.painters; import mightypork.gamecore.gui.components.VisualComponent; import mightypork.gamecore.render.Render; -import mightypork.util.annotations.FactoryMethod; -import mightypork.util.math.color.Color; +import mightypork.gamecore.util.annot.FactoryMethod; +import mightypork.gamecore.util.math.color.Color; /** diff --git a/src/mightypork/gamecore/gui/components/painters/TextPainter.java b/src/mightypork/gamecore/gui/components/painters/TextPainter.java index 1b4098f..ed4097e 100644 --- a/src/mightypork/gamecore/gui/components/painters/TextPainter.java +++ b/src/mightypork/gamecore/gui/components/painters/TextPainter.java @@ -3,13 +3,13 @@ package mightypork.gamecore.gui.components.painters; import mightypork.gamecore.gui.AlignX; import mightypork.gamecore.gui.components.VisualComponent; -import mightypork.gamecore.render.fonts.FontRenderer; -import mightypork.gamecore.render.fonts.GLFont; -import mightypork.util.math.color.Color; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.string.StringProvider; -import mightypork.util.string.StringProvider.StringWrapper; +import mightypork.gamecore.resources.fonts.FontRenderer; +import mightypork.gamecore.resources.fonts.GLFont; +import mightypork.gamecore.util.math.color.Color; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.strings.StringProvider; +import mightypork.gamecore.util.strings.StringWrapper; /** diff --git a/src/mightypork/gamecore/control/events/gui/LayoutChangeEvent.java b/src/mightypork/gamecore/gui/events/LayoutChangeEvent.java similarity index 62% rename from src/mightypork/gamecore/control/events/gui/LayoutChangeEvent.java rename to src/mightypork/gamecore/gui/events/LayoutChangeEvent.java index 999004e..cfc9c6d 100644 --- a/src/mightypork/gamecore/control/events/gui/LayoutChangeEvent.java +++ b/src/mightypork/gamecore/gui/events/LayoutChangeEvent.java @@ -1,9 +1,9 @@ -package mightypork.gamecore.control.events.gui; +package mightypork.gamecore.gui.events; -import mightypork.util.control.eventbus.BusEvent; -import mightypork.util.control.eventbus.event_flags.ImmediateEvent; -import mightypork.util.control.eventbus.event_flags.NonConsumableEvent; +import mightypork.gamecore.eventbus.BusEvent; +import mightypork.gamecore.eventbus.event_flags.ImmediateEvent; +import mightypork.gamecore.eventbus.event_flags.NonConsumableEvent; /** diff --git a/src/mightypork/gamecore/control/events/gui/LayoutChangeListener.java b/src/mightypork/gamecore/gui/events/LayoutChangeListener.java similarity index 61% rename from src/mightypork/gamecore/control/events/gui/LayoutChangeListener.java rename to src/mightypork/gamecore/gui/events/LayoutChangeListener.java index b4bc3be..4daedee 100644 --- a/src/mightypork/gamecore/control/events/gui/LayoutChangeListener.java +++ b/src/mightypork/gamecore/gui/events/LayoutChangeListener.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.control.events.gui; +package mightypork.gamecore.gui.events; public interface LayoutChangeListener { diff --git a/src/mightypork/gamecore/control/events/requests/ScreenRequestEvent.java b/src/mightypork/gamecore/gui/events/ScreenRequestEvent.java similarity index 70% rename from src/mightypork/gamecore/control/events/requests/ScreenRequestEvent.java rename to src/mightypork/gamecore/gui/events/ScreenRequestEvent.java index bf93c89..ca07b56 100644 --- a/src/mightypork/gamecore/control/events/requests/ScreenRequestEvent.java +++ b/src/mightypork/gamecore/gui/events/ScreenRequestEvent.java @@ -1,8 +1,8 @@ -package mightypork.gamecore.control.events.requests; +package mightypork.gamecore.gui.events; -import mightypork.util.control.eventbus.BusEvent; -import mightypork.util.control.eventbus.event_flags.SingleReceiverEvent; +import mightypork.gamecore.eventbus.BusEvent; +import mightypork.gamecore.eventbus.event_flags.SingleReceiverEvent; /** diff --git a/src/mightypork/gamecore/control/events/requests/ScreenRequestListener.java b/src/mightypork/gamecore/gui/events/ScreenRequestListener.java similarity index 78% rename from src/mightypork/gamecore/control/events/requests/ScreenRequestListener.java rename to src/mightypork/gamecore/gui/events/ScreenRequestListener.java index ef9648b..3a45961 100644 --- a/src/mightypork/gamecore/control/events/requests/ScreenRequestListener.java +++ b/src/mightypork/gamecore/gui/events/ScreenRequestListener.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.control.events.requests; +package mightypork.gamecore.gui.events; /** diff --git a/src/mightypork/gamecore/control/events/gui/ViewportChangeEvent.java b/src/mightypork/gamecore/gui/events/ViewportChangeEvent.java similarity index 82% rename from src/mightypork/gamecore/control/events/gui/ViewportChangeEvent.java rename to src/mightypork/gamecore/gui/events/ViewportChangeEvent.java index 4d5ab77..993cd0d 100644 --- a/src/mightypork/gamecore/control/events/gui/ViewportChangeEvent.java +++ b/src/mightypork/gamecore/gui/events/ViewportChangeEvent.java @@ -1,9 +1,9 @@ -package mightypork.gamecore.control.events.gui; +package mightypork.gamecore.gui.events; -import mightypork.util.control.eventbus.BusEvent; -import mightypork.util.control.eventbus.event_flags.NonConsumableEvent; -import mightypork.util.math.constraints.vect.Vect; +import mightypork.gamecore.eventbus.BusEvent; +import mightypork.gamecore.eventbus.event_flags.NonConsumableEvent; +import mightypork.gamecore.util.math.constraints.vect.Vect; /** diff --git a/src/mightypork/gamecore/control/events/gui/ViewportChangeListener.java b/src/mightypork/gamecore/gui/events/ViewportChangeListener.java similarity index 82% rename from src/mightypork/gamecore/control/events/gui/ViewportChangeListener.java rename to src/mightypork/gamecore/gui/events/ViewportChangeListener.java index 4bf8cfa..0d92427 100644 --- a/src/mightypork/gamecore/control/events/gui/ViewportChangeListener.java +++ b/src/mightypork/gamecore/gui/events/ViewportChangeListener.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.control.events.gui; +package mightypork.gamecore.gui.events; /** diff --git a/src/mightypork/gamecore/gui/screens/BaseScreen.java b/src/mightypork/gamecore/gui/screens/BaseScreen.java index 6992b32..f1d352d 100644 --- a/src/mightypork/gamecore/gui/screens/BaseScreen.java +++ b/src/mightypork/gamecore/gui/screens/BaseScreen.java @@ -1,16 +1,16 @@ package mightypork.gamecore.gui.screens; -import mightypork.gamecore.control.AppAccess; -import mightypork.gamecore.control.AppSubModule; -import mightypork.gamecore.control.events.gui.LayoutChangeEvent; -import mightypork.gamecore.control.events.gui.LayoutChangeListener; +import mightypork.gamecore.app.AppAccess; +import mightypork.gamecore.app.AppSubModule; +import mightypork.gamecore.gui.events.LayoutChangeEvent; +import mightypork.gamecore.gui.events.LayoutChangeListener; import mightypork.gamecore.input.KeyBinder; import mightypork.gamecore.input.KeyBindingPool; import mightypork.gamecore.input.KeyStroke; import mightypork.gamecore.render.Render; -import mightypork.util.annotations.DefaultImpl; -import mightypork.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.annot.DefaultImpl; +import mightypork.gamecore.util.math.constraints.rect.Rect; /** diff --git a/src/mightypork/rogue/screens/CrossfadeOverlay.java b/src/mightypork/gamecore/gui/screens/CrossfadeOverlay.java similarity index 78% rename from src/mightypork/rogue/screens/CrossfadeOverlay.java rename to src/mightypork/gamecore/gui/screens/CrossfadeOverlay.java index f31f637..961377c 100644 --- a/src/mightypork/rogue/screens/CrossfadeOverlay.java +++ b/src/mightypork/gamecore/gui/screens/CrossfadeOverlay.java @@ -1,16 +1,15 @@ -package mightypork.rogue.screens; +package mightypork.gamecore.gui.screens; -import mightypork.gamecore.control.AppAccess; -import mightypork.gamecore.control.events.requests.ScreenRequestEvent; +import mightypork.gamecore.app.AppAccess; import mightypork.gamecore.gui.components.painters.QuadPainter; -import mightypork.gamecore.gui.screens.Overlay; +import mightypork.gamecore.gui.events.ScreenRequestEvent; +import mightypork.gamecore.util.math.Easing; +import mightypork.gamecore.util.math.color.Color; +import mightypork.gamecore.util.math.constraints.num.mutable.NumAnimated; +import mightypork.gamecore.util.math.timing.TimedTask; import mightypork.rogue.events.ActionRequest; import mightypork.rogue.events.ActionRequest.RequestType; -import mightypork.util.math.Easing; -import mightypork.util.math.color.Color; -import mightypork.util.math.constraints.num.mutable.NumAnimated; -import mightypork.util.timing.TimedTask; public class CrossfadeOverlay extends Overlay implements CrossfadeRequest.Listener { diff --git a/src/mightypork/rogue/screens/CrossfadeRequest.java b/src/mightypork/gamecore/gui/screens/CrossfadeRequest.java similarity index 84% rename from src/mightypork/rogue/screens/CrossfadeRequest.java rename to src/mightypork/gamecore/gui/screens/CrossfadeRequest.java index 70b2e78..99206d4 100644 --- a/src/mightypork/rogue/screens/CrossfadeRequest.java +++ b/src/mightypork/gamecore/gui/screens/CrossfadeRequest.java @@ -1,7 +1,7 @@ -package mightypork.rogue.screens; +package mightypork.gamecore.gui.screens; -import mightypork.util.control.eventbus.BusEvent; +import mightypork.gamecore.eventbus.BusEvent; /** diff --git a/src/mightypork/gamecore/gui/screens/LayeredScreen.java b/src/mightypork/gamecore/gui/screens/LayeredScreen.java index fb787e4..0aae8d7 100644 --- a/src/mightypork/gamecore/gui/screens/LayeredScreen.java +++ b/src/mightypork/gamecore/gui/screens/LayeredScreen.java @@ -5,8 +5,8 @@ import java.util.Collection; import java.util.Comparator; import java.util.TreeSet; -import mightypork.gamecore.control.AppAccess; -import mightypork.util.control.eventbus.clients.DelegatingClient; +import mightypork.gamecore.app.AppAccess; +import mightypork.gamecore.eventbus.clients.DelegatingClient; /** diff --git a/src/mightypork/gamecore/gui/screens/Overlay.java b/src/mightypork/gamecore/gui/screens/Overlay.java index 8a58e5d..0059c3d 100644 --- a/src/mightypork/gamecore/gui/screens/Overlay.java +++ b/src/mightypork/gamecore/gui/screens/Overlay.java @@ -4,18 +4,18 @@ package mightypork.gamecore.gui.screens; import java.util.Collection; import java.util.LinkedHashSet; -import mightypork.gamecore.control.AppAccess; -import mightypork.gamecore.control.AppSubModule; -import mightypork.gamecore.control.events.gui.LayoutChangeListener; +import mightypork.gamecore.app.AppAccess; +import mightypork.gamecore.app.AppSubModule; +import mightypork.gamecore.eventbus.events.Updateable; import mightypork.gamecore.gui.Hideable; import mightypork.gamecore.gui.components.layout.ConstraintLayout; +import mightypork.gamecore.gui.events.LayoutChangeListener; import mightypork.gamecore.input.KeyBinder; import mightypork.gamecore.input.KeyBindingPool; import mightypork.gamecore.input.KeyStroke; import mightypork.gamecore.render.Renderable; -import mightypork.util.annotations.DefaultImpl; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.timing.Updateable; +import mightypork.gamecore.util.annot.DefaultImpl; +import mightypork.gamecore.util.math.constraints.vect.Vect; /** diff --git a/src/mightypork/gamecore/gui/screens/Screen.java b/src/mightypork/gamecore/gui/screens/Screen.java index 484ae94..b5a4c33 100644 --- a/src/mightypork/gamecore/gui/screens/Screen.java +++ b/src/mightypork/gamecore/gui/screens/Screen.java @@ -1,9 +1,9 @@ package mightypork.gamecore.gui.screens; -import mightypork.gamecore.control.AppAccess; +import mightypork.gamecore.app.AppAccess; import mightypork.gamecore.render.Renderable; -import mightypork.util.math.constraints.rect.proxy.RectBound; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; /** diff --git a/src/mightypork/gamecore/gui/screens/ScreenLayer.java b/src/mightypork/gamecore/gui/screens/ScreenLayer.java index d3781b2..30015c5 100644 --- a/src/mightypork/gamecore/gui/screens/ScreenLayer.java +++ b/src/mightypork/gamecore/gui/screens/ScreenLayer.java @@ -1,7 +1,7 @@ package mightypork.gamecore.gui.screens; -import mightypork.util.annotations.DefaultImpl; +import mightypork.gamecore.util.annot.DefaultImpl; /** diff --git a/src/mightypork/gamecore/gui/screens/ScreenRegistry.java b/src/mightypork/gamecore/gui/screens/ScreenRegistry.java index cbb1a6f..be9007a 100644 --- a/src/mightypork/gamecore/gui/screens/ScreenRegistry.java +++ b/src/mightypork/gamecore/gui/screens/ScreenRegistry.java @@ -6,15 +6,15 @@ import java.util.HashMap; import java.util.Map; import java.util.TreeSet; -import mightypork.gamecore.control.AppAccess; -import mightypork.gamecore.control.AppModule; -import mightypork.gamecore.control.events.gui.LayoutChangeEvent; -import mightypork.gamecore.control.events.gui.ViewportChangeEvent; -import mightypork.gamecore.control.events.gui.ViewportChangeListener; -import mightypork.gamecore.control.events.requests.ScreenRequestListener; +import mightypork.gamecore.app.AppAccess; +import mightypork.gamecore.app.AppModule; +import mightypork.gamecore.gui.events.LayoutChangeEvent; +import mightypork.gamecore.gui.events.ScreenRequestListener; +import mightypork.gamecore.gui.events.ViewportChangeEvent; +import mightypork.gamecore.gui.events.ViewportChangeListener; +import mightypork.gamecore.logging.Log; import mightypork.gamecore.render.Renderable; -import mightypork.util.annotations.DefaultImpl; -import mightypork.util.logging.Log; +import mightypork.gamecore.util.annot.DefaultImpl; /** diff --git a/src/mightypork/gamecore/input/InputSystem.java b/src/mightypork/gamecore/input/InputSystem.java index bcf4df7..1889986 100644 --- a/src/mightypork/gamecore/input/InputSystem.java +++ b/src/mightypork/gamecore/input/InputSystem.java @@ -1,16 +1,16 @@ package mightypork.gamecore.input; -import mightypork.gamecore.control.AppAccess; -import mightypork.gamecore.control.events.input.KeyEvent; -import mightypork.gamecore.control.events.input.MouseButtonEvent; -import mightypork.gamecore.control.events.input.MouseMotionEvent; +import mightypork.gamecore.app.AppAccess; +import mightypork.gamecore.eventbus.clients.RootBusNode; +import mightypork.gamecore.eventbus.events.Updateable; +import mightypork.gamecore.input.events.KeyEvent; +import mightypork.gamecore.input.events.MouseButtonEvent; +import mightypork.gamecore.input.events.MouseMotionEvent; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.mutable.VectVar; import mightypork.rogue.events.ActionRequest; import mightypork.rogue.events.ActionRequest.RequestType; -import mightypork.util.control.eventbus.clients.RootBusNode; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.math.constraints.vect.mutable.VectVar; -import mightypork.util.timing.Updateable; import org.lwjgl.LWJGLException; import org.lwjgl.input.Keyboard; diff --git a/src/mightypork/gamecore/input/KeyBinder.java b/src/mightypork/gamecore/input/KeyBinder.java index ba3971c..919870c 100644 --- a/src/mightypork/gamecore/input/KeyBinder.java +++ b/src/mightypork/gamecore/input/KeyBinder.java @@ -1,7 +1,7 @@ package mightypork.gamecore.input; -import mightypork.util.control.Action; +import mightypork.gamecore.gui.Action; /** diff --git a/src/mightypork/gamecore/input/KeyBinding.java b/src/mightypork/gamecore/input/KeyBinding.java index 226e196..aa7f77d 100644 --- a/src/mightypork/gamecore/input/KeyBinding.java +++ b/src/mightypork/gamecore/input/KeyBinding.java @@ -1,8 +1,8 @@ package mightypork.gamecore.input; -import mightypork.gamecore.control.events.input.KeyEvent; -import mightypork.gamecore.control.events.input.KeyListener; +import mightypork.gamecore.input.events.KeyEvent; +import mightypork.gamecore.input.events.KeyListener; /** diff --git a/src/mightypork/gamecore/input/KeyBindingPool.java b/src/mightypork/gamecore/input/KeyBindingPool.java index ab77c0c..e5604c2 100644 --- a/src/mightypork/gamecore/input/KeyBindingPool.java +++ b/src/mightypork/gamecore/input/KeyBindingPool.java @@ -5,9 +5,9 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Set; -import mightypork.gamecore.control.events.input.KeyEvent; -import mightypork.gamecore.control.events.input.KeyListener; -import mightypork.util.logging.Log; +import mightypork.gamecore.input.events.KeyEvent; +import mightypork.gamecore.input.events.KeyListener; +import mightypork.gamecore.logging.Log; /** diff --git a/src/mightypork/gamecore/control/events/input/KeyEvent.java b/src/mightypork/gamecore/input/events/KeyEvent.java similarity index 87% rename from src/mightypork/gamecore/control/events/input/KeyEvent.java rename to src/mightypork/gamecore/input/events/KeyEvent.java index 7895446..c90292b 100644 --- a/src/mightypork/gamecore/control/events/input/KeyEvent.java +++ b/src/mightypork/gamecore/input/events/KeyEvent.java @@ -1,8 +1,8 @@ -package mightypork.gamecore.control.events.input; +package mightypork.gamecore.input.events; -import mightypork.util.control.eventbus.BusEvent; -import mightypork.util.control.eventbus.event_flags.UnloggedEvent; +import mightypork.gamecore.eventbus.BusEvent; +import mightypork.gamecore.eventbus.event_flags.UnloggedEvent; import org.lwjgl.input.Keyboard; diff --git a/src/mightypork/gamecore/control/events/input/KeyListener.java b/src/mightypork/gamecore/input/events/KeyListener.java similarity index 79% rename from src/mightypork/gamecore/control/events/input/KeyListener.java rename to src/mightypork/gamecore/input/events/KeyListener.java index 3ee2f9d..d2da429 100644 --- a/src/mightypork/gamecore/control/events/input/KeyListener.java +++ b/src/mightypork/gamecore/input/events/KeyListener.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.control.events.input; +package mightypork.gamecore.input.events; /** diff --git a/src/mightypork/gamecore/control/events/input/MouseButtonEvent.java b/src/mightypork/gamecore/input/events/MouseButtonEvent.java similarity index 84% rename from src/mightypork/gamecore/control/events/input/MouseButtonEvent.java rename to src/mightypork/gamecore/input/events/MouseButtonEvent.java index a24dc6a..77aba1a 100644 --- a/src/mightypork/gamecore/control/events/input/MouseButtonEvent.java +++ b/src/mightypork/gamecore/input/events/MouseButtonEvent.java @@ -1,11 +1,11 @@ -package mightypork.gamecore.control.events.input; +package mightypork.gamecore.input.events; -import mightypork.util.control.eventbus.BusEvent; -import mightypork.util.control.eventbus.event_flags.UnloggedEvent; -import mightypork.util.math.constraints.rect.proxy.RectBound; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.math.constraints.vect.VectConst; +import mightypork.gamecore.eventbus.BusEvent; +import mightypork.gamecore.eventbus.event_flags.UnloggedEvent; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.VectConst; /** diff --git a/src/mightypork/gamecore/control/events/input/MouseButtonListener.java b/src/mightypork/gamecore/input/events/MouseButtonListener.java similarity index 80% rename from src/mightypork/gamecore/control/events/input/MouseButtonListener.java rename to src/mightypork/gamecore/input/events/MouseButtonListener.java index 834c618..23d81a1 100644 --- a/src/mightypork/gamecore/control/events/input/MouseButtonListener.java +++ b/src/mightypork/gamecore/input/events/MouseButtonListener.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.control.events.input; +package mightypork.gamecore.input.events; /** diff --git a/src/mightypork/gamecore/control/events/input/MouseMotionEvent.java b/src/mightypork/gamecore/input/events/MouseMotionEvent.java similarity index 71% rename from src/mightypork/gamecore/control/events/input/MouseMotionEvent.java rename to src/mightypork/gamecore/input/events/MouseMotionEvent.java index 5114b9c..855184b 100644 --- a/src/mightypork/gamecore/control/events/input/MouseMotionEvent.java +++ b/src/mightypork/gamecore/input/events/MouseMotionEvent.java @@ -1,10 +1,10 @@ -package mightypork.gamecore.control.events.input; +package mightypork.gamecore.input.events; -import mightypork.util.control.eventbus.BusEvent; -import mightypork.util.control.eventbus.event_flags.UnloggedEvent; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.math.constraints.vect.VectConst; +import mightypork.gamecore.eventbus.BusEvent; +import mightypork.gamecore.eventbus.event_flags.UnloggedEvent; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.VectConst; /** diff --git a/src/mightypork/gamecore/control/events/input/MouseMotionListener.java b/src/mightypork/gamecore/input/events/MouseMotionListener.java similarity index 80% rename from src/mightypork/gamecore/control/events/input/MouseMotionListener.java rename to src/mightypork/gamecore/input/events/MouseMotionListener.java index 599963a..4854735 100644 --- a/src/mightypork/gamecore/control/events/input/MouseMotionListener.java +++ b/src/mightypork/gamecore/input/events/MouseMotionListener.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.control.events.input; +package mightypork.gamecore.input.events; /** diff --git a/src/mightypork/util/logging/Log.java b/src/mightypork/gamecore/logging/Log.java similarity index 94% rename from src/mightypork/util/logging/Log.java rename to src/mightypork/gamecore/logging/Log.java index c3aaffe..71468ae 100644 --- a/src/mightypork/util/logging/Log.java +++ b/src/mightypork/gamecore/logging/Log.java @@ -1,4 +1,4 @@ -package mightypork.util.logging; +package mightypork.gamecore.logging; import java.io.File; @@ -7,13 +7,13 @@ import java.io.StringWriter; import java.util.HashMap; import java.util.logging.Level; -import mightypork.util.annotations.FactoryMethod; -import mightypork.util.logging.monitors.LogMonitor; -import mightypork.util.logging.monitors.LogToSysoutMonitor; -import mightypork.util.logging.writers.ArchivingLog; -import mightypork.util.logging.writers.LogWriter; -import mightypork.util.logging.writers.SimpleLog; -import mightypork.util.string.StringUtils; +import mightypork.gamecore.logging.monitors.LogMonitor; +import mightypork.gamecore.logging.monitors.LogToSysoutMonitor; +import mightypork.gamecore.logging.writers.ArchivingLog; +import mightypork.gamecore.logging.writers.LogWriter; +import mightypork.gamecore.logging.writers.SimpleLog; +import mightypork.gamecore.util.annot.FactoryMethod; +import mightypork.gamecore.util.strings.StringUtils; /** diff --git a/src/mightypork/util/logging/LogAlias.java b/src/mightypork/gamecore/logging/LogAlias.java similarity index 91% rename from src/mightypork/util/logging/LogAlias.java rename to src/mightypork/gamecore/logging/LogAlias.java index 9d080f1..3ff5d1d 100644 --- a/src/mightypork/util/logging/LogAlias.java +++ b/src/mightypork/gamecore/logging/LogAlias.java @@ -1,4 +1,4 @@ -package mightypork.util.logging; +package mightypork.gamecore.logging; import java.lang.annotation.Documented; diff --git a/src/mightypork/gamecore/control/SlickLogRedirector.java b/src/mightypork/gamecore/logging/SlickLogRedirector.java similarity index 57% rename from src/mightypork/gamecore/control/SlickLogRedirector.java rename to src/mightypork/gamecore/logging/SlickLogRedirector.java index a135aac..3a37820 100644 --- a/src/mightypork/gamecore/control/SlickLogRedirector.java +++ b/src/mightypork/gamecore/logging/SlickLogRedirector.java @@ -1,21 +1,18 @@ -package mightypork.gamecore.control; +package mightypork.gamecore.logging; import java.util.logging.Level; -import mightypork.util.logging.writers.LogWriter; - -import org.newdawn.slick.util.LogSystem; - +import mightypork.gamecore.logging.writers.LogWriter; /** * Used to redirect slick log into main logger. * * @author MightyPork */ -public class SlickLogRedirector implements LogSystem { +public class SlickLogRedirector implements org.newdawn.slick.util.LogSystem { - LogWriter l; + LogWriter writer; /** @@ -23,56 +20,56 @@ public class SlickLogRedirector implements LogSystem { */ public SlickLogRedirector(LogWriter log) { - this.l = log; + this.writer = log; } @Override public void error(String msg, Throwable e) { - l.log(Level.SEVERE, msg, e); + writer.log(Level.SEVERE, msg, e); } @Override public void error(Throwable e) { - l.log(Level.SEVERE, null, e); + writer.log(Level.SEVERE, null, e); } @Override public void error(String msg) { - l.log(Level.SEVERE, msg); + writer.log(Level.SEVERE, msg); } @Override public void warn(String msg) { - l.log(Level.WARNING, msg); + writer.log(Level.WARNING, msg); } @Override public void warn(String msg, Throwable e) { - l.log(Level.WARNING, msg, e); + writer.log(Level.WARNING, msg, e); } @Override public void info(String msg) { - l.log(Level.INFO, msg); + writer.log(Level.INFO, msg); } @Override public void debug(String msg) { - l.log(Level.FINEST, msg); + writer.log(Level.FINEST, msg); } } diff --git a/src/mightypork/util/logging/monitors/BaseLogMonitor.java b/src/mightypork/gamecore/logging/monitors/BaseLogMonitor.java similarity index 92% rename from src/mightypork/util/logging/monitors/BaseLogMonitor.java rename to src/mightypork/gamecore/logging/monitors/BaseLogMonitor.java index 997bd2f..de965ac 100644 --- a/src/mightypork/util/logging/monitors/BaseLogMonitor.java +++ b/src/mightypork/gamecore/logging/monitors/BaseLogMonitor.java @@ -1,4 +1,4 @@ -package mightypork.util.logging.monitors; +package mightypork.gamecore.logging.monitors; import java.util.logging.Level; diff --git a/src/mightypork/util/logging/monitors/LogMonitor.java b/src/mightypork/gamecore/logging/monitors/LogMonitor.java similarity index 80% rename from src/mightypork/util/logging/monitors/LogMonitor.java rename to src/mightypork/gamecore/logging/monitors/LogMonitor.java index bf355ad..acfdada 100644 --- a/src/mightypork/util/logging/monitors/LogMonitor.java +++ b/src/mightypork/gamecore/logging/monitors/LogMonitor.java @@ -1,4 +1,4 @@ -package mightypork.util.logging.monitors; +package mightypork.gamecore.logging.monitors; import java.util.logging.Level; diff --git a/src/mightypork/util/logging/monitors/LogToSysoutMonitor.java b/src/mightypork/gamecore/logging/monitors/LogToSysoutMonitor.java similarity index 86% rename from src/mightypork/util/logging/monitors/LogToSysoutMonitor.java rename to src/mightypork/gamecore/logging/monitors/LogToSysoutMonitor.java index 909efec..2ef98be 100644 --- a/src/mightypork/util/logging/monitors/LogToSysoutMonitor.java +++ b/src/mightypork/gamecore/logging/monitors/LogToSysoutMonitor.java @@ -1,4 +1,4 @@ -package mightypork.util.logging.monitors; +package mightypork.gamecore.logging.monitors; import java.util.logging.Level; diff --git a/src/mightypork/util/logging/writers/ArchivingLog.java b/src/mightypork/gamecore/logging/writers/ArchivingLog.java similarity index 96% rename from src/mightypork/util/logging/writers/ArchivingLog.java rename to src/mightypork/gamecore/logging/writers/ArchivingLog.java index 2a4332f..5a55e25 100644 --- a/src/mightypork/util/logging/writers/ArchivingLog.java +++ b/src/mightypork/gamecore/logging/writers/ArchivingLog.java @@ -1,4 +1,4 @@ -package mightypork.util.logging.writers; +package mightypork.gamecore.logging.writers; import java.io.File; @@ -9,7 +9,7 @@ import java.util.Comparator; import java.util.Date; import java.util.List; -import mightypork.util.files.FileUtils; +import mightypork.gamecore.util.files.FileUtils; /** diff --git a/src/mightypork/util/logging/writers/LogWriter.java b/src/mightypork/gamecore/logging/writers/LogWriter.java similarity index 89% rename from src/mightypork/util/logging/writers/LogWriter.java rename to src/mightypork/gamecore/logging/writers/LogWriter.java index 99df21b..0f87791 100644 --- a/src/mightypork/util/logging/writers/LogWriter.java +++ b/src/mightypork/gamecore/logging/writers/LogWriter.java @@ -1,9 +1,9 @@ -package mightypork.util.logging.writers; +package mightypork.gamecore.logging.writers; import java.util.logging.Level; -import mightypork.util.logging.monitors.LogMonitor; +import mightypork.gamecore.logging.monitors.LogMonitor; /** diff --git a/src/mightypork/util/logging/writers/SimpleLog.java b/src/mightypork/gamecore/logging/writers/SimpleLog.java similarity index 95% rename from src/mightypork/util/logging/writers/SimpleLog.java rename to src/mightypork/gamecore/logging/writers/SimpleLog.java index bdc2249..0f9128a 100644 --- a/src/mightypork/util/logging/writers/SimpleLog.java +++ b/src/mightypork/gamecore/logging/writers/SimpleLog.java @@ -1,4 +1,4 @@ -package mightypork.util.logging.writers; +package mightypork.gamecore.logging.writers; import java.io.File; @@ -11,8 +11,8 @@ import java.util.logging.Level; import java.util.logging.LogRecord; import java.util.logging.Logger; -import mightypork.util.logging.Log; -import mightypork.util.logging.monitors.LogMonitor; +import mightypork.gamecore.logging.Log; +import mightypork.gamecore.logging.monitors.LogMonitor; /** diff --git a/src/mightypork/gamecore/render/DisplaySystem.java b/src/mightypork/gamecore/render/DisplaySystem.java index 10c19ec..b85803f 100644 --- a/src/mightypork/gamecore/render/DisplaySystem.java +++ b/src/mightypork/gamecore/render/DisplaySystem.java @@ -5,14 +5,14 @@ import static org.lwjgl.opengl.GL11.*; import java.nio.ByteBuffer; -import mightypork.gamecore.control.AppAccess; -import mightypork.gamecore.control.AppModule; -import mightypork.gamecore.control.events.gui.ViewportChangeEvent; -import mightypork.util.logging.Log; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.rect.proxy.RectBound; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.timing.FpsMeter; +import mightypork.gamecore.app.AppAccess; +import mightypork.gamecore.app.AppModule; +import mightypork.gamecore.gui.events.ViewportChangeEvent; +import mightypork.gamecore.logging.Log; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.timing.FpsMeter; import org.lwjgl.BufferUtils; import org.lwjgl.LWJGLException; diff --git a/src/mightypork/gamecore/render/Render.java b/src/mightypork/gamecore/render/Render.java index 0c3ee4a..2b0e94e 100644 --- a/src/mightypork/gamecore/render/Render.java +++ b/src/mightypork/gamecore/render/Render.java @@ -5,16 +5,16 @@ import static org.lwjgl.opengl.GL11.*; import java.io.IOException; -import mightypork.gamecore.render.textures.FilterMode; -import mightypork.gamecore.render.textures.GLTexture; -import mightypork.gamecore.render.textures.TxQuad; -import mightypork.util.files.FileUtils; -import mightypork.util.logging.Log; -import mightypork.util.math.color.Color; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.rect.caching.RectDigest; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.math.constraints.vect.VectConst; +import mightypork.gamecore.logging.Log; +import mightypork.gamecore.resources.textures.FilterMode; +import mightypork.gamecore.resources.textures.GLTexture; +import mightypork.gamecore.resources.textures.TxQuad; +import mightypork.gamecore.util.files.FileUtils; +import mightypork.gamecore.util.math.color.Color; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.caching.RectDigest; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.VectConst; import org.lwjgl.opengl.GL11; import org.newdawn.slick.opengl.Texture; diff --git a/src/mightypork/gamecore/audio/DeferredAudio.java b/src/mightypork/gamecore/resources/audio/DeferredAudio.java similarity index 94% rename from src/mightypork/gamecore/audio/DeferredAudio.java rename to src/mightypork/gamecore/resources/audio/DeferredAudio.java index 8183fec..2c42e5a 100644 --- a/src/mightypork/gamecore/audio/DeferredAudio.java +++ b/src/mightypork/gamecore/resources/audio/DeferredAudio.java @@ -1,12 +1,12 @@ -package mightypork.gamecore.audio; +package mightypork.gamecore.resources.audio; import java.io.IOException; -import mightypork.gamecore.loading.DeferredResource; -import mightypork.util.files.FileUtils; -import mightypork.util.logging.LogAlias; -import mightypork.util.math.constraints.vect.Vect; +import mightypork.gamecore.logging.LogAlias; +import mightypork.gamecore.resources.loading.DeferredResource; +import mightypork.gamecore.util.files.FileUtils; +import mightypork.gamecore.util.math.constraints.vect.Vect; import org.newdawn.slick.openal.Audio; import org.newdawn.slick.openal.SoundStore; diff --git a/src/mightypork/gamecore/audio/JointVolume.java b/src/mightypork/gamecore/resources/audio/JointVolume.java similarity index 88% rename from src/mightypork/gamecore/audio/JointVolume.java rename to src/mightypork/gamecore/resources/audio/JointVolume.java index 0d19709..af76962 100644 --- a/src/mightypork/gamecore/audio/JointVolume.java +++ b/src/mightypork/gamecore/resources/audio/JointVolume.java @@ -1,7 +1,7 @@ -package mightypork.gamecore.audio; +package mightypork.gamecore.resources.audio; -import mightypork.util.math.Calc; +import mightypork.gamecore.util.math.Calc; /** diff --git a/src/mightypork/gamecore/audio/SoundBank.java b/src/mightypork/gamecore/resources/audio/SoundBank.java similarity index 85% rename from src/mightypork/gamecore/audio/SoundBank.java rename to src/mightypork/gamecore/resources/audio/SoundBank.java index 44bddfd..6b98bfa 100644 --- a/src/mightypork/gamecore/audio/SoundBank.java +++ b/src/mightypork/gamecore/resources/audio/SoundBank.java @@ -1,13 +1,13 @@ -package mightypork.gamecore.audio; +package mightypork.gamecore.resources.audio; import java.util.HashMap; import java.util.Map; -import mightypork.gamecore.audio.players.EffectPlayer; -import mightypork.gamecore.audio.players.LoopPlayer; -import mightypork.gamecore.control.AppAccess; -import mightypork.gamecore.control.AppAdapter; +import mightypork.gamecore.app.AppAccess; +import mightypork.gamecore.app.LightAppModule; +import mightypork.gamecore.resources.audio.players.EffectPlayer; +import mightypork.gamecore.resources.audio.players.LoopPlayer; /** @@ -15,7 +15,7 @@ import mightypork.gamecore.control.AppAdapter; * * @author MightyPork */ -public class SoundBank extends AppAdapter { +public class SoundBank extends LightAppModule { private final Map effects = new HashMap<>(); private final Map loops = new HashMap<>(); diff --git a/src/mightypork/gamecore/audio/SoundSystem.java b/src/mightypork/gamecore/resources/audio/SoundSystem.java similarity index 89% rename from src/mightypork/gamecore/audio/SoundSystem.java rename to src/mightypork/gamecore/resources/audio/SoundSystem.java index 7fb00cf..7ab85f7 100644 --- a/src/mightypork/gamecore/audio/SoundSystem.java +++ b/src/mightypork/gamecore/resources/audio/SoundSystem.java @@ -1,19 +1,19 @@ -package mightypork.gamecore.audio; +package mightypork.gamecore.resources.audio; import java.nio.FloatBuffer; import java.util.HashSet; import java.util.Set; -import mightypork.gamecore.audio.players.EffectPlayer; -import mightypork.gamecore.audio.players.LoopPlayer; -import mightypork.gamecore.control.AppAccess; -import mightypork.gamecore.control.events.requests.ResourceLoadRequest; -import mightypork.util.control.eventbus.clients.RootBusNode; -import mightypork.util.math.Calc.Buffers; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.math.constraints.vect.mutable.VectVar; -import mightypork.util.timing.Updateable; +import mightypork.gamecore.app.AppAccess; +import mightypork.gamecore.eventbus.clients.RootBusNode; +import mightypork.gamecore.eventbus.events.Updateable; +import mightypork.gamecore.resources.audio.players.EffectPlayer; +import mightypork.gamecore.resources.audio.players.LoopPlayer; +import mightypork.gamecore.resources.events.ResourceLoadRequest; +import mightypork.gamecore.util.math.Calc.Buffers; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.mutable.VectVar; import org.lwjgl.openal.AL; import org.lwjgl.openal.AL10; diff --git a/src/mightypork/gamecore/audio/Volume.java b/src/mightypork/gamecore/resources/audio/Volume.java similarity index 66% rename from src/mightypork/gamecore/audio/Volume.java rename to src/mightypork/gamecore/resources/audio/Volume.java index 44a541e..fc73278 100644 --- a/src/mightypork/gamecore/audio/Volume.java +++ b/src/mightypork/gamecore/resources/audio/Volume.java @@ -1,8 +1,8 @@ -package mightypork.gamecore.audio; +package mightypork.gamecore.resources.audio; -import mightypork.util.math.Calc; -import mightypork.util.objects.Mutable; +import mightypork.gamecore.util.math.Calc; +import mightypork.gamecore.util.objects.Mutable; /** diff --git a/src/mightypork/gamecore/audio/players/BaseAudioPlayer.java b/src/mightypork/gamecore/resources/audio/players/BaseAudioPlayer.java similarity index 88% rename from src/mightypork/gamecore/audio/players/BaseAudioPlayer.java rename to src/mightypork/gamecore/resources/audio/players/BaseAudioPlayer.java index d226452..50e0cdd 100644 --- a/src/mightypork/gamecore/audio/players/BaseAudioPlayer.java +++ b/src/mightypork/gamecore/resources/audio/players/BaseAudioPlayer.java @@ -1,9 +1,9 @@ -package mightypork.gamecore.audio.players; +package mightypork.gamecore.resources.audio.players; -import mightypork.gamecore.audio.DeferredAudio; -import mightypork.gamecore.audio.Volume; -import mightypork.util.control.Destroyable; +import mightypork.gamecore.eventbus.events.Destroyable; +import mightypork.gamecore.resources.audio.DeferredAudio; +import mightypork.gamecore.resources.audio.Volume; /** diff --git a/src/mightypork/gamecore/audio/players/EffectPlayer.java b/src/mightypork/gamecore/resources/audio/players/EffectPlayer.java similarity index 84% rename from src/mightypork/gamecore/audio/players/EffectPlayer.java rename to src/mightypork/gamecore/resources/audio/players/EffectPlayer.java index 17f24c5..6f60dec 100644 --- a/src/mightypork/gamecore/audio/players/EffectPlayer.java +++ b/src/mightypork/gamecore/resources/audio/players/EffectPlayer.java @@ -1,9 +1,9 @@ -package mightypork.gamecore.audio.players; +package mightypork.gamecore.resources.audio.players; -import mightypork.gamecore.audio.DeferredAudio; -import mightypork.gamecore.audio.Volume; -import mightypork.util.math.constraints.vect.Vect; +import mightypork.gamecore.resources.audio.DeferredAudio; +import mightypork.gamecore.resources.audio.Volume; +import mightypork.gamecore.util.math.constraints.vect.Vect; /** diff --git a/src/mightypork/gamecore/audio/players/LoopPlayer.java b/src/mightypork/gamecore/resources/audio/players/LoopPlayer.java similarity index 88% rename from src/mightypork/gamecore/audio/players/LoopPlayer.java rename to src/mightypork/gamecore/resources/audio/players/LoopPlayer.java index 7d404ef..ae291b9 100644 --- a/src/mightypork/gamecore/audio/players/LoopPlayer.java +++ b/src/mightypork/gamecore/resources/audio/players/LoopPlayer.java @@ -1,11 +1,11 @@ -package mightypork.gamecore.audio.players; +package mightypork.gamecore.resources.audio.players; -import mightypork.gamecore.audio.DeferredAudio; -import mightypork.gamecore.audio.Volume; -import mightypork.util.math.constraints.num.mutable.NumAnimated; -import mightypork.util.timing.Pauseable; -import mightypork.util.timing.Updateable; +import mightypork.gamecore.eventbus.events.Updateable; +import mightypork.gamecore.resources.audio.DeferredAudio; +import mightypork.gamecore.resources.audio.Volume; +import mightypork.gamecore.util.math.constraints.num.mutable.NumAnimated; +import mightypork.gamecore.util.math.timing.Pauseable; import org.lwjgl.openal.AL10; diff --git a/src/mightypork/gamecore/control/events/requests/ResourceLoadRequest.java b/src/mightypork/gamecore/resources/events/ResourceLoadRequest.java similarity index 67% rename from src/mightypork/gamecore/control/events/requests/ResourceLoadRequest.java rename to src/mightypork/gamecore/resources/events/ResourceLoadRequest.java index efd17d3..799a7f6 100644 --- a/src/mightypork/gamecore/control/events/requests/ResourceLoadRequest.java +++ b/src/mightypork/gamecore/resources/events/ResourceLoadRequest.java @@ -1,9 +1,9 @@ -package mightypork.gamecore.control.events.requests; +package mightypork.gamecore.resources.events; -import mightypork.gamecore.loading.Deferred; -import mightypork.util.control.eventbus.BusEvent; -import mightypork.util.control.eventbus.event_flags.SingleReceiverEvent; +import mightypork.gamecore.eventbus.BusEvent; +import mightypork.gamecore.eventbus.event_flags.SingleReceiverEvent; +import mightypork.gamecore.resources.loading.Deferred; /** diff --git a/src/mightypork/gamecore/control/events/requests/ResourceLoadRequestListener.java b/src/mightypork/gamecore/resources/events/ResourceLoadRequestListener.java similarity index 68% rename from src/mightypork/gamecore/control/events/requests/ResourceLoadRequestListener.java rename to src/mightypork/gamecore/resources/events/ResourceLoadRequestListener.java index f26caf9..ce3329f 100644 --- a/src/mightypork/gamecore/control/events/requests/ResourceLoadRequestListener.java +++ b/src/mightypork/gamecore/resources/events/ResourceLoadRequestListener.java @@ -1,7 +1,7 @@ -package mightypork.gamecore.control.events.requests; +package mightypork.gamecore.resources.events; -import mightypork.gamecore.loading.Deferred; +import mightypork.gamecore.resources.loading.Deferred; /** diff --git a/src/mightypork/gamecore/render/fonts/FontBank.java b/src/mightypork/gamecore/resources/fonts/FontBank.java similarity index 81% rename from src/mightypork/gamecore/render/fonts/FontBank.java rename to src/mightypork/gamecore/resources/fonts/FontBank.java index 8ff75a6..2d908d4 100644 --- a/src/mightypork/gamecore/render/fonts/FontBank.java +++ b/src/mightypork/gamecore/resources/fonts/FontBank.java @@ -1,12 +1,12 @@ -package mightypork.gamecore.render.fonts; +package mightypork.gamecore.resources.fonts; import java.util.HashMap; -import mightypork.gamecore.control.AppAccess; -import mightypork.gamecore.control.AppAdapter; -import mightypork.gamecore.control.events.requests.ResourceLoadRequest; -import mightypork.gamecore.render.fonts.impl.DeferredFont; +import mightypork.gamecore.app.AppAccess; +import mightypork.gamecore.app.LightAppModule; +import mightypork.gamecore.resources.events.ResourceLoadRequest; +import mightypork.gamecore.resources.fonts.impl.DeferredFont; import org.newdawn.slick.opengl.Texture; @@ -16,7 +16,7 @@ import org.newdawn.slick.opengl.Texture; * * @author MightyPork */ -public class FontBank extends AppAdapter { +public class FontBank extends LightAppModule { /** * @param app app access diff --git a/src/mightypork/gamecore/render/fonts/FontRenderer.java b/src/mightypork/gamecore/resources/fonts/FontRenderer.java similarity index 94% rename from src/mightypork/gamecore/render/fonts/FontRenderer.java rename to src/mightypork/gamecore/resources/fonts/FontRenderer.java index 1a76602..4e4b06e 100644 --- a/src/mightypork/gamecore/render/fonts/FontRenderer.java +++ b/src/mightypork/gamecore/resources/fonts/FontRenderer.java @@ -1,11 +1,11 @@ -package mightypork.gamecore.render.fonts; +package mightypork.gamecore.resources.fonts; import mightypork.gamecore.gui.AlignX; import mightypork.gamecore.render.Render; -import mightypork.util.math.color.Color; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.color.Color; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.vect.Vect; /** diff --git a/src/mightypork/gamecore/render/fonts/GLFont.java b/src/mightypork/gamecore/resources/fonts/GLFont.java similarity index 80% rename from src/mightypork/gamecore/render/fonts/GLFont.java rename to src/mightypork/gamecore/resources/fonts/GLFont.java index 3aa5b93..fba6ebb 100644 --- a/src/mightypork/gamecore/render/fonts/GLFont.java +++ b/src/mightypork/gamecore/resources/fonts/GLFont.java @@ -1,8 +1,8 @@ -package mightypork.gamecore.render.fonts; +package mightypork.gamecore.resources.fonts; -import mightypork.util.math.color.Color; -import mightypork.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.color.Color; +import mightypork.gamecore.util.math.constraints.vect.Vect; /** diff --git a/src/mightypork/gamecore/render/fonts/Glyphs.java b/src/mightypork/gamecore/resources/fonts/Glyphs.java similarity index 95% rename from src/mightypork/gamecore/render/fonts/Glyphs.java rename to src/mightypork/gamecore/resources/fonts/Glyphs.java index ae920de..7f1da30 100644 --- a/src/mightypork/gamecore/render/fonts/Glyphs.java +++ b/src/mightypork/gamecore/resources/fonts/Glyphs.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.render.fonts; +package mightypork.gamecore.resources.fonts; /** diff --git a/src/mightypork/gamecore/render/fonts/impl/CachedFont.java b/src/mightypork/gamecore/resources/fonts/impl/CachedFont.java similarity index 95% rename from src/mightypork/gamecore/render/fonts/impl/CachedFont.java rename to src/mightypork/gamecore/resources/fonts/impl/CachedFont.java index 651043c..1e31be4 100644 --- a/src/mightypork/gamecore/render/fonts/impl/CachedFont.java +++ b/src/mightypork/gamecore/resources/fonts/impl/CachedFont.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.render.fonts.impl; +package mightypork.gamecore.resources.fonts.impl; import static org.lwjgl.opengl.GL11.*; @@ -18,13 +18,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import mightypork.gamecore.render.fonts.GLFont; -import mightypork.gamecore.render.textures.DeferredTexture; -import mightypork.gamecore.render.textures.FilterMode; -import mightypork.util.logging.Log; -import mightypork.util.math.color.Color; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.math.constraints.vect.VectConst; +import mightypork.gamecore.logging.Log; +import mightypork.gamecore.resources.fonts.GLFont; +import mightypork.gamecore.resources.textures.DeferredTexture; +import mightypork.gamecore.resources.textures.FilterMode; +import mightypork.gamecore.util.math.color.Color; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.VectConst; import org.lwjgl.BufferUtils; import org.lwjgl.util.glu.GLU; diff --git a/src/mightypork/gamecore/render/fonts/impl/DeferredFont.java b/src/mightypork/gamecore/resources/fonts/impl/DeferredFont.java similarity index 88% rename from src/mightypork/gamecore/render/fonts/impl/DeferredFont.java rename to src/mightypork/gamecore/resources/fonts/impl/DeferredFont.java index 42e6c18..1a1e2ce 100644 --- a/src/mightypork/gamecore/render/fonts/impl/DeferredFont.java +++ b/src/mightypork/gamecore/resources/fonts/impl/DeferredFont.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.render.fonts.impl; +package mightypork.gamecore.resources.fonts.impl; import java.awt.Font; @@ -6,14 +6,14 @@ import java.awt.FontFormatException; import java.io.IOException; import java.io.InputStream; -import mightypork.gamecore.loading.DeferredResource; -import mightypork.gamecore.loading.MustLoadInMainThread; -import mightypork.gamecore.render.fonts.GLFont; -import mightypork.gamecore.render.textures.FilterMode; -import mightypork.util.files.FileUtils; -import mightypork.util.logging.LogAlias; -import mightypork.util.math.color.Color; -import mightypork.util.math.constraints.vect.Vect; +import mightypork.gamecore.logging.LogAlias; +import mightypork.gamecore.resources.fonts.GLFont; +import mightypork.gamecore.resources.loading.DeferredResource; +import mightypork.gamecore.resources.loading.MustLoadInMainThread; +import mightypork.gamecore.resources.textures.FilterMode; +import mightypork.gamecore.util.files.FileUtils; +import mightypork.gamecore.util.math.color.Color; +import mightypork.gamecore.util.math.constraints.vect.Vect; /** diff --git a/src/mightypork/gamecore/render/fonts/impl/DeferredFontNative.java b/src/mightypork/gamecore/resources/fonts/impl/DeferredFontNative.java similarity index 85% rename from src/mightypork/gamecore/render/fonts/impl/DeferredFontNative.java rename to src/mightypork/gamecore/resources/fonts/impl/DeferredFontNative.java index ba7b101..1ae7853 100644 --- a/src/mightypork/gamecore/render/fonts/impl/DeferredFontNative.java +++ b/src/mightypork/gamecore/resources/fonts/impl/DeferredFontNative.java @@ -1,12 +1,12 @@ -package mightypork.gamecore.render.fonts.impl; +package mightypork.gamecore.resources.fonts.impl; import java.awt.Font; import java.awt.FontFormatException; import java.io.IOException; -import mightypork.gamecore.render.textures.FilterMode; -import mightypork.util.logging.LogAlias; +import mightypork.gamecore.logging.LogAlias; +import mightypork.gamecore.resources.textures.FilterMode; /** diff --git a/src/mightypork/gamecore/loading/AsyncResourceLoader.java b/src/mightypork/gamecore/resources/loading/AsyncResourceLoader.java similarity index 87% rename from src/mightypork/gamecore/loading/AsyncResourceLoader.java rename to src/mightypork/gamecore/resources/loading/AsyncResourceLoader.java index 77a49ac..d23d252 100644 --- a/src/mightypork/gamecore/loading/AsyncResourceLoader.java +++ b/src/mightypork/gamecore/resources/loading/AsyncResourceLoader.java @@ -1,16 +1,16 @@ -package mightypork.gamecore.loading; +package mightypork.gamecore.resources.loading; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.LinkedBlockingQueue; -import mightypork.gamecore.control.events.requests.MainLoopRequest; -import mightypork.gamecore.control.events.requests.ResourceLoadRequestListener; -import mightypork.util.annotations.FactoryMethod; -import mightypork.util.control.Destroyable; -import mightypork.util.control.eventbus.BusAccess; -import mightypork.util.logging.Log; +import mightypork.gamecore.app.MainLoopRequest; +import mightypork.gamecore.eventbus.BusAccess; +import mightypork.gamecore.eventbus.events.Destroyable; +import mightypork.gamecore.logging.Log; +import mightypork.gamecore.resources.events.ResourceLoadRequestListener; +import mightypork.gamecore.util.annot.FactoryMethod; /** diff --git a/src/mightypork/gamecore/loading/Deferred.java b/src/mightypork/gamecore/resources/loading/Deferred.java similarity index 85% rename from src/mightypork/gamecore/loading/Deferred.java rename to src/mightypork/gamecore/resources/loading/Deferred.java index 28896da..b39a9fa 100644 --- a/src/mightypork/gamecore/loading/Deferred.java +++ b/src/mightypork/gamecore/resources/loading/Deferred.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.loading; +package mightypork.gamecore.resources.loading; /** diff --git a/src/mightypork/gamecore/loading/DeferredResource.java b/src/mightypork/gamecore/resources/loading/DeferredResource.java similarity index 92% rename from src/mightypork/gamecore/loading/DeferredResource.java rename to src/mightypork/gamecore/resources/loading/DeferredResource.java index d1c4f93..af2fbf8 100644 --- a/src/mightypork/gamecore/loading/DeferredResource.java +++ b/src/mightypork/gamecore/resources/loading/DeferredResource.java @@ -1,9 +1,9 @@ -package mightypork.gamecore.loading; +package mightypork.gamecore.resources.loading; -import mightypork.util.control.Destroyable; -import mightypork.util.logging.Log; -import mightypork.util.logging.LogAlias; +import mightypork.gamecore.eventbus.events.Destroyable; +import mightypork.gamecore.logging.Log; +import mightypork.gamecore.logging.LogAlias; /** diff --git a/src/mightypork/gamecore/loading/MustLoadInMainThread.java b/src/mightypork/gamecore/resources/loading/MustLoadInMainThread.java similarity index 86% rename from src/mightypork/gamecore/loading/MustLoadInMainThread.java rename to src/mightypork/gamecore/resources/loading/MustLoadInMainThread.java index 87d253b..0aef4f0 100644 --- a/src/mightypork/gamecore/loading/MustLoadInMainThread.java +++ b/src/mightypork/gamecore/resources/loading/MustLoadInMainThread.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.loading; +package mightypork.gamecore.resources.loading; import java.lang.annotation.*; diff --git a/src/mightypork/gamecore/render/textures/DeferredTexture.java b/src/mightypork/gamecore/resources/textures/DeferredTexture.java similarity index 90% rename from src/mightypork/gamecore/render/textures/DeferredTexture.java rename to src/mightypork/gamecore/resources/textures/DeferredTexture.java index 1d9ebb7..0bfd50e 100644 --- a/src/mightypork/gamecore/render/textures/DeferredTexture.java +++ b/src/mightypork/gamecore/resources/textures/DeferredTexture.java @@ -1,11 +1,11 @@ -package mightypork.gamecore.render.textures; +package mightypork.gamecore.resources.textures; -import mightypork.gamecore.loading.DeferredResource; -import mightypork.gamecore.loading.MustLoadInMainThread; +import mightypork.gamecore.logging.LogAlias; import mightypork.gamecore.render.Render; -import mightypork.util.logging.LogAlias; -import mightypork.util.math.constraints.rect.Rect; +import mightypork.gamecore.resources.loading.DeferredResource; +import mightypork.gamecore.resources.loading.MustLoadInMainThread; +import mightypork.gamecore.util.math.constraints.rect.Rect; import org.lwjgl.opengl.GL11; diff --git a/src/mightypork/gamecore/render/textures/FilterMode.java b/src/mightypork/gamecore/resources/textures/FilterMode.java similarity index 84% rename from src/mightypork/gamecore/render/textures/FilterMode.java rename to src/mightypork/gamecore/resources/textures/FilterMode.java index c7ab0c8..2affbf7 100644 --- a/src/mightypork/gamecore/render/textures/FilterMode.java +++ b/src/mightypork/gamecore/resources/textures/FilterMode.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.render.textures; +package mightypork.gamecore.resources.textures; import org.lwjgl.opengl.GL11; diff --git a/src/mightypork/gamecore/render/textures/GLTexture.java b/src/mightypork/gamecore/resources/textures/GLTexture.java similarity index 88% rename from src/mightypork/gamecore/render/textures/GLTexture.java rename to src/mightypork/gamecore/resources/textures/GLTexture.java index d1f981d..9921925 100644 --- a/src/mightypork/gamecore/render/textures/GLTexture.java +++ b/src/mightypork/gamecore/resources/textures/GLTexture.java @@ -1,8 +1,8 @@ -package mightypork.gamecore.render.textures; +package mightypork.gamecore.resources.textures; -import mightypork.util.control.Destroyable; -import mightypork.util.math.constraints.rect.Rect; +import mightypork.gamecore.eventbus.events.Destroyable; +import mightypork.gamecore.util.math.constraints.rect.Rect; /** diff --git a/src/mightypork/gamecore/render/textures/QuadGrid.java b/src/mightypork/gamecore/resources/textures/QuadGrid.java similarity index 95% rename from src/mightypork/gamecore/render/textures/QuadGrid.java rename to src/mightypork/gamecore/resources/textures/QuadGrid.java index 56eb543..7ee044a 100644 --- a/src/mightypork/gamecore/render/textures/QuadGrid.java +++ b/src/mightypork/gamecore/resources/textures/QuadGrid.java @@ -1,7 +1,7 @@ -package mightypork.gamecore.render.textures; +package mightypork.gamecore.resources.textures; -import mightypork.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.Rect; /** diff --git a/src/mightypork/gamecore/render/textures/TextureBank.java b/src/mightypork/gamecore/resources/textures/TextureBank.java similarity index 88% rename from src/mightypork/gamecore/render/textures/TextureBank.java rename to src/mightypork/gamecore/resources/textures/TextureBank.java index 87728d7..c8994a1 100644 --- a/src/mightypork/gamecore/render/textures/TextureBank.java +++ b/src/mightypork/gamecore/resources/textures/TextureBank.java @@ -1,14 +1,14 @@ -package mightypork.gamecore.render.textures; +package mightypork.gamecore.resources.textures; import java.util.HashMap; import java.util.Map; -import mightypork.gamecore.control.AppAccess; -import mightypork.gamecore.control.AppAdapter; -import mightypork.gamecore.control.events.requests.ResourceLoadRequest; -import mightypork.util.error.KeyAlreadyExistsException; -import mightypork.util.math.constraints.rect.Rect; +import mightypork.gamecore.app.AppAccess; +import mightypork.gamecore.app.LightAppModule; +import mightypork.gamecore.resources.events.ResourceLoadRequest; +import mightypork.gamecore.util.error.KeyAlreadyExistsException; +import mightypork.gamecore.util.math.constraints.rect.Rect; /** @@ -16,7 +16,7 @@ import mightypork.util.math.constraints.rect.Rect; * * @author MightyPork */ -public class TextureBank extends AppAdapter { +public class TextureBank extends LightAppModule { private final Map textures = new HashMap<>(); private final Map quads = new HashMap<>(); diff --git a/src/mightypork/gamecore/render/textures/TxQuad.java b/src/mightypork/gamecore/resources/textures/TxQuad.java similarity index 93% rename from src/mightypork/gamecore/render/textures/TxQuad.java rename to src/mightypork/gamecore/resources/textures/TxQuad.java index 31d7ac7..24268d3 100644 --- a/src/mightypork/gamecore/render/textures/TxQuad.java +++ b/src/mightypork/gamecore/resources/textures/TxQuad.java @@ -1,8 +1,8 @@ -package mightypork.gamecore.render.textures; +package mightypork.gamecore.resources.textures; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.rect.RectConst; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.RectConst; /** diff --git a/src/mightypork/gamecore/render/textures/TxSheet.java b/src/mightypork/gamecore/resources/textures/TxSheet.java similarity index 96% rename from src/mightypork/gamecore/render/textures/TxSheet.java rename to src/mightypork/gamecore/resources/textures/TxSheet.java index 0145714..63cf162 100644 --- a/src/mightypork/gamecore/render/textures/TxSheet.java +++ b/src/mightypork/gamecore/resources/textures/TxSheet.java @@ -1,9 +1,9 @@ -package mightypork.gamecore.render.textures; +package mightypork.gamecore.resources.textures; import java.util.Random; -import mightypork.util.logging.Log; +import mightypork.gamecore.logging.Log; /** diff --git a/src/mightypork/gamecore/render/textures/WrapMode.java b/src/mightypork/gamecore/resources/textures/WrapMode.java similarity index 83% rename from src/mightypork/gamecore/render/textures/WrapMode.java rename to src/mightypork/gamecore/resources/textures/WrapMode.java index 921aa26..dd997f4 100644 --- a/src/mightypork/gamecore/render/textures/WrapMode.java +++ b/src/mightypork/gamecore/resources/textures/WrapMode.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.render.textures; +package mightypork.gamecore.resources.textures; import org.lwjgl.opengl.GL11; diff --git a/src/mightypork/rogue/util/Utils.java b/src/mightypork/gamecore/util/Utils.java similarity index 77% rename from src/mightypork/rogue/util/Utils.java rename to src/mightypork/gamecore/util/Utils.java index 5244890..49b1c38 100644 --- a/src/mightypork/rogue/util/Utils.java +++ b/src/mightypork/gamecore/util/Utils.java @@ -1,8 +1,8 @@ -package mightypork.rogue.util; +package mightypork.gamecore.util; /** - * Utils class + * Assorted utils * * @author MightyPork */ diff --git a/src/mightypork/util/annotations/DefaultImpl.java b/src/mightypork/gamecore/util/annot/DefaultImpl.java similarity index 93% rename from src/mightypork/util/annotations/DefaultImpl.java rename to src/mightypork/gamecore/util/annot/DefaultImpl.java index a74072c..7d1be2c 100644 --- a/src/mightypork/util/annotations/DefaultImpl.java +++ b/src/mightypork/gamecore/util/annot/DefaultImpl.java @@ -1,4 +1,4 @@ -package mightypork.util.annotations; +package mightypork.gamecore.util.annot; import java.lang.annotation.Documented; diff --git a/src/mightypork/util/annotations/FactoryMethod.java b/src/mightypork/gamecore/util/annot/FactoryMethod.java similarity index 91% rename from src/mightypork/util/annotations/FactoryMethod.java rename to src/mightypork/gamecore/util/annot/FactoryMethod.java index 604b27c..d287383 100644 --- a/src/mightypork/util/annotations/FactoryMethod.java +++ b/src/mightypork/gamecore/util/annot/FactoryMethod.java @@ -1,4 +1,4 @@ -package mightypork.util.annotations; +package mightypork.gamecore.util.annot; import java.lang.annotation.Documented; diff --git a/src/mightypork/util/error/CorruptedDataException.java b/src/mightypork/gamecore/util/error/CorruptedDataException.java similarity index 92% rename from src/mightypork/util/error/CorruptedDataException.java rename to src/mightypork/gamecore/util/error/CorruptedDataException.java index 134fd41..c026c9b 100644 --- a/src/mightypork/util/error/CorruptedDataException.java +++ b/src/mightypork/gamecore/util/error/CorruptedDataException.java @@ -1,4 +1,4 @@ -package mightypork.util.error; +package mightypork.gamecore.util.error; import java.io.IOException; diff --git a/src/mightypork/util/error/IllegalValueException.java b/src/mightypork/gamecore/util/error/IllegalValueException.java similarity index 93% rename from src/mightypork/util/error/IllegalValueException.java rename to src/mightypork/gamecore/util/error/IllegalValueException.java index 4ef4081..74d03bc 100644 --- a/src/mightypork/util/error/IllegalValueException.java +++ b/src/mightypork/gamecore/util/error/IllegalValueException.java @@ -1,4 +1,4 @@ -package mightypork.util.error; +package mightypork.gamecore.util.error; public class IllegalValueException extends RuntimeException { diff --git a/src/mightypork/util/error/KeyAlreadyExistsException.java b/src/mightypork/gamecore/util/error/KeyAlreadyExistsException.java similarity index 90% rename from src/mightypork/util/error/KeyAlreadyExistsException.java rename to src/mightypork/gamecore/util/error/KeyAlreadyExistsException.java index 43536cd..ac8c26c 100644 --- a/src/mightypork/util/error/KeyAlreadyExistsException.java +++ b/src/mightypork/gamecore/util/error/KeyAlreadyExistsException.java @@ -1,4 +1,4 @@ -package mightypork.util.error; +package mightypork.gamecore.util.error; public class KeyAlreadyExistsException extends RuntimeException { diff --git a/src/mightypork/util/string/filtering/FileSuffixFilter.java b/src/mightypork/gamecore/util/files/FileSuffixFilter.java similarity index 94% rename from src/mightypork/util/string/filtering/FileSuffixFilter.java rename to src/mightypork/gamecore/util/files/FileSuffixFilter.java index 614078a..cc50221 100644 --- a/src/mightypork/util/string/filtering/FileSuffixFilter.java +++ b/src/mightypork/gamecore/util/files/FileSuffixFilter.java @@ -1,4 +1,4 @@ -package mightypork.util.string.filtering; +package mightypork.gamecore.util.files; import java.io.File; diff --git a/src/mightypork/util/files/FileTreeDiff.java b/src/mightypork/gamecore/util/files/FileTreeDiff.java similarity index 97% rename from src/mightypork/util/files/FileTreeDiff.java rename to src/mightypork/gamecore/util/files/FileTreeDiff.java index 925c8fd..7961330 100644 --- a/src/mightypork/util/files/FileTreeDiff.java +++ b/src/mightypork/gamecore/util/files/FileTreeDiff.java @@ -1,4 +1,4 @@ -package mightypork.util.files; +package mightypork.gamecore.util.files; import java.io.File; @@ -12,7 +12,7 @@ import java.util.zip.Adler32; import java.util.zip.CheckedInputStream; import java.util.zip.Checksum; -import mightypork.util.logging.Log; +import mightypork.gamecore.logging.Log; public class FileTreeDiff { diff --git a/src/mightypork/util/files/FileUtils.java b/src/mightypork/gamecore/util/files/FileUtils.java similarity index 97% rename from src/mightypork/util/files/FileUtils.java rename to src/mightypork/gamecore/util/files/FileUtils.java index e019c95..e2fd102 100644 --- a/src/mightypork/util/files/FileUtils.java +++ b/src/mightypork/gamecore/util/files/FileUtils.java @@ -1,13 +1,13 @@ -package mightypork.util.files; +package mightypork.gamecore.util.files; import java.io.*; import java.util.ArrayList; import java.util.List; -import mightypork.util.logging.Log; -import mightypork.util.string.StringUtils; -import mightypork.util.string.filtering.StringFilter; +import mightypork.gamecore.logging.Log; +import mightypork.gamecore.util.strings.StringUtils; +import mightypork.gamecore.util.strings.filtering.StringFilter; public class FileUtils { @@ -72,7 +72,7 @@ public class FileUtils { } } else { - if (filter != null && !filter.accept(source.getAbsolutePath())) { return; } + if (filter != null && !filter.isValid(source.getAbsolutePath())) { return; } files.add(source); } diff --git a/src/mightypork/util/files/InstanceLock.java b/src/mightypork/gamecore/util/files/InstanceLock.java similarity index 96% rename from src/mightypork/util/files/InstanceLock.java rename to src/mightypork/gamecore/util/files/InstanceLock.java index 0af2375..6114a7a 100644 --- a/src/mightypork/util/files/InstanceLock.java +++ b/src/mightypork/gamecore/util/files/InstanceLock.java @@ -1,4 +1,4 @@ -package mightypork.util.files; +package mightypork.gamecore.util.files; import java.io.File; diff --git a/src/mightypork/util/files/OsUtils.java b/src/mightypork/gamecore/util/files/OsUtils.java similarity index 98% rename from src/mightypork/util/files/OsUtils.java rename to src/mightypork/gamecore/util/files/OsUtils.java index c505373..a17c267 100644 --- a/src/mightypork/util/files/OsUtils.java +++ b/src/mightypork/gamecore/util/files/OsUtils.java @@ -1,4 +1,4 @@ -package mightypork.util.files; +package mightypork.gamecore.util.files; import java.io.File; diff --git a/src/mightypork/util/files/config/PropertyManager.java b/src/mightypork/gamecore/util/files/config/PropertyManager.java similarity index 97% rename from src/mightypork/util/files/config/PropertyManager.java rename to src/mightypork/gamecore/util/files/config/PropertyManager.java index 894b716..24e47ee 100644 --- a/src/mightypork/util/files/config/PropertyManager.java +++ b/src/mightypork/gamecore/util/files/config/PropertyManager.java @@ -1,4 +1,4 @@ -package mightypork.util.files.config; +package mightypork.gamecore.util.files.config; import java.io.File; @@ -9,10 +9,10 @@ import java.util.ArrayList; import java.util.Map.Entry; import java.util.TreeMap; -import mightypork.util.math.Range; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.math.constraints.vect.VectConst; -import mightypork.util.objects.Convert; +import mightypork.gamecore.util.math.Range; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.VectConst; +import mightypork.gamecore.util.objects.Convert; /** diff --git a/src/mightypork/util/files/config/SimpleConfig.java b/src/mightypork/gamecore/util/files/config/SimpleConfig.java similarity index 97% rename from src/mightypork/util/files/config/SimpleConfig.java rename to src/mightypork/gamecore/util/files/config/SimpleConfig.java index d742a22..9d135f3 100644 --- a/src/mightypork/util/files/config/SimpleConfig.java +++ b/src/mightypork/gamecore/util/files/config/SimpleConfig.java @@ -1,4 +1,4 @@ -package mightypork.util.files.config; +package mightypork.gamecore.util.files.config; import java.io.File; @@ -9,8 +9,8 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; -import mightypork.util.files.FileUtils; -import mightypork.util.logging.Log; +import mightypork.gamecore.logging.Log; +import mightypork.gamecore.util.files.FileUtils; /** diff --git a/src/mightypork/util/files/config/SortedProperties.java b/src/mightypork/gamecore/util/files/config/SortedProperties.java similarity index 99% rename from src/mightypork/util/files/config/SortedProperties.java rename to src/mightypork/gamecore/util/files/config/SortedProperties.java index aeb2efe..32fca9e 100644 --- a/src/mightypork/util/files/config/SortedProperties.java +++ b/src/mightypork/gamecore/util/files/config/SortedProperties.java @@ -1,4 +1,4 @@ -package mightypork.util.files.config; +package mightypork.gamecore.util.files.config; import java.io.*; diff --git a/src/mightypork/util/files/zip/ZipBuilder.java b/src/mightypork/gamecore/util/files/zip/ZipBuilder.java similarity index 95% rename from src/mightypork/util/files/zip/ZipBuilder.java rename to src/mightypork/gamecore/util/files/zip/ZipBuilder.java index a6cbdef..a6469b5 100644 --- a/src/mightypork/util/files/zip/ZipBuilder.java +++ b/src/mightypork/gamecore/util/files/zip/ZipBuilder.java @@ -1,4 +1,4 @@ -package mightypork.util.files.zip; +package mightypork.gamecore.util.files.zip; import java.io.BufferedOutputStream; @@ -10,8 +10,8 @@ import java.util.HashSet; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; -import mightypork.util.files.FileUtils; -import mightypork.util.logging.Log; +import mightypork.gamecore.logging.Log; +import mightypork.gamecore.util.files.FileUtils; /** diff --git a/src/mightypork/util/files/zip/ZipUtils.java b/src/mightypork/gamecore/util/files/zip/ZipUtils.java similarity index 93% rename from src/mightypork/util/files/zip/ZipUtils.java rename to src/mightypork/gamecore/util/files/zip/ZipUtils.java index a136bcd..12f9d94 100644 --- a/src/mightypork/util/files/zip/ZipUtils.java +++ b/src/mightypork/gamecore/util/files/zip/ZipUtils.java @@ -1,4 +1,4 @@ -package mightypork.util.files.zip; +package mightypork.gamecore.util.files.zip; import java.io.*; @@ -8,9 +8,9 @@ import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; -import mightypork.util.files.FileUtils; -import mightypork.util.logging.Log; -import mightypork.util.string.filtering.StringFilter; +import mightypork.gamecore.logging.Log; +import mightypork.gamecore.util.files.FileUtils; +import mightypork.gamecore.util.strings.filtering.StringFilter; /** @@ -66,7 +66,7 @@ public class ZipUtils { final File destFile = new File(outputDir, entryPath); final File destinationParent = destFile.getParentFile(); - if (entry.isDirectory() || (filter != null && !filter.accept(entryPath))) continue; + if (entry.isDirectory() || (filter != null && !filter.isValid(entryPath))) continue; // make sure directories exist if (!destinationParent.mkdirs()) throw new IOException("Could not create directory."); diff --git a/src/mightypork/util/files/ion/Ion.java b/src/mightypork/gamecore/util/ion/Ion.java similarity index 67% rename from src/mightypork/util/files/ion/Ion.java rename to src/mightypork/gamecore/util/ion/Ion.java index 5a9a494..0007a92 100644 --- a/src/mightypork/util/files/ion/Ion.java +++ b/src/mightypork/gamecore/util/ion/Ion.java @@ -1,9 +1,9 @@ -package mightypork.util.files.ion; +package mightypork.gamecore.util.ion; import java.io.*; -import mightypork.util.logging.Log; +import mightypork.gamecore.logging.Log; /** @@ -63,8 +63,6 @@ public class Ion { /** Map wrapper for bundle */ static final int MAP_WRAPPER = 23; - // technical 20..39 - /** Ionizables */ @SuppressWarnings("rawtypes") private static Class[] registered = new Class[256]; @@ -75,29 +73,33 @@ public class Ion { reservedMarkChecking = false; // register built-ins - registerBinary(DATA_BUNDLE, IonBundle.class); - registerBinary(SEQUENCE_WRAPPER, IonSequenceWrapper.class); - registerBinary(MAP_WRAPPER, IonMapWrapper.class); + registerType(DATA_BUNDLE, IonBundle.class); + registerType(SEQUENCE_WRAPPER, IonSequenceWrapper.class); + registerType(MAP_WRAPPER, IonMapWrapper.class); reservedMarkChecking = true; } /** - * Register new {@link IonBinary} class for writing/loading. + * 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 registerBinary(int mark, Class objClass) + 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 (reservedMarkChecking && mark < 50) { + throw new IllegalArgumentException("Marks 0..49 are reserved."); + } - if (registered[mark] != null) { throw new IllegalArgumentException("Mark " + mark + " is already in use."); } + if (registered[mark] != null) { + throw new IllegalArgumentException("Mark " + mark + " is already in use."); + } try { objClass.getConstructor(); @@ -112,7 +114,7 @@ public class Ion { /** * Load binary from file and cast. */ - public static T fromFile(String path) throws IOException + public static T fromFile(String path) throws IOException { return fromFile(new File(path)); } @@ -121,9 +123,9 @@ public class Ion { /** * Load binary from file and cast. */ - public static T fromFile(File file) throws IOException + public static T fromFile(File file) throws IOException { - try(InputStream in = new FileInputStream(file)) { + try (InputStream in = new FileInputStream(file)) { return fromStream(in); } } @@ -132,7 +134,7 @@ public class Ion { /** * Load bundled from file and unwrap. */ - public static T fromFile(String path, Class objClass) throws IOException + public static T fromFile(String path, Class objClass) throws IOException { return fromFile(new File(path), objClass); } @@ -141,9 +143,9 @@ public class Ion { /** * Load bundled from file and unwrap. */ - public static T fromFile(File file, Class objClass) throws IOException + public static T fromFile(File file, Class objClass) throws IOException { - try(InputStream in = new FileInputStream(file)) { + try (InputStream in = new FileInputStream(file)) { return fromStream(in, objClass); @@ -151,7 +153,7 @@ public class Ion { } - public static void toFile(String path, IonBundled obj) throws IOException + public static void toFile(String path, IonObjBundled obj) throws IOException { toFile(new File(path), obj); } @@ -160,7 +162,7 @@ public class Ion { /** * Wrap bundled and save to file. */ - public static void toFile(File file, IonBundled obj) throws IOException + public static void toFile(File file, IonObjBundled obj) throws IOException { toFile(file, wrap(obj)); } @@ -169,7 +171,7 @@ public class Ion { /** * Write binary to file with mark. */ - public static void toFile(String path, IonBinary obj) throws IOException + public static void toFile(String path, IonObjBinary obj) throws IOException { toFile(new File(path), obj); } @@ -178,9 +180,9 @@ public class Ion { /** * Write binary to file with mark. */ - public static void toFile(File file, IonBinary obj) throws IOException + public static void toFile(File file, IonObjBinary obj) throws IOException { - try(OutputStream out = new FileOutputStream(file)) { + try (OutputStream out = new FileOutputStream(file)) { toStream(out, obj); @@ -206,7 +208,7 @@ public class Ion { /** * Load bundled object from stream, unwrap. */ - public static T fromStream(InputStream in, Class objClass) throws IOException + public static T fromStream(InputStream in, Class objClass) throws IOException { return unwrap((IonBundle) new IonInput(in).readObject(), objClass); } @@ -215,7 +217,7 @@ public class Ion { /** * Write object to output with a mark. */ - public static void toStream(OutputStream out, IonBinary obj) throws IOException + public static void toStream(OutputStream out, IonObjBinary obj) throws IOException { new IonOutput(out).writeObject(obj); } @@ -224,7 +226,7 @@ public class Ion { /** * Create new bundle and write the object to it. */ - public static IonBundle wrap(IonBundled content) throws IOException + public static IonBundle wrap(IonObjBundled content) throws IOException { final IonBundle ib = new IonBundle(); content.save(ib); @@ -241,7 +243,7 @@ public class Ion { * @return the object unwrapped * @throws IOException */ - public static T unwrap(IonBundle bundle, Class objClass) throws IOException + public static T unwrap(IonBundle bundle, Class objClass) throws IOException { try { final T inst = objClass.newInstance(); @@ -254,14 +256,14 @@ public class Ion { @SuppressWarnings("unchecked") - static Class getClassForMark(int mark) + static Class getClassForMark(int mark) { return registered[mark]; } /** - * @return true if the mark is for a registered {@link IonBinary} object + * @return true if the mark is for a registered {@link IonObjBinary} object */ static boolean isMarkForBinary(int mark) { @@ -274,15 +276,19 @@ public class Ion { * * @throws IOException if not registered or class mismatch */ - static void assertRegistered(IonBinary obj) throws IOException + static void assertRegistered(IonObjBinary obj) throws IOException { final int mark = obj.getIonMark(); - final Class clz = Ion.getClassForMark(mark); + final Class clz = Ion.getClassForMark(mark); - if (clz == null) { throw new IOException("Not registered - mark: " + mark + ", class: " + Log.str(obj.getClass())); } + 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())); } + if (clz != obj.getClass()) { + throw new IOException("Class mismatch - mark: " + mark + ", class: " + Log.str(obj.getClass())); + } } } diff --git a/src/mightypork/util/files/ion/IonBundle.java b/src/mightypork/gamecore/util/ion/IonBundle.java similarity index 84% rename from src/mightypork/util/files/ion/IonBundle.java rename to src/mightypork/gamecore/util/ion/IonBundle.java index 3aa301e..759b77b 100644 --- a/src/mightypork/util/files/ion/IonBundle.java +++ b/src/mightypork/gamecore/util/ion/IonBundle.java @@ -1,4 +1,4 @@ -package mightypork.util.files.ion; +package mightypork.gamecore.util.ion; import java.io.IOException; @@ -13,12 +13,12 @@ import java.util.Map; * * @author MightyPork */ -public class IonBundle implements IonBinary { +public class IonBundle implements IonObjBinary { private final Map backingMap = new HashMap<>(); - public void putBundled(String key, IonBundled saved) throws IOException + public void putBundled(String key, IonObjBundled saved) throws IOException { final IonBundle ib = new IonBundle(); saved.save(ib); @@ -26,19 +26,15 @@ public class IonBundle implements IonBinary { } - public T getBundled(String key, Class objClass) throws IOException + public T getBundled(String key, Class objClass) throws IOException { return Ion.unwrap(get(key, (IonBundle) null), objClass); } - public void loadBundled(String key, IonBundled loaded) throws IOException + public void loadBundled(String key, IonObjBundled loaded) throws IOException { - IonBundle ib = get(key, null); - - if (ib == null) ib = new IonBundle(); - - loaded.load(ib); + loaded.load(get(key, new IonBundle())); } @@ -46,7 +42,7 @@ public class IonBundle implements IonBinary { { if (!containsKey(key)) return; - final IonBundle ib = get(key, null); + final IonBundle ib = get(key, new IonBundle()); bundle.clear(); bundle.putAll(ib); @@ -100,12 +96,7 @@ public class IonBundle implements IonBinary { /** - *

- * Get an object. - *

- *

- * If not found or of type incompatible with fallback, fallback is returned. - *

+ * Get value, or fallback (if none found of with bad type). * * @param key * @param fallback value @@ -123,7 +114,19 @@ public class IonBundle implements IonBinary { } - public void put(String key, IonBinary value) + /** + * 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); @@ -134,7 +137,11 @@ public class IonBundle implements IonBinary { { backingMap.put(key, value); } - + + public void put(String key, byte value) + { + backingMap.put(key, value); + } public void put(String key, char value) { diff --git a/src/mightypork/util/files/ion/IonInput.java b/src/mightypork/gamecore/util/ion/IonInput.java similarity index 98% rename from src/mightypork/util/files/ion/IonInput.java rename to src/mightypork/gamecore/util/ion/IonInput.java index 92f6375..278259c 100644 --- a/src/mightypork/util/files/ion/IonInput.java +++ b/src/mightypork/gamecore/util/ion/IonInput.java @@ -1,4 +1,4 @@ -package mightypork.util.files.ion; +package mightypork.gamecore.util.ion; import java.io.DataInput; @@ -10,7 +10,7 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; -import mightypork.util.error.CorruptedDataException; +import mightypork.gamecore.util.error.CorruptedDataException; /** @@ -287,7 +287,7 @@ public class IonInput { { final int mark = readMark(); if (Ion.isMarkForBinary(mark)) { - IonBinary loaded; + IonObjBinary loaded; try { diff --git a/src/mightypork/util/files/ion/IonMapWrapper.java b/src/mightypork/gamecore/util/ion/IonMapWrapper.java similarity index 87% rename from src/mightypork/util/files/ion/IonMapWrapper.java rename to src/mightypork/gamecore/util/ion/IonMapWrapper.java index 2724dfe..ec505b5 100644 --- a/src/mightypork/util/files/ion/IonMapWrapper.java +++ b/src/mightypork/gamecore/util/ion/IonMapWrapper.java @@ -1,4 +1,4 @@ -package mightypork.util.files.ion; +package mightypork.gamecore.util.ion; import java.io.IOException; @@ -7,7 +7,7 @@ import java.util.Map; @SuppressWarnings({ "rawtypes", "unchecked" }) -public class IonMapWrapper implements IonBinary { +public class IonMapWrapper implements IonObjBinary { private final Map map; diff --git a/src/mightypork/util/files/ion/IonBinary.java b/src/mightypork/gamecore/util/ion/IonObjBinary.java similarity index 69% rename from src/mightypork/util/files/ion/IonBinary.java rename to src/mightypork/gamecore/util/ion/IonObjBinary.java index ffe6745..8240dd8 100644 --- a/src/mightypork/util/files/ion/IonBinary.java +++ b/src/mightypork/gamecore/util/ion/IonObjBinary.java @@ -1,4 +1,4 @@ -package mightypork.util.files.ion; +package mightypork.gamecore.util.ion; /** @@ -6,7 +6,7 @@ package mightypork.util.files.ion; * * @author MightyPork */ -public interface IonBinary extends IonBinaryHeadless { +public interface IonObjBinary extends IonObjBlob { /** * Get Ion mark byte. diff --git a/src/mightypork/util/files/ion/IonBinaryHeadless.java b/src/mightypork/gamecore/util/ion/IonObjBlob.java similarity index 87% rename from src/mightypork/util/files/ion/IonBinaryHeadless.java rename to src/mightypork/gamecore/util/ion/IonObjBlob.java index fec0ef9..834974a 100644 --- a/src/mightypork/util/files/ion/IonBinaryHeadless.java +++ b/src/mightypork/gamecore/util/ion/IonObjBlob.java @@ -1,4 +1,4 @@ -package mightypork.util.files.ion; +package mightypork.gamecore.util.ion; import java.io.IOException; @@ -9,7 +9,7 @@ import java.io.IOException; * * @author MightyPork */ -public interface IonBinaryHeadless { +public interface IonObjBlob { /** * Load data from the input stream. diff --git a/src/mightypork/util/files/ion/IonBundled.java b/src/mightypork/gamecore/util/ion/IonObjBundled.java similarity index 73% rename from src/mightypork/util/files/ion/IonBundled.java rename to src/mightypork/gamecore/util/ion/IonObjBundled.java index 7f4622c..4d5a462 100644 --- a/src/mightypork/util/files/ion/IonBundled.java +++ b/src/mightypork/gamecore/util/ion/IonObjBundled.java @@ -1,4 +1,4 @@ -package mightypork.util.files.ion; +package mightypork.gamecore.util.ion; import java.io.IOException; @@ -9,7 +9,7 @@ import java.io.IOException; * * @author MightyPork */ -public interface IonBundled { +public interface IonObjBundled { void load(IonBundle bundle) throws IOException; diff --git a/src/mightypork/util/files/ion/IonOutput.java b/src/mightypork/gamecore/util/ion/IonOutput.java similarity index 95% rename from src/mightypork/util/files/ion/IonOutput.java rename to src/mightypork/gamecore/util/ion/IonOutput.java index 610c756..08e6fa5 100644 --- a/src/mightypork/util/files/ion/IonOutput.java +++ b/src/mightypork/gamecore/util/ion/IonOutput.java @@ -1,4 +1,4 @@ -package mightypork.util.files.ion; +package mightypork.gamecore.util.ion; import java.io.DataOutput; @@ -9,7 +9,7 @@ import java.util.Collection; import java.util.Map; import java.util.Map.Entry; -import mightypork.util.logging.Log; +import mightypork.gamecore.logging.Log; /** @@ -269,9 +269,9 @@ public class IonOutput { return; } - if (obj instanceof IonBinary) { + if (obj instanceof IonObjBinary) { - final IonBinary ionObject = (IonBinary) obj; + final IonObjBinary ionObject = (IonObjBinary) obj; Ion.assertRegistered(ionObject); @@ -281,7 +281,7 @@ public class IonOutput { return; } - if (obj instanceof IonBundled) { throw new IOException("Bundled objects cannot be written to ION stream directly at " + obj); } + 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); diff --git a/src/mightypork/util/files/ion/IonSequenceWrapper.java b/src/mightypork/gamecore/util/ion/IonSequenceWrapper.java similarity index 88% rename from src/mightypork/util/files/ion/IonSequenceWrapper.java rename to src/mightypork/gamecore/util/ion/IonSequenceWrapper.java index e9edb2b..5396f39 100644 --- a/src/mightypork/util/files/ion/IonSequenceWrapper.java +++ b/src/mightypork/gamecore/util/ion/IonSequenceWrapper.java @@ -1,4 +1,4 @@ -package mightypork.util.files.ion; +package mightypork.gamecore.util.ion; import java.io.IOException; @@ -7,7 +7,7 @@ import java.util.Collection; @SuppressWarnings({ "rawtypes", "unchecked" }) -public class IonSequenceWrapper implements IonBinary { +public class IonSequenceWrapper implements IonObjBinary { private Collection collection = new ArrayList(); diff --git a/src/mightypork/util/math/Calc.java b/src/mightypork/gamecore/util/math/Calc.java similarity index 99% rename from src/mightypork/util/math/Calc.java rename to src/mightypork/gamecore/util/math/Calc.java index 562c94e..b036f7d 100644 --- a/src/mightypork/util/math/Calc.java +++ b/src/mightypork/gamecore/util/math/Calc.java @@ -1,4 +1,4 @@ -package mightypork.util.math; +package mightypork.gamecore.util.math; import java.nio.FloatBuffer; @@ -6,7 +6,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; -import mightypork.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.Vect; import org.lwjgl.BufferUtils; diff --git a/src/mightypork/util/math/Easing.java b/src/mightypork/gamecore/util/math/Easing.java similarity index 98% rename from src/mightypork/util/math/Easing.java rename to src/mightypork/gamecore/util/math/Easing.java index 4cf0593..24737be 100644 --- a/src/mightypork/util/math/Easing.java +++ b/src/mightypork/gamecore/util/math/Easing.java @@ -1,7 +1,7 @@ -package mightypork.util.math; +package mightypork.gamecore.util.math; -import mightypork.util.annotations.FactoryMethod; +import mightypork.gamecore.util.annot.FactoryMethod; /** diff --git a/src/mightypork/util/math/Polar.java b/src/mightypork/gamecore/util/math/Polar.java similarity index 96% rename from src/mightypork/util/math/Polar.java rename to src/mightypork/gamecore/util/math/Polar.java index ec378ab..7f2c24a 100644 --- a/src/mightypork/util/math/Polar.java +++ b/src/mightypork/gamecore/util/math/Polar.java @@ -1,7 +1,7 @@ -package mightypork.util.math; +package mightypork.gamecore.util.math; -import mightypork.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.Vect; /** diff --git a/src/mightypork/util/math/Range.java b/src/mightypork/gamecore/util/math/Range.java similarity index 98% rename from src/mightypork/util/math/Range.java rename to src/mightypork/gamecore/util/math/Range.java index 5900a8b..c56149c 100644 --- a/src/mightypork/util/math/Range.java +++ b/src/mightypork/gamecore/util/math/Range.java @@ -1,4 +1,4 @@ -package mightypork.util.math; +package mightypork.gamecore.util.math; import java.util.Random; diff --git a/src/mightypork/rogue/world/Coord.java b/src/mightypork/gamecore/util/math/algo/Coord.java similarity index 58% rename from src/mightypork/rogue/world/Coord.java rename to src/mightypork/gamecore/util/math/algo/Coord.java index ecef169..024c365 100644 --- a/src/mightypork/rogue/world/Coord.java +++ b/src/mightypork/gamecore/util/math/algo/Coord.java @@ -1,20 +1,27 @@ -package mightypork.rogue.world; +package mightypork.gamecore.util.math.algo; import java.io.IOException; -import mightypork.util.annotations.FactoryMethod; -import mightypork.util.files.ion.IonBundle; -import mightypork.util.files.ion.IonBundled; -import mightypork.util.math.Calc; +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; /** - * Coordinate + * Very simple integer coordinate * * @author MightyPork */ -public class Coord implements IonBundled { +public class Coord implements IonObjBundled, IonObjBinary { + + public static final short ION_MARK = 255; public int x; public int y; @@ -41,16 +48,14 @@ public class Coord implements IonBundled { } - public Coord(int x, int y) - { + public Coord(int x, int y) { super(); this.x = x; this.y = y; } - public Coord(Coord other) - { + public Coord(Coord other) { this.x = other.x; this.y = other.y; } @@ -62,9 +67,21 @@ public class Coord implements IonBundled { } - public Coord add(Coord other) + /** + * Add other coord in a copy + * + * @param added + * @return changed copy + */ + public Coord add(Coord added) + { + return add(added.x, added.y); + } + + + public Coord add(Step added) { - return add(other.x, other.y); + return add(added.x(), added.y()); } @@ -96,19 +113,15 @@ public class Coord implements IonBundled { } - @Override - public void load(IonBundle bundle) throws IOException + public double dist(Coord coord) { - x = bundle.get("x", 0); - y = bundle.get("y", 0); + return Calc.dist(x, y, coord.x, coord.y); } - @Override - public void save(IonBundle bundle) throws IOException + public VectConst toVect() { - bundle.put("x", x); - bundle.put("y", y); + return Vect.make(x, y); } @@ -143,8 +156,41 @@ public class Coord implements IonBundled { } - public double dist(Coord coord) + @Override + public void load(IonInput in) throws IOException { - return Calc.dist(x, y, coord.x, coord.y); + x = in.readInt(); + y = in.readInt(); + } + + + @Override + public void save(IonOutput out) throws IOException + { + out.writeInt(x); + out.writeInt(y); + } + + + @Override + public void load(IonBundle bundle) throws IOException + { + x = bundle.get("x", 0); + y = bundle.get("y", 0); + } + + + @Override + public void save(IonBundle bundle) throws IOException + { + bundle.put("x", x); + bundle.put("y", y); + } + + + @Override + public short getIonMark() + { + return ION_MARK; } } diff --git a/src/mightypork/gamecore/util/math/algo/Sides.java b/src/mightypork/gamecore/util/math/algo/Sides.java new file mode 100644 index 0000000..c4110b1 --- /dev/null +++ b/src/mightypork/gamecore/util/math/algo/Sides.java @@ -0,0 +1,60 @@ +package mightypork.gamecore.util.math.algo; + + +public class Sides { + + public static final byte NW = (byte) 0b10000000; + public static final byte N = (byte) 0b01000000; + public static final byte NE = (byte) 0b00100000; + public static final byte E = (byte) 0b00010000; + public static final byte SE = (byte) 0b00001000; + public static final byte S = (byte) 0b00000100; + public static final byte SW = (byte) 0b00000010; + public static final byte W = (byte) 0b00000001; + + public static final byte CARDINAL = N | S | E | W; + public static final byte DIAGONAL = NE | NW | SE | SW; + + public static final byte NW_CORNER = W | NW | N; + public static final byte NE_CORNER = E | NE | N; + public static final byte SW_CORNER = W | SW | S; + public static final byte SE_CORNER = E | SE | S; + + //@formatter:off + public final static Step[] allSides = { + Step.make(-1, -1), + Step.make(0, -1), + Step.make(1, -1), + Step.make(1, 0), + Step.make(1, 1), + Step.make(0, 1), + Step.make(-1, 1), + Step.make(-1, 0) + }; + + public final static Step[] cardinalSides = { + Step.make(0, -1), + Step.make(1, 0), + Step.make(0, 1), + Step.make(-1, 0) + }; + + //@formatter:on + + /** + * Get element from all sides + * + * @param i side index + * @return the side coord + */ + public static Step get(int i) + { + return allSides[i]; + } + + + public static byte bit(int i) + { + return (byte) (1 << (7 - i)); + } +} diff --git a/src/mightypork/gamecore/util/math/algo/Step.java b/src/mightypork/gamecore/util/math/algo/Step.java new file mode 100644 index 0000000..57290b3 --- /dev/null +++ b/src/mightypork/gamecore/util/math/algo/Step.java @@ -0,0 +1,117 @@ +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; + + +/** + * Path step.
+ * Must be binary in order to be saveable in lists. + * + * @author MightyPork + */ +public class Step implements IonObjBinary, IonObjBundled { + + public static final int ION_MARK = 254; + + public static final Step NORTH = new Step(0, -1); + public static final Step SOUTH = new Step(0, 1); + public static final Step EAST = new Step(1, 0); + public static final Step WEST = new Step(-1, 0); + public static final Step NONE = new Step(0, 0); + + + public static Step make(int x, int y) + { + x = x < 0 ? -1 : x > 0 ? 1 : 0; + y = y < 0 ? -1 : y > 0 ? 1 : 0; + + if (y == -1 && x == 0) return NORTH; + if (y == 1 && x == 0) return SOUTH; + if (x == -1 && y == 0) return WEST; + if (x == 1 && y == 0) return EAST; + if (x == 0 && y == 0) return NONE; + + return new Step(x, y); + } + + private byte x; + private byte y; + + + public Step(int x, int y) { + this.x = (byte) (x < 0 ? -1 : x > 0 ? 1 : 0); + this.y = (byte) (y < 0 ? -1 : y > 0 ? 1 : 0); + } + + + public int x() + { + return x; + } + + + public int y() + { + return y; + } + + + + public Coord toCoord() + { + return Coord.make(x, y); + } + + + @Override + public short getIonMark() + { + return ION_MARK; + } + + + @Override + public String toString() + { + return "(" + x + ";" + y + ")"; + } + + + @Override + public void load(IonInput in) throws IOException + { + x = in.readByte(); + y = in.readByte(); + } + + + @Override + public void save(IonOutput out) throws IOException + { + 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/rogue/world/pathfinding/FillContext.java b/src/mightypork/gamecore/util/math/algo/floodfill/FillContext.java similarity index 67% rename from src/mightypork/rogue/world/pathfinding/FillContext.java rename to src/mightypork/gamecore/util/math/algo/floodfill/FillContext.java index 7982bea..9df70d3 100644 --- a/src/mightypork/rogue/world/pathfinding/FillContext.java +++ b/src/mightypork/gamecore/util/math/algo/floodfill/FillContext.java @@ -1,7 +1,8 @@ -package mightypork.rogue.world.pathfinding; +package mightypork.gamecore.util.math.algo.floodfill; -import mightypork.rogue.world.Coord; +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.algo.Step; public interface FillContext { @@ -12,7 +13,7 @@ public interface FillContext { boolean canSpreadFrom(Coord pos); - Coord[] getSpreadSides(); + Step[] getSpreadSides(); /** diff --git a/src/mightypork/rogue/world/pathfinding/FloodFill.java b/src/mightypork/gamecore/util/math/algo/floodfill/FloodFill.java similarity index 84% rename from src/mightypork/rogue/world/pathfinding/FloodFill.java rename to src/mightypork/gamecore/util/math/algo/floodfill/FloodFill.java index 0727309..a57f3f9 100644 --- a/src/mightypork/rogue/world/pathfinding/FloodFill.java +++ b/src/mightypork/gamecore/util/math/algo/floodfill/FloodFill.java @@ -1,11 +1,12 @@ -package mightypork.rogue.world.pathfinding; +package mightypork.gamecore.util.math.algo.floodfill; import java.util.Collection; import java.util.LinkedList; import java.util.Queue; -import mightypork.rogue.world.Coord; +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.algo.Step; public class FloodFill { @@ -26,7 +27,7 @@ public class FloodFill { activeNodes.add(start); - final Coord[] sides = context.getSpreadSides(); + final Step[] sides = context.getSpreadSides(); boolean forceSpreadNext = context.forceSpreadStart(); boolean limitReached = false; @@ -39,8 +40,7 @@ public class FloodFill { forceSpreadNext = false; - - for (final Coord spr : sides) { + for (final Step spr : sides) { final Coord next = current.add(spr); if (activeNodes.contains(next) || foundNodes.contains(next)) continue; diff --git a/src/mightypork/rogue/world/pathfinding/Heuristic.java b/src/mightypork/gamecore/util/math/algo/pathfinding/Heuristic.java similarity index 72% rename from src/mightypork/rogue/world/pathfinding/Heuristic.java rename to src/mightypork/gamecore/util/math/algo/pathfinding/Heuristic.java index 2062c4c..2b79d9a 100644 --- a/src/mightypork/rogue/world/pathfinding/Heuristic.java +++ b/src/mightypork/gamecore/util/math/algo/pathfinding/Heuristic.java @@ -1,7 +1,7 @@ -package mightypork.rogue.world.pathfinding; +package mightypork.gamecore.util.math.algo.pathfinding; -import mightypork.rogue.world.Coord; +import mightypork.gamecore.util.math.algo.Coord; public abstract class Heuristic { diff --git a/src/mightypork/rogue/world/pathfinding/PathFinder.java b/src/mightypork/gamecore/util/math/algo/pathfinding/PathFinder.java similarity index 85% rename from src/mightypork/rogue/world/pathfinding/PathFinder.java rename to src/mightypork/gamecore/util/math/algo/pathfinding/PathFinder.java index b104bc8..0ae33cd 100644 --- a/src/mightypork/rogue/world/pathfinding/PathFinder.java +++ b/src/mightypork/gamecore/util/math/algo/pathfinding/PathFinder.java @@ -1,4 +1,4 @@ -package mightypork.rogue.world.pathfinding; +package mightypork.gamecore.util.math.algo.pathfinding; import java.util.ArrayList; @@ -7,8 +7,10 @@ import java.util.Comparator; import java.util.LinkedList; import java.util.List; -import mightypork.rogue.world.Coord; -import mightypork.rogue.world.entity.PathStep; +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.algo.Step; +import mightypork.gamecore.util.math.algo.pathfinding.heuristics.DiagonalHeuristic; +import mightypork.gamecore.util.math.algo.pathfinding.heuristics.ManhattanHeuristic; /** @@ -24,17 +26,17 @@ public class PathFinder { public static final Heuristic DIAGONAL_HEURISTIC = new DiagonalHeuristic(); - public static List findPathRelative(PathFindingContext context, Coord start, Coord end) + public static List findPathRelative(PathFindingContext context, Coord start, Coord end) { final List path = findPath(context, start, end); if (path == null) return null; - final List out = new ArrayList<>(); + final List out = new ArrayList<>(); final Coord current = start.copy(); for (final Coord c : path) { if (c.equals(current)) continue; - out.add(PathStep.make(c.x - current.x, c.y - current.y)); + out.add(Step.make(c.x - current.x, c.y - current.y)); current.x = c.x; current.y = c.y; } @@ -58,7 +60,7 @@ public class PathFinder { open.add(n); } - final Coord[] walkDirs = context.getWalkSides(); + final Step[] walkDirs = context.getWalkSides(); Node current = null; @@ -75,7 +77,7 @@ public class PathFinder { break; } - for (final Coord go : walkDirs) { + for (final Step go : walkDirs) { final Coord c = current.pos.add(go); if (!context.isAccessible(c)) continue; diff --git a/src/mightypork/rogue/world/pathfinding/PathFindingContext.java b/src/mightypork/gamecore/util/math/algo/pathfinding/PathFindingContext.java similarity index 74% rename from src/mightypork/rogue/world/pathfinding/PathFindingContext.java rename to src/mightypork/gamecore/util/math/algo/pathfinding/PathFindingContext.java index a27af79..79fa034 100644 --- a/src/mightypork/rogue/world/pathfinding/PathFindingContext.java +++ b/src/mightypork/gamecore/util/math/algo/pathfinding/PathFindingContext.java @@ -1,7 +1,8 @@ -package mightypork.rogue.world.pathfinding; +package mightypork.gamecore.util.math.algo.pathfinding; -import mightypork.rogue.world.Coord; +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.algo.Step; public interface PathFindingContext { @@ -35,5 +36,5 @@ public interface PathFindingContext { Heuristic getHeuristic(); - Coord[] getWalkSides(); + Step[] getWalkSides(); } diff --git a/src/mightypork/gamecore/util/math/algo/pathfinding/PathFindingContextProxy.java b/src/mightypork/gamecore/util/math/algo/pathfinding/PathFindingContextProxy.java new file mode 100644 index 0000000..64fad5d --- /dev/null +++ b/src/mightypork/gamecore/util/math/algo/pathfinding/PathFindingContextProxy.java @@ -0,0 +1,58 @@ +package mightypork.gamecore.util.math.algo.pathfinding; + + +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.algo.Step; + + +/** + * Pathfinding context proxy. Can be used to override individual methods but + * keep the rest as is. + * + * @author MightyPork + */ +public class PathFindingContextProxy implements PathFindingContext { + + private PathFindingContext source; + + + public PathFindingContextProxy(PathFindingContext other) { + this.source = other; + } + + + @Override + public boolean isAccessible(Coord pos) + { + return source.isAccessible(pos); + } + + + @Override + public int getCost(Coord from, Coord to) + { + return source.getCost(from, to); + } + + + @Override + public int getMinCost() + { + return source.getMinCost(); + } + + + @Override + public Heuristic getHeuristic() + { + return source.getHeuristic(); + } + + + @Override + public Step[] getWalkSides() + { + return source.getWalkSides(); + } + +} diff --git a/src/mightypork/rogue/world/pathfinding/DiagonalHeuristic.java b/src/mightypork/gamecore/util/math/algo/pathfinding/heuristics/DiagonalHeuristic.java similarity index 53% rename from src/mightypork/rogue/world/pathfinding/DiagonalHeuristic.java rename to src/mightypork/gamecore/util/math/algo/pathfinding/heuristics/DiagonalHeuristic.java index adffef5..7a939e7 100644 --- a/src/mightypork/rogue/world/pathfinding/DiagonalHeuristic.java +++ b/src/mightypork/gamecore/util/math/algo/pathfinding/heuristics/DiagonalHeuristic.java @@ -1,7 +1,8 @@ -package mightypork.rogue.world.pathfinding; +package mightypork.gamecore.util.math.algo.pathfinding.heuristics; -import mightypork.rogue.world.Coord; +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.algo.pathfinding.Heuristic; public class DiagonalHeuristic extends Heuristic { diff --git a/src/mightypork/rogue/world/pathfinding/ManhattanHeuristic.java b/src/mightypork/gamecore/util/math/algo/pathfinding/heuristics/ManhattanHeuristic.java similarity index 51% rename from src/mightypork/rogue/world/pathfinding/ManhattanHeuristic.java rename to src/mightypork/gamecore/util/math/algo/pathfinding/heuristics/ManhattanHeuristic.java index fa26a30..8c1a506 100644 --- a/src/mightypork/rogue/world/pathfinding/ManhattanHeuristic.java +++ b/src/mightypork/gamecore/util/math/algo/pathfinding/heuristics/ManhattanHeuristic.java @@ -1,7 +1,8 @@ -package mightypork.rogue.world.pathfinding; +package mightypork.gamecore.util.math.algo.pathfinding.heuristics; -import mightypork.rogue.world.Coord; +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.algo.pathfinding.Heuristic; public class ManhattanHeuristic extends Heuristic { diff --git a/src/mightypork/util/math/color/Color.java b/src/mightypork/gamecore/util/math/color/Color.java similarity index 96% rename from src/mightypork/util/math/color/Color.java rename to src/mightypork/gamecore/util/math/color/Color.java index 91eb9a6..d92bc08 100644 --- a/src/mightypork/util/math/color/Color.java +++ b/src/mightypork/gamecore/util/math/color/Color.java @@ -1,12 +1,12 @@ -package mightypork.util.math.color; +package mightypork.gamecore.util.math.color; import java.util.EmptyStackException; import java.util.Stack; -import mightypork.util.annotations.FactoryMethod; -import mightypork.util.math.Calc; -import mightypork.util.math.constraints.num.Num; +import mightypork.gamecore.util.annot.FactoryMethod; +import mightypork.gamecore.util.math.Calc; +import mightypork.gamecore.util.math.constraints.num.Num; /** diff --git a/src/mightypork/util/math/color/ColorAlphaAdjuster.java b/src/mightypork/gamecore/util/math/color/ColorAlphaAdjuster.java similarity index 83% rename from src/mightypork/util/math/color/ColorAlphaAdjuster.java rename to src/mightypork/gamecore/util/math/color/ColorAlphaAdjuster.java index b92cca4..58bfbb2 100644 --- a/src/mightypork/util/math/color/ColorAlphaAdjuster.java +++ b/src/mightypork/gamecore/util/math/color/ColorAlphaAdjuster.java @@ -1,7 +1,7 @@ -package mightypork.util.math.color; +package mightypork.gamecore.util.math.color; -import mightypork.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.Num; public class ColorAlphaAdjuster extends Color { diff --git a/src/mightypork/util/math/color/ColorHsb.java b/src/mightypork/gamecore/util/math/color/ColorHsb.java similarity index 88% rename from src/mightypork/util/math/color/ColorHsb.java rename to src/mightypork/gamecore/util/math/color/ColorHsb.java index 673da54..1bb2123 100644 --- a/src/mightypork/util/math/color/ColorHsb.java +++ b/src/mightypork/gamecore/util/math/color/ColorHsb.java @@ -1,7 +1,7 @@ -package mightypork.util.math.color; +package mightypork.gamecore.util.math.color; -import mightypork.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.Num; public class ColorHsb extends Color { diff --git a/src/mightypork/util/math/color/ColorRgb.java b/src/mightypork/gamecore/util/math/color/ColorRgb.java similarity index 82% rename from src/mightypork/util/math/color/ColorRgb.java rename to src/mightypork/gamecore/util/math/color/ColorRgb.java index 9e1eb09..020e1b2 100644 --- a/src/mightypork/util/math/color/ColorRgb.java +++ b/src/mightypork/gamecore/util/math/color/ColorRgb.java @@ -1,7 +1,7 @@ -package mightypork.util.math.color; +package mightypork.gamecore.util.math.color; -import mightypork.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.Num; public class ColorRgb extends Color { diff --git a/src/mightypork/util/math/color/CGA.java b/src/mightypork/gamecore/util/math/color/pal/CGA.java similarity index 88% rename from src/mightypork/util/math/color/CGA.java rename to src/mightypork/gamecore/util/math/color/pal/CGA.java index e3e142d..683f9e2 100644 --- a/src/mightypork/util/math/color/CGA.java +++ b/src/mightypork/gamecore/util/math/color/pal/CGA.java @@ -1,4 +1,6 @@ -package mightypork.util.math.color; +package mightypork.gamecore.util.math.color.pal; + +import mightypork.gamecore.util.math.color.Color; /** diff --git a/src/mightypork/util/math/color/COMMODORE.java b/src/mightypork/gamecore/util/math/color/pal/COMMODORE.java similarity index 88% rename from src/mightypork/util/math/color/COMMODORE.java rename to src/mightypork/gamecore/util/math/color/pal/COMMODORE.java index ab8ad61..7bb687d 100644 --- a/src/mightypork/util/math/color/COMMODORE.java +++ b/src/mightypork/gamecore/util/math/color/pal/COMMODORE.java @@ -1,4 +1,6 @@ -package mightypork.util.math.color; +package mightypork.gamecore.util.math.color.pal; + +import mightypork.gamecore.util.math.color.Color; /** diff --git a/src/mightypork/util/math/color/PAL16.java b/src/mightypork/gamecore/util/math/color/pal/PAL16.java similarity index 89% rename from src/mightypork/util/math/color/PAL16.java rename to src/mightypork/gamecore/util/math/color/pal/PAL16.java index 42922f8..6d581c7 100644 --- a/src/mightypork/util/math/color/PAL16.java +++ b/src/mightypork/gamecore/util/math/color/pal/PAL16.java @@ -1,4 +1,6 @@ -package mightypork.util.math.color; +package mightypork.gamecore.util.math.color.pal; + +import mightypork.gamecore.util.math.color.Color; /** diff --git a/src/mightypork/util/math/color/RGB.java b/src/mightypork/gamecore/util/math/color/pal/RGB.java similarity index 85% rename from src/mightypork/util/math/color/RGB.java rename to src/mightypork/gamecore/util/math/color/pal/RGB.java index 572b2ae..14a9a9a 100644 --- a/src/mightypork/util/math/color/RGB.java +++ b/src/mightypork/gamecore/util/math/color/pal/RGB.java @@ -1,4 +1,6 @@ -package mightypork.util.math.color; +package mightypork.gamecore.util.math.color.pal; + +import mightypork.gamecore.util.math.color.Color; /** diff --git a/src/mightypork/util/math/color/ZX.java b/src/mightypork/gamecore/util/math/color/pal/ZX.java similarity index 88% rename from src/mightypork/util/math/color/ZX.java rename to src/mightypork/gamecore/util/math/color/pal/ZX.java index 418082a..ac8f94a 100644 --- a/src/mightypork/util/math/color/ZX.java +++ b/src/mightypork/gamecore/util/math/color/pal/ZX.java @@ -1,4 +1,6 @@ -package mightypork.util.math.color; +package mightypork.gamecore.util.math.color.pal; + +import mightypork.gamecore.util.math.color.Color; /** diff --git a/src/mightypork/util/math/constraints/ConstraintCache.java b/src/mightypork/gamecore/util/math/constraints/ConstraintCache.java similarity index 92% rename from src/mightypork/util/math/constraints/ConstraintCache.java rename to src/mightypork/gamecore/util/math/constraints/ConstraintCache.java index f509531..024589a 100644 --- a/src/mightypork/util/math/constraints/ConstraintCache.java +++ b/src/mightypork/gamecore/util/math/constraints/ConstraintCache.java @@ -1,4 +1,4 @@ -package mightypork.util.math.constraints; +package mightypork.gamecore.util.math.constraints; /** diff --git a/src/mightypork/util/math/constraints/DigestCache.java b/src/mightypork/gamecore/util/math/constraints/DigestCache.java similarity index 94% rename from src/mightypork/util/math/constraints/DigestCache.java rename to src/mightypork/gamecore/util/math/constraints/DigestCache.java index 69fe9f0..ea427db 100644 --- a/src/mightypork/util/math/constraints/DigestCache.java +++ b/src/mightypork/gamecore/util/math/constraints/DigestCache.java @@ -1,4 +1,4 @@ -package mightypork.util.math.constraints; +package mightypork.gamecore.util.math.constraints; /** diff --git a/src/mightypork/util/math/constraints/Digestable.java b/src/mightypork/gamecore/util/math/constraints/Digestable.java similarity index 96% rename from src/mightypork/util/math/constraints/Digestable.java rename to src/mightypork/gamecore/util/math/constraints/Digestable.java index 7d85ad9..287b594 100644 --- a/src/mightypork/util/math/constraints/Digestable.java +++ b/src/mightypork/gamecore/util/math/constraints/Digestable.java @@ -1,4 +1,4 @@ -package mightypork.util.math.constraints; +package mightypork.gamecore.util.math.constraints; /** diff --git a/src/mightypork/util/math/constraints/Pollable.java b/src/mightypork/gamecore/util/math/constraints/Pollable.java similarity index 75% rename from src/mightypork/util/math/constraints/Pollable.java rename to src/mightypork/gamecore/util/math/constraints/Pollable.java index d838aae..c2b98b1 100644 --- a/src/mightypork/util/math/constraints/Pollable.java +++ b/src/mightypork/gamecore/util/math/constraints/Pollable.java @@ -1,4 +1,4 @@ -package mightypork.util.math.constraints; +package mightypork.gamecore.util.math.constraints; /** diff --git a/src/mightypork/util/math/constraints/Poller.java b/src/mightypork/gamecore/util/math/constraints/Poller.java similarity index 91% rename from src/mightypork/util/math/constraints/Poller.java rename to src/mightypork/gamecore/util/math/constraints/Poller.java index c188e99..3b40238 100644 --- a/src/mightypork/util/math/constraints/Poller.java +++ b/src/mightypork/gamecore/util/math/constraints/Poller.java @@ -1,4 +1,4 @@ -package mightypork.util.math.constraints; +package mightypork.gamecore.util.math.constraints; import java.util.LinkedHashSet; diff --git a/src/mightypork/util/math/constraints/num/Num.java b/src/mightypork/gamecore/util/math/constraints/num/Num.java similarity index 93% rename from src/mightypork/util/math/constraints/num/Num.java rename to src/mightypork/gamecore/util/math/constraints/num/Num.java index aa9fc30..34ebb30 100644 --- a/src/mightypork/util/math/constraints/num/Num.java +++ b/src/mightypork/gamecore/util/math/constraints/num/Num.java @@ -1,16 +1,16 @@ -package mightypork.util.math.constraints.num; +package mightypork.gamecore.util.math.constraints.num; -import mightypork.util.annotations.FactoryMethod; -import mightypork.util.math.Calc; -import mightypork.util.math.constraints.DigestCache; -import mightypork.util.math.constraints.Digestable; -import mightypork.util.math.constraints.num.caching.NumCache; -import mightypork.util.math.constraints.num.caching.NumDigest; -import mightypork.util.math.constraints.num.mutable.NumVar; -import mightypork.util.math.constraints.num.proxy.NumBound; -import mightypork.util.math.constraints.num.proxy.NumBoundAdapter; -import mightypork.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.annot.FactoryMethod; +import mightypork.gamecore.util.math.Calc; +import mightypork.gamecore.util.math.constraints.DigestCache; +import mightypork.gamecore.util.math.constraints.Digestable; +import mightypork.gamecore.util.math.constraints.num.caching.NumCache; +import mightypork.gamecore.util.math.constraints.num.caching.NumDigest; +import mightypork.gamecore.util.math.constraints.num.mutable.NumVar; +import mightypork.gamecore.util.math.constraints.num.proxy.NumBound; +import mightypork.gamecore.util.math.constraints.num.proxy.NumBoundAdapter; +import mightypork.gamecore.util.math.constraints.vect.Vect; public abstract class Num implements NumBound, Digestable { diff --git a/src/mightypork/util/math/constraints/num/NumConst.java b/src/mightypork/gamecore/util/math/constraints/num/NumConst.java similarity index 96% rename from src/mightypork/util/math/constraints/num/NumConst.java rename to src/mightypork/gamecore/util/math/constraints/num/NumConst.java index 1401c10..7eb42aa 100644 --- a/src/mightypork/util/math/constraints/num/NumConst.java +++ b/src/mightypork/gamecore/util/math/constraints/num/NumConst.java @@ -1,7 +1,7 @@ -package mightypork.util.math.constraints.num; +package mightypork.gamecore.util.math.constraints.num; -import mightypork.util.math.constraints.num.caching.NumDigest; +import mightypork.gamecore.util.math.constraints.num.caching.NumDigest; /** diff --git a/src/mightypork/util/math/constraints/num/caching/AbstractNumCache.java b/src/mightypork/gamecore/util/math/constraints/num/caching/AbstractNumCache.java similarity index 79% rename from src/mightypork/util/math/constraints/num/caching/AbstractNumCache.java rename to src/mightypork/gamecore/util/math/constraints/num/caching/AbstractNumCache.java index 0beb859..d5799a3 100644 --- a/src/mightypork/util/math/constraints/num/caching/AbstractNumCache.java +++ b/src/mightypork/gamecore/util/math/constraints/num/caching/AbstractNumCache.java @@ -1,10 +1,10 @@ -package mightypork.util.math.constraints.num.caching; +package mightypork.gamecore.util.math.constraints.num.caching; -import mightypork.util.math.constraints.ConstraintCache; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.num.mutable.NumVar; -import mightypork.util.math.constraints.num.proxy.NumAdapter; +import mightypork.gamecore.util.math.constraints.ConstraintCache; +import mightypork.gamecore.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.mutable.NumVar; +import mightypork.gamecore.util.math.constraints.num.proxy.NumAdapter; /** diff --git a/src/mightypork/util/math/constraints/num/caching/NumCache.java b/src/mightypork/gamecore/util/math/constraints/num/caching/NumCache.java similarity index 67% rename from src/mightypork/util/math/constraints/num/caching/NumCache.java rename to src/mightypork/gamecore/util/math/constraints/num/caching/NumCache.java index f4f902d..f1f70db 100644 --- a/src/mightypork/util/math/constraints/num/caching/NumCache.java +++ b/src/mightypork/gamecore/util/math/constraints/num/caching/NumCache.java @@ -1,8 +1,8 @@ -package mightypork.util.math.constraints.num.caching; +package mightypork.gamecore.util.math.constraints.num.caching; -import mightypork.util.annotations.DefaultImpl; -import mightypork.util.math.constraints.num.Num; +import mightypork.gamecore.util.annot.DefaultImpl; +import mightypork.gamecore.util.math.constraints.num.Num; /** diff --git a/src/mightypork/util/math/constraints/num/caching/NumDigest.java b/src/mightypork/gamecore/util/math/constraints/num/caching/NumDigest.java similarity index 64% rename from src/mightypork/util/math/constraints/num/caching/NumDigest.java rename to src/mightypork/gamecore/util/math/constraints/num/caching/NumDigest.java index d33040b..6bbc5fc 100644 --- a/src/mightypork/util/math/constraints/num/caching/NumDigest.java +++ b/src/mightypork/gamecore/util/math/constraints/num/caching/NumDigest.java @@ -1,7 +1,7 @@ -package mightypork.util.math.constraints.num.caching; +package mightypork.gamecore.util.math.constraints.num.caching; -import mightypork.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.Num; public class NumDigest { diff --git a/src/mightypork/util/math/constraints/num/mutable/NumAnimated.java b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimated.java similarity index 96% rename from src/mightypork/util/math/constraints/num/mutable/NumAnimated.java rename to src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimated.java index 5e32608..72036ea 100644 --- a/src/mightypork/util/math/constraints/num/mutable/NumAnimated.java +++ b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimated.java @@ -1,10 +1,10 @@ -package mightypork.util.math.constraints.num.mutable; +package mightypork.gamecore.util.math.constraints.num.mutable; -import mightypork.util.math.Calc; -import mightypork.util.math.Easing; -import mightypork.util.timing.Pauseable; -import mightypork.util.timing.Updateable; +import mightypork.gamecore.eventbus.events.Updateable; +import mightypork.gamecore.util.math.Calc; +import mightypork.gamecore.util.math.Easing; +import mightypork.gamecore.util.math.timing.Pauseable; /** diff --git a/src/mightypork/util/math/constraints/num/mutable/NumAnimatedDeg.java b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimatedDeg.java similarity index 79% rename from src/mightypork/util/math/constraints/num/mutable/NumAnimatedDeg.java rename to src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimatedDeg.java index 7301cfe..b49b65d 100644 --- a/src/mightypork/util/math/constraints/num/mutable/NumAnimatedDeg.java +++ b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimatedDeg.java @@ -1,9 +1,9 @@ -package mightypork.util.math.constraints.num.mutable; +package mightypork.gamecore.util.math.constraints.num.mutable; -import mightypork.util.math.Calc; -import mightypork.util.math.Calc.Deg; -import mightypork.util.math.Easing; +import mightypork.gamecore.util.math.Calc; +import mightypork.gamecore.util.math.Calc.Deg; +import mightypork.gamecore.util.math.Easing; /** diff --git a/src/mightypork/util/math/constraints/num/mutable/NumAnimatedRad.java b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimatedRad.java similarity index 79% rename from src/mightypork/util/math/constraints/num/mutable/NumAnimatedRad.java rename to src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimatedRad.java index 79d107e..cbc6bd5 100644 --- a/src/mightypork/util/math/constraints/num/mutable/NumAnimatedRad.java +++ b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumAnimatedRad.java @@ -1,9 +1,9 @@ -package mightypork.util.math.constraints.num.mutable; +package mightypork.gamecore.util.math.constraints.num.mutable; -import mightypork.util.math.Calc; -import mightypork.util.math.Calc.Rad; -import mightypork.util.math.Easing; +import mightypork.gamecore.util.math.Calc; +import mightypork.gamecore.util.math.Calc.Rad; +import mightypork.gamecore.util.math.Easing; /** diff --git a/src/mightypork/util/math/constraints/num/mutable/NumMutable.java b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumMutable.java similarity index 77% rename from src/mightypork/util/math/constraints/num/mutable/NumMutable.java rename to src/mightypork/gamecore/util/math/constraints/num/mutable/NumMutable.java index f99e945..a3331e1 100644 --- a/src/mightypork/util/math/constraints/num/mutable/NumMutable.java +++ b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumMutable.java @@ -1,7 +1,7 @@ -package mightypork.util.math.constraints.num.mutable; +package mightypork.gamecore.util.math.constraints.num.mutable; -import mightypork.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.Num; /** diff --git a/src/mightypork/util/math/constraints/num/mutable/NumVar.java b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumVar.java similarity index 76% rename from src/mightypork/util/math/constraints/num/mutable/NumVar.java rename to src/mightypork/gamecore/util/math/constraints/num/mutable/NumVar.java index 2be037a..4878bd2 100644 --- a/src/mightypork/util/math/constraints/num/mutable/NumVar.java +++ b/src/mightypork/gamecore/util/math/constraints/num/mutable/NumVar.java @@ -1,7 +1,7 @@ -package mightypork.util.math.constraints.num.mutable; +package mightypork.gamecore.util.math.constraints.num.mutable; -import mightypork.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.Num; /** diff --git a/src/mightypork/util/math/constraints/num/proxy/NumAdapter.java b/src/mightypork/gamecore/util/math/constraints/num/proxy/NumAdapter.java similarity index 58% rename from src/mightypork/util/math/constraints/num/proxy/NumAdapter.java rename to src/mightypork/gamecore/util/math/constraints/num/proxy/NumAdapter.java index af87682..7a6c465 100644 --- a/src/mightypork/util/math/constraints/num/proxy/NumAdapter.java +++ b/src/mightypork/gamecore/util/math/constraints/num/proxy/NumAdapter.java @@ -1,7 +1,7 @@ -package mightypork.util.math.constraints.num.proxy; +package mightypork.gamecore.util.math.constraints.num.proxy; -import mightypork.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.Num; public abstract class NumAdapter extends Num { diff --git a/src/mightypork/util/math/constraints/num/proxy/NumBound.java b/src/mightypork/gamecore/util/math/constraints/num/proxy/NumBound.java similarity index 54% rename from src/mightypork/util/math/constraints/num/proxy/NumBound.java rename to src/mightypork/gamecore/util/math/constraints/num/proxy/NumBound.java index 662ab50..90952fa 100644 --- a/src/mightypork/util/math/constraints/num/proxy/NumBound.java +++ b/src/mightypork/gamecore/util/math/constraints/num/proxy/NumBound.java @@ -1,7 +1,7 @@ -package mightypork.util.math.constraints.num.proxy; +package mightypork.gamecore.util.math.constraints.num.proxy; -import mightypork.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.Num; /** diff --git a/src/mightypork/util/math/constraints/num/proxy/NumBoundAdapter.java b/src/mightypork/gamecore/util/math/constraints/num/proxy/NumBoundAdapter.java similarity index 76% rename from src/mightypork/util/math/constraints/num/proxy/NumBoundAdapter.java rename to src/mightypork/gamecore/util/math/constraints/num/proxy/NumBoundAdapter.java index ab8e7f8..63dd7d4 100644 --- a/src/mightypork/util/math/constraints/num/proxy/NumBoundAdapter.java +++ b/src/mightypork/gamecore/util/math/constraints/num/proxy/NumBoundAdapter.java @@ -1,7 +1,7 @@ -package mightypork.util.math.constraints.num.proxy; +package mightypork.gamecore.util.math.constraints.num.proxy; -import mightypork.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.Num; public class NumBoundAdapter extends NumAdapter implements PluggableNumBound { diff --git a/src/mightypork/util/math/constraints/num/proxy/NumProxy.java b/src/mightypork/gamecore/util/math/constraints/num/proxy/NumProxy.java similarity index 63% rename from src/mightypork/util/math/constraints/num/proxy/NumProxy.java rename to src/mightypork/gamecore/util/math/constraints/num/proxy/NumProxy.java index 4c86092..4eaebe6 100644 --- a/src/mightypork/util/math/constraints/num/proxy/NumProxy.java +++ b/src/mightypork/gamecore/util/math/constraints/num/proxy/NumProxy.java @@ -1,7 +1,7 @@ -package mightypork.util.math.constraints.num.proxy; +package mightypork.gamecore.util.math.constraints.num.proxy; -import mightypork.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.Num; public class NumProxy extends NumAdapter { diff --git a/src/mightypork/util/math/constraints/num/proxy/PluggableNumBound.java b/src/mightypork/gamecore/util/math/constraints/num/proxy/PluggableNumBound.java similarity index 76% rename from src/mightypork/util/math/constraints/num/proxy/PluggableNumBound.java rename to src/mightypork/gamecore/util/math/constraints/num/proxy/PluggableNumBound.java index 9f2b3ae..8006718 100644 --- a/src/mightypork/util/math/constraints/num/proxy/PluggableNumBound.java +++ b/src/mightypork/gamecore/util/math/constraints/num/proxy/PluggableNumBound.java @@ -1,4 +1,4 @@ -package mightypork.util.math.constraints.num.proxy; +package mightypork.gamecore.util.math.constraints.num.proxy; /** diff --git a/src/mightypork/util/math/constraints/rect/Rect.java b/src/mightypork/gamecore/util/math/constraints/rect/Rect.java similarity index 94% rename from src/mightypork/util/math/constraints/rect/Rect.java rename to src/mightypork/gamecore/util/math/constraints/rect/Rect.java index 9651c05..f3dfced 100644 --- a/src/mightypork/util/math/constraints/rect/Rect.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/Rect.java @@ -1,20 +1,20 @@ -package mightypork.util.math.constraints.rect; +package mightypork.gamecore.util.math.constraints.rect; -import mightypork.util.annotations.FactoryMethod; -import mightypork.util.math.constraints.DigestCache; -import mightypork.util.math.constraints.Digestable; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.num.NumConst; -import mightypork.util.math.constraints.rect.builders.TiledRect; -import mightypork.util.math.constraints.rect.caching.RectCache; -import mightypork.util.math.constraints.rect.caching.RectDigest; -import mightypork.util.math.constraints.rect.mutable.RectVar; -import mightypork.util.math.constraints.rect.proxy.RectBound; -import mightypork.util.math.constraints.rect.proxy.RectBoundAdapter; -import mightypork.util.math.constraints.rect.proxy.RectVectAdapter; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.math.constraints.vect.VectConst; +import mightypork.gamecore.util.annot.FactoryMethod; +import mightypork.gamecore.util.math.constraints.DigestCache; +import mightypork.gamecore.util.math.constraints.Digestable; +import mightypork.gamecore.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.NumConst; +import mightypork.gamecore.util.math.constraints.rect.builders.TiledRect; +import mightypork.gamecore.util.math.constraints.rect.caching.RectCache; +import mightypork.gamecore.util.math.constraints.rect.caching.RectDigest; +import mightypork.gamecore.util.math.constraints.rect.mutable.RectVar; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBoundAdapter; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectVectAdapter; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.VectConst; /** diff --git a/src/mightypork/util/math/constraints/rect/RectConst.java b/src/mightypork/gamecore/util/math/constraints/rect/RectConst.java similarity index 95% rename from src/mightypork/util/math/constraints/rect/RectConst.java rename to src/mightypork/gamecore/util/math/constraints/rect/RectConst.java index 1d72569..8e1a131 100644 --- a/src/mightypork/util/math/constraints/rect/RectConst.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/RectConst.java @@ -1,10 +1,10 @@ -package mightypork.util.math.constraints.rect; +package mightypork.gamecore.util.math.constraints.rect; -import mightypork.util.math.constraints.num.NumConst; -import mightypork.util.math.constraints.rect.caching.RectDigest; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.math.constraints.vect.VectConst; +import mightypork.gamecore.util.math.constraints.num.NumConst; +import mightypork.gamecore.util.math.constraints.rect.caching.RectDigest; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.VectConst; /** diff --git a/src/mightypork/util/math/constraints/rect/builders/TiledRect.java b/src/mightypork/gamecore/util/math/constraints/rect/builders/TiledRect.java similarity index 88% rename from src/mightypork/util/math/constraints/rect/builders/TiledRect.java rename to src/mightypork/gamecore/util/math/constraints/rect/builders/TiledRect.java index 6a72dd4..b107a5a 100644 --- a/src/mightypork/util/math/constraints/rect/builders/TiledRect.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/builders/TiledRect.java @@ -1,11 +1,11 @@ -package mightypork.util.math.constraints.rect.builders; +package mightypork.gamecore.util.math.constraints.rect.builders; -import mightypork.util.logging.Log; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.rect.proxy.RectProxy; -import mightypork.util.math.constraints.vect.Vect; +import mightypork.gamecore.logging.Log; +import mightypork.gamecore.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectProxy; +import mightypork.gamecore.util.math.constraints.vect.Vect; /** diff --git a/src/mightypork/util/math/constraints/rect/caching/AbstractRectCache.java b/src/mightypork/gamecore/util/math/constraints/rect/caching/AbstractRectCache.java similarity index 76% rename from src/mightypork/util/math/constraints/rect/caching/AbstractRectCache.java rename to src/mightypork/gamecore/util/math/constraints/rect/caching/AbstractRectCache.java index b4206d6..1a8993e 100644 --- a/src/mightypork/util/math/constraints/rect/caching/AbstractRectCache.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/caching/AbstractRectCache.java @@ -1,10 +1,10 @@ -package mightypork.util.math.constraints.rect.caching; +package mightypork.gamecore.util.math.constraints.rect.caching; -import mightypork.util.math.constraints.ConstraintCache; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.rect.mutable.RectVar; -import mightypork.util.math.constraints.rect.proxy.RectAdapter; +import mightypork.gamecore.util.math.constraints.ConstraintCache; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.mutable.RectVar; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectAdapter; /** diff --git a/src/mightypork/util/math/constraints/rect/caching/RectCache.java b/src/mightypork/gamecore/util/math/constraints/rect/caching/RectCache.java similarity index 67% rename from src/mightypork/util/math/constraints/rect/caching/RectCache.java rename to src/mightypork/gamecore/util/math/constraints/rect/caching/RectCache.java index b83a9c9..6ebd964 100644 --- a/src/mightypork/util/math/constraints/rect/caching/RectCache.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/caching/RectCache.java @@ -1,8 +1,8 @@ -package mightypork.util.math.constraints.rect.caching; +package mightypork.gamecore.util.math.constraints.rect.caching; -import mightypork.util.annotations.DefaultImpl; -import mightypork.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.annot.DefaultImpl; +import mightypork.gamecore.util.math.constraints.rect.Rect; /** diff --git a/src/mightypork/util/math/constraints/rect/caching/RectDigest.java b/src/mightypork/gamecore/util/math/constraints/rect/caching/RectDigest.java similarity index 85% rename from src/mightypork/util/math/constraints/rect/caching/RectDigest.java rename to src/mightypork/gamecore/util/math/constraints/rect/caching/RectDigest.java index 471d534..7cacd19 100644 --- a/src/mightypork/util/math/constraints/rect/caching/RectDigest.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/caching/RectDigest.java @@ -1,7 +1,7 @@ -package mightypork.util.math.constraints.rect.caching; +package mightypork.gamecore.util.math.constraints.rect.caching; -import mightypork.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.Rect; public class RectDigest { diff --git a/src/mightypork/util/math/constraints/rect/mutable/RectMutable.java b/src/mightypork/gamecore/util/math/constraints/rect/mutable/RectMutable.java similarity index 88% rename from src/mightypork/util/math/constraints/rect/mutable/RectMutable.java rename to src/mightypork/gamecore/util/math/constraints/rect/mutable/RectMutable.java index 8125442..9557538 100644 --- a/src/mightypork/util/math/constraints/rect/mutable/RectMutable.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/mutable/RectMutable.java @@ -1,8 +1,8 @@ -package mightypork.util.math.constraints.rect.mutable; +package mightypork.gamecore.util.math.constraints.rect.mutable; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.vect.Vect; /** diff --git a/src/mightypork/util/math/constraints/rect/mutable/RectVar.java b/src/mightypork/gamecore/util/math/constraints/rect/mutable/RectVar.java similarity index 77% rename from src/mightypork/util/math/constraints/rect/mutable/RectVar.java rename to src/mightypork/gamecore/util/math/constraints/rect/mutable/RectVar.java index b88ad68..43b9fd3 100644 --- a/src/mightypork/util/math/constraints/rect/mutable/RectVar.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/mutable/RectVar.java @@ -1,8 +1,8 @@ -package mightypork.util.math.constraints.rect.mutable; +package mightypork.gamecore.util.math.constraints.rect.mutable; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.math.constraints.vect.mutable.VectVar; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.mutable.VectVar; public class RectVar extends RectMutable { diff --git a/src/mightypork/util/math/constraints/rect/proxy/PluggableRectBound.java b/src/mightypork/gamecore/util/math/constraints/rect/proxy/PluggableRectBound.java similarity index 76% rename from src/mightypork/util/math/constraints/rect/proxy/PluggableRectBound.java rename to src/mightypork/gamecore/util/math/constraints/rect/proxy/PluggableRectBound.java index 14ef1c4..58e3bd0 100644 --- a/src/mightypork/util/math/constraints/rect/proxy/PluggableRectBound.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/proxy/PluggableRectBound.java @@ -1,4 +1,4 @@ -package mightypork.util.math.constraints.rect.proxy; +package mightypork.gamecore.util.math.constraints.rect.proxy; /** diff --git a/src/mightypork/util/math/constraints/rect/proxy/RectAdapter.java b/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectAdapter.java similarity index 77% rename from src/mightypork/util/math/constraints/rect/proxy/RectAdapter.java rename to src/mightypork/gamecore/util/math/constraints/rect/proxy/RectAdapter.java index d4f3ef7..9b8af19 100644 --- a/src/mightypork/util/math/constraints/rect/proxy/RectAdapter.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectAdapter.java @@ -1,9 +1,9 @@ -package mightypork.util.math.constraints.rect.proxy; +package mightypork.gamecore.util.math.constraints.rect.proxy; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.math.constraints.vect.proxy.VectAdapter; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.proxy.VectAdapter; /** diff --git a/src/mightypork/util/math/constraints/rect/proxy/RectBound.java b/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectBound.java similarity index 55% rename from src/mightypork/util/math/constraints/rect/proxy/RectBound.java rename to src/mightypork/gamecore/util/math/constraints/rect/proxy/RectBound.java index 197204a..4f2d410 100644 --- a/src/mightypork/util/math/constraints/rect/proxy/RectBound.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectBound.java @@ -1,7 +1,7 @@ -package mightypork.util.math.constraints.rect.proxy; +package mightypork.gamecore.util.math.constraints.rect.proxy; -import mightypork.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.Rect; /** diff --git a/src/mightypork/util/math/constraints/rect/proxy/RectBoundAdapter.java b/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectBoundAdapter.java similarity index 78% rename from src/mightypork/util/math/constraints/rect/proxy/RectBoundAdapter.java rename to src/mightypork/gamecore/util/math/constraints/rect/proxy/RectBoundAdapter.java index 166ca8f..1001624 100644 --- a/src/mightypork/util/math/constraints/rect/proxy/RectBoundAdapter.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectBoundAdapter.java @@ -1,7 +1,7 @@ -package mightypork.util.math.constraints.rect.proxy; +package mightypork.gamecore.util.math.constraints.rect.proxy; -import mightypork.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.Rect; /** diff --git a/src/mightypork/util/math/constraints/rect/proxy/RectProxy.java b/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectProxy.java similarity index 63% rename from src/mightypork/util/math/constraints/rect/proxy/RectProxy.java rename to src/mightypork/gamecore/util/math/constraints/rect/proxy/RectProxy.java index eec5c98..24617cb 100644 --- a/src/mightypork/util/math/constraints/rect/proxy/RectProxy.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectProxy.java @@ -1,7 +1,7 @@ -package mightypork.util.math.constraints.rect.proxy; +package mightypork.gamecore.util.math.constraints.rect.proxy; -import mightypork.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.Rect; public class RectProxy extends RectAdapter { diff --git a/src/mightypork/util/math/constraints/rect/proxy/RectVectAdapter.java b/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectVectAdapter.java similarity index 68% rename from src/mightypork/util/math/constraints/rect/proxy/RectVectAdapter.java rename to src/mightypork/gamecore/util/math/constraints/rect/proxy/RectVectAdapter.java index 3a77455..dc2ee86 100644 --- a/src/mightypork/util/math/constraints/rect/proxy/RectVectAdapter.java +++ b/src/mightypork/gamecore/util/math/constraints/rect/proxy/RectVectAdapter.java @@ -1,8 +1,8 @@ -package mightypork.util.math.constraints.rect.proxy; +package mightypork.gamecore.util.math.constraints.rect.proxy; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.vect.Vect; /** diff --git a/src/mightypork/util/math/constraints/vect/Vect.java b/src/mightypork/gamecore/util/math/constraints/vect/Vect.java similarity index 94% rename from src/mightypork/util/math/constraints/vect/Vect.java rename to src/mightypork/gamecore/util/math/constraints/vect/Vect.java index b5e9e2d..769d962 100644 --- a/src/mightypork/util/math/constraints/vect/Vect.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/Vect.java @@ -1,19 +1,19 @@ -package mightypork.util.math.constraints.vect; +package mightypork.gamecore.util.math.constraints.vect; -import mightypork.util.annotations.DefaultImpl; -import mightypork.util.annotations.FactoryMethod; -import mightypork.util.math.constraints.DigestCache; -import mightypork.util.math.constraints.Digestable; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.num.NumConst; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.vect.caching.VectCache; -import mightypork.util.math.constraints.vect.caching.VectDigest; -import mightypork.util.math.constraints.vect.mutable.VectVar; -import mightypork.util.math.constraints.vect.proxy.VectBound; -import mightypork.util.math.constraints.vect.proxy.VectBoundAdapter; -import mightypork.util.math.constraints.vect.proxy.VectNumAdapter; +import mightypork.gamecore.util.annot.DefaultImpl; +import mightypork.gamecore.util.annot.FactoryMethod; +import mightypork.gamecore.util.math.constraints.DigestCache; +import mightypork.gamecore.util.math.constraints.Digestable; +import mightypork.gamecore.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.NumConst; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.vect.caching.VectCache; +import mightypork.gamecore.util.math.constraints.vect.caching.VectDigest; +import mightypork.gamecore.util.math.constraints.vect.mutable.VectVar; +import mightypork.gamecore.util.math.constraints.vect.proxy.VectBound; +import mightypork.gamecore.util.math.constraints.vect.proxy.VectBoundAdapter; +import mightypork.gamecore.util.math.constraints.vect.proxy.VectNumAdapter; /** diff --git a/src/mightypork/util/math/constraints/vect/VectConst.java b/src/mightypork/gamecore/util/math/constraints/vect/VectConst.java similarity index 94% rename from src/mightypork/util/math/constraints/vect/VectConst.java rename to src/mightypork/gamecore/util/math/constraints/vect/VectConst.java index 37fb47a..7b1634d 100644 --- a/src/mightypork/util/math/constraints/vect/VectConst.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/VectConst.java @@ -1,10 +1,10 @@ -package mightypork.util.math.constraints.vect; +package mightypork.gamecore.util.math.constraints.vect; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.num.NumConst; -import mightypork.util.math.constraints.rect.RectConst; -import mightypork.util.math.constraints.vect.caching.VectDigest; +import mightypork.gamecore.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.NumConst; +import mightypork.gamecore.util.math.constraints.rect.RectConst; +import mightypork.gamecore.util.math.constraints.vect.caching.VectDigest; /** diff --git a/src/mightypork/util/math/constraints/vect/VectProxy.java b/src/mightypork/gamecore/util/math/constraints/vect/VectProxy.java similarity index 62% rename from src/mightypork/util/math/constraints/vect/VectProxy.java rename to src/mightypork/gamecore/util/math/constraints/vect/VectProxy.java index 2a9411b..da218e4 100644 --- a/src/mightypork/util/math/constraints/vect/VectProxy.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/VectProxy.java @@ -1,7 +1,7 @@ -package mightypork.util.math.constraints.vect; +package mightypork.gamecore.util.math.constraints.vect; -import mightypork.util.math.constraints.vect.proxy.VectAdapter; +import mightypork.gamecore.util.math.constraints.vect.proxy.VectAdapter; public class VectProxy extends VectAdapter { diff --git a/src/mightypork/util/math/constraints/vect/caching/AbstractVectCache.java b/src/mightypork/gamecore/util/math/constraints/vect/caching/AbstractVectCache.java similarity index 76% rename from src/mightypork/util/math/constraints/vect/caching/AbstractVectCache.java rename to src/mightypork/gamecore/util/math/constraints/vect/caching/AbstractVectCache.java index 14d6d31..da41ac9 100644 --- a/src/mightypork/util/math/constraints/vect/caching/AbstractVectCache.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/caching/AbstractVectCache.java @@ -1,10 +1,10 @@ -package mightypork.util.math.constraints.vect.caching; +package mightypork.gamecore.util.math.constraints.vect.caching; -import mightypork.util.math.constraints.ConstraintCache; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.math.constraints.vect.mutable.VectVar; -import mightypork.util.math.constraints.vect.proxy.VectAdapter; +import mightypork.gamecore.util.math.constraints.ConstraintCache; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.mutable.VectVar; +import mightypork.gamecore.util.math.constraints.vect.proxy.VectAdapter; /** diff --git a/src/mightypork/util/math/constraints/vect/caching/VectCache.java b/src/mightypork/gamecore/util/math/constraints/vect/caching/VectCache.java similarity index 68% rename from src/mightypork/util/math/constraints/vect/caching/VectCache.java rename to src/mightypork/gamecore/util/math/constraints/vect/caching/VectCache.java index fdade98..2b45b22 100644 --- a/src/mightypork/util/math/constraints/vect/caching/VectCache.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/caching/VectCache.java @@ -1,8 +1,8 @@ -package mightypork.util.math.constraints.vect.caching; +package mightypork.gamecore.util.math.constraints.vect.caching; -import mightypork.util.annotations.DefaultImpl; -import mightypork.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.annot.DefaultImpl; +import mightypork.gamecore.util.math.constraints.vect.Vect; /** diff --git a/src/mightypork/util/math/constraints/vect/caching/VectDigest.java b/src/mightypork/gamecore/util/math/constraints/vect/caching/VectDigest.java similarity index 71% rename from src/mightypork/util/math/constraints/vect/caching/VectDigest.java rename to src/mightypork/gamecore/util/math/constraints/vect/caching/VectDigest.java index 43afc51..ad0440e 100644 --- a/src/mightypork/util/math/constraints/vect/caching/VectDigest.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/caching/VectDigest.java @@ -1,7 +1,7 @@ -package mightypork.util.math.constraints.vect.caching; +package mightypork.gamecore.util.math.constraints.vect.caching; -import mightypork.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.Vect; public class VectDigest { diff --git a/src/mightypork/util/math/constraints/vect/mutable/VectAnimated.java b/src/mightypork/gamecore/util/math/constraints/vect/mutable/VectAnimated.java similarity index 91% rename from src/mightypork/util/math/constraints/vect/mutable/VectAnimated.java rename to src/mightypork/gamecore/util/math/constraints/vect/mutable/VectAnimated.java index cf7215d..6bdb914 100644 --- a/src/mightypork/util/math/constraints/vect/mutable/VectAnimated.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/mutable/VectAnimated.java @@ -1,12 +1,12 @@ -package mightypork.util.math.constraints.vect.mutable; +package mightypork.gamecore.util.math.constraints.vect.mutable; -import mightypork.util.annotations.FactoryMethod; -import mightypork.util.math.Easing; -import mightypork.util.math.constraints.num.mutable.NumAnimated; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.timing.Pauseable; -import mightypork.util.timing.Updateable; +import mightypork.gamecore.eventbus.events.Updateable; +import mightypork.gamecore.util.annot.FactoryMethod; +import mightypork.gamecore.util.math.Easing; +import mightypork.gamecore.util.math.constraints.num.mutable.NumAnimated; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.timing.Pauseable; /** diff --git a/src/mightypork/util/math/constraints/vect/mutable/VectMutable.java b/src/mightypork/gamecore/util/math/constraints/vect/mutable/VectMutable.java similarity index 89% rename from src/mightypork/util/math/constraints/vect/mutable/VectMutable.java rename to src/mightypork/gamecore/util/math/constraints/vect/mutable/VectMutable.java index f69e615..52c076e 100644 --- a/src/mightypork/util/math/constraints/vect/mutable/VectMutable.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/mutable/VectMutable.java @@ -1,7 +1,7 @@ -package mightypork.util.math.constraints.vect.mutable; +package mightypork.gamecore.util.math.constraints.vect.mutable; -import mightypork.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.Vect; /** diff --git a/src/mightypork/util/math/constraints/vect/mutable/VectVar.java b/src/mightypork/gamecore/util/math/constraints/vect/mutable/VectVar.java similarity index 93% rename from src/mightypork/util/math/constraints/vect/mutable/VectVar.java rename to src/mightypork/gamecore/util/math/constraints/vect/mutable/VectVar.java index fed287b..598b55a 100644 --- a/src/mightypork/util/math/constraints/vect/mutable/VectVar.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/mutable/VectVar.java @@ -1,4 +1,4 @@ -package mightypork.util.math.constraints.vect.mutable; +package mightypork.gamecore.util.math.constraints.vect.mutable; /** diff --git a/src/mightypork/util/math/constraints/vect/proxy/PluggableVectBound.java b/src/mightypork/gamecore/util/math/constraints/vect/proxy/PluggableVectBound.java similarity index 76% rename from src/mightypork/util/math/constraints/vect/proxy/PluggableVectBound.java rename to src/mightypork/gamecore/util/math/constraints/vect/proxy/PluggableVectBound.java index 0bb5985..0a5b49e 100644 --- a/src/mightypork/util/math/constraints/vect/proxy/PluggableVectBound.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/proxy/PluggableVectBound.java @@ -1,4 +1,4 @@ -package mightypork.util.math.constraints.vect.proxy; +package mightypork.gamecore.util.math.constraints.vect.proxy; /** diff --git a/src/mightypork/util/math/constraints/vect/proxy/VectAdapter.java b/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectAdapter.java similarity index 79% rename from src/mightypork/util/math/constraints/vect/proxy/VectAdapter.java rename to src/mightypork/gamecore/util/math/constraints/vect/proxy/VectAdapter.java index 07a805e..4a5de20 100644 --- a/src/mightypork/util/math/constraints/vect/proxy/VectAdapter.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectAdapter.java @@ -1,7 +1,7 @@ -package mightypork.util.math.constraints.vect.proxy; +package mightypork.gamecore.util.math.constraints.vect.proxy; -import mightypork.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.Vect; /** diff --git a/src/mightypork/util/math/constraints/vect/proxy/VectBound.java b/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectBound.java similarity index 61% rename from src/mightypork/util/math/constraints/vect/proxy/VectBound.java rename to src/mightypork/gamecore/util/math/constraints/vect/proxy/VectBound.java index cc7ef8e..686fc69 100644 --- a/src/mightypork/util/math/constraints/vect/proxy/VectBound.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectBound.java @@ -1,7 +1,7 @@ -package mightypork.util.math.constraints.vect.proxy; +package mightypork.gamecore.util.math.constraints.vect.proxy; -import mightypork.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.Vect; /** diff --git a/src/mightypork/util/math/constraints/vect/proxy/VectBoundAdapter.java b/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectBoundAdapter.java similarity index 76% rename from src/mightypork/util/math/constraints/vect/proxy/VectBoundAdapter.java rename to src/mightypork/gamecore/util/math/constraints/vect/proxy/VectBoundAdapter.java index 340b13d..e06ee49 100644 --- a/src/mightypork/util/math/constraints/vect/proxy/VectBoundAdapter.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectBoundAdapter.java @@ -1,7 +1,7 @@ -package mightypork.util.math.constraints.vect.proxy; +package mightypork.gamecore.util.math.constraints.vect.proxy; -import mightypork.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.Vect; public class VectBoundAdapter extends VectAdapter implements PluggableVectBound { diff --git a/src/mightypork/util/math/constraints/vect/proxy/VectNumAdapter.java b/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectNumAdapter.java similarity index 73% rename from src/mightypork/util/math/constraints/vect/proxy/VectNumAdapter.java rename to src/mightypork/gamecore/util/math/constraints/vect/proxy/VectNumAdapter.java index 466c1b9..b08f4ba 100644 --- a/src/mightypork/util/math/constraints/vect/proxy/VectNumAdapter.java +++ b/src/mightypork/gamecore/util/math/constraints/vect/proxy/VectNumAdapter.java @@ -1,9 +1,9 @@ -package mightypork.util.math.constraints.vect.proxy; +package mightypork.gamecore.util.math.constraints.vect.proxy; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.num.proxy.NumBound; -import mightypork.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.proxy.NumBound; +import mightypork.gamecore.util.math.constraints.vect.Vect; /** diff --git a/src/mightypork/util/math/noise/NoiseGen.java b/src/mightypork/gamecore/util/math/noise/NoiseGen.java similarity index 98% rename from src/mightypork/util/math/noise/NoiseGen.java rename to src/mightypork/gamecore/util/math/noise/NoiseGen.java index 25dd1c0..5a813bb 100644 --- a/src/mightypork/util/math/noise/NoiseGen.java +++ b/src/mightypork/gamecore/util/math/noise/NoiseGen.java @@ -1,4 +1,4 @@ -package mightypork.util.math.noise; +package mightypork.gamecore.util.math.noise; /** diff --git a/src/mightypork/util/math/noise/PerlinNoiseGenerator.java b/src/mightypork/gamecore/util/math/noise/PerlinNoiseGenerator.java similarity index 99% rename from src/mightypork/util/math/noise/PerlinNoiseGenerator.java rename to src/mightypork/gamecore/util/math/noise/PerlinNoiseGenerator.java index ce54139..b13ec98 100644 --- a/src/mightypork/util/math/noise/PerlinNoiseGenerator.java +++ b/src/mightypork/gamecore/util/math/noise/PerlinNoiseGenerator.java @@ -9,7 +9,7 @@ * purpose. Use it at your own risk. If there's a problem you get to fix it. * ****************************************************************************/ -package mightypork.util.math.noise; +package mightypork.gamecore.util.math.noise; import java.util.Random; diff --git a/src/mightypork/gamecore/util/math/timing/Animator.java b/src/mightypork/gamecore/util/math/timing/Animator.java new file mode 100644 index 0000000..64bcb39 --- /dev/null +++ b/src/mightypork/gamecore/util/math/timing/Animator.java @@ -0,0 +1,123 @@ +package mightypork.gamecore.util.math.timing; + + +import mightypork.gamecore.eventbus.events.Updateable; +import mightypork.gamecore.util.annot.DefaultImpl; +import mightypork.gamecore.util.math.Calc; +import mightypork.gamecore.util.math.Easing; +import mightypork.gamecore.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.mutable.NumAnimated; + + +public abstract class Animator extends Num implements Updateable, Pauseable { + + private final NumAnimated numAnim; + private final Num num; + private final double highValue; + private final double lowValue; + + + public Animator(double period) + { + this(0, 1, period, Easing.LINEAR); + } + + + public Animator(double start, double end, double period) + { + this(start, end, period, Easing.LINEAR); + } + + + public Animator(double period, Easing easing) + { + this(0, 1, period, easing); + } + + + public Animator(double start, double end, double period, Easing easing) + { + numAnim = new NumAnimated(0, easing); + numAnim.setDefaultDuration(period); + + this.lowValue = start; + this.highValue = end; + + this.num = numAnim.mul(end - start).add(start); + } + + + @Override + public void pause() + { + numAnim.pause(); + } + + + public void start() { + resume(); + } + + + @Override + public void resume() + { + numAnim.resume(); + } + + + @Override + public boolean isPaused() + { + return numAnim.isPaused(); + } + + + public void reset() + { + numAnim.reset(); + } + + public void restart() { + reset(); + nextCycle(numAnim); + } + + + public void setDuration(double secs) { + numAnim.setDefaultDuration(secs); + } + + public double getDuration() { + return numAnim.getDefaultDuration(); + } + + + @Override + public void update(double delta) + { + numAnim.update(delta); + if (numAnim.isFinished()) nextCycle(numAnim); + } + + + @DefaultImpl + protected abstract void nextCycle(NumAnimated anim); + + + @Override + public double value() + { + return num.value(); + } + + public void setProgress(double value) { + double target = numAnim.getEnd(); + numAnim.setTo(Calc.clamp(value, lowValue, highValue)); + numAnim.animate(target, numAnim.getDefaultDuration()); + } + + public double getProgress() { + return numAnim.value(); + } +} diff --git a/src/mightypork/util/timing/AnimatorBounce.java b/src/mightypork/gamecore/util/math/timing/AnimatorBounce.java similarity index 81% rename from src/mightypork/util/timing/AnimatorBounce.java rename to src/mightypork/gamecore/util/math/timing/AnimatorBounce.java index c6ade23..0662df3 100644 --- a/src/mightypork/util/timing/AnimatorBounce.java +++ b/src/mightypork/gamecore/util/math/timing/AnimatorBounce.java @@ -1,8 +1,8 @@ -package mightypork.util.timing; +package mightypork.gamecore.util.math.timing; -import mightypork.util.math.Easing; -import mightypork.util.math.constraints.num.mutable.NumAnimated; +import mightypork.gamecore.util.math.Easing; +import mightypork.gamecore.util.math.constraints.num.mutable.NumAnimated; /** diff --git a/src/mightypork/util/timing/AnimatorRewind.java b/src/mightypork/gamecore/util/math/timing/AnimatorRewind.java similarity index 79% rename from src/mightypork/util/timing/AnimatorRewind.java rename to src/mightypork/gamecore/util/math/timing/AnimatorRewind.java index 829c9ec..6ca0299 100644 --- a/src/mightypork/util/timing/AnimatorRewind.java +++ b/src/mightypork/gamecore/util/math/timing/AnimatorRewind.java @@ -1,8 +1,8 @@ -package mightypork.util.timing; +package mightypork.gamecore.util.math.timing; -import mightypork.util.math.Easing; -import mightypork.util.math.constraints.num.mutable.NumAnimated; +import mightypork.gamecore.util.math.Easing; +import mightypork.gamecore.util.math.constraints.num.mutable.NumAnimated; /** diff --git a/src/mightypork/util/timing/FpsMeter.java b/src/mightypork/gamecore/util/math/timing/FpsMeter.java similarity index 93% rename from src/mightypork/util/timing/FpsMeter.java rename to src/mightypork/gamecore/util/math/timing/FpsMeter.java index ca4f988..2d04222 100644 --- a/src/mightypork/util/timing/FpsMeter.java +++ b/src/mightypork/gamecore/util/math/timing/FpsMeter.java @@ -1,4 +1,4 @@ -package mightypork.util.timing; +package mightypork.gamecore.util.math.timing; /** diff --git a/src/mightypork/util/timing/Pauseable.java b/src/mightypork/gamecore/util/math/timing/Pauseable.java similarity index 85% rename from src/mightypork/util/timing/Pauseable.java rename to src/mightypork/gamecore/util/math/timing/Pauseable.java index f849ab2..007cb6d 100644 --- a/src/mightypork/util/timing/Pauseable.java +++ b/src/mightypork/gamecore/util/math/timing/Pauseable.java @@ -1,4 +1,4 @@ -package mightypork.util.timing; +package mightypork.gamecore.util.math.timing; /** diff --git a/src/mightypork/gamecore/util/math/timing/TaskRepeater.java b/src/mightypork/gamecore/util/math/timing/TaskRepeater.java new file mode 100644 index 0000000..04b4d77 --- /dev/null +++ b/src/mightypork/gamecore/util/math/timing/TaskRepeater.java @@ -0,0 +1,44 @@ +package mightypork.gamecore.util.math.timing; + + +import mightypork.gamecore.gui.Enableable; +import mightypork.gamecore.util.math.constraints.num.mutable.NumAnimated; + + +public abstract class TaskRepeater extends AnimatorRewind implements Runnable, Enableable { + + private boolean enabled = true; + + public TaskRepeater(double period) { + super(period); + } + + + @Override + protected void nextCycle(NumAnimated anim) + { + run(); + super.nextCycle(anim); + } + + @Override + public void enable(boolean yes) + { + this.enabled = yes; + } + + @Override + public boolean isEnabled() + { + return enabled; + } + + @Override + public void update(double delta) + { + if(!enabled) return; + + super.update(delta); + } + +} diff --git a/src/mightypork/util/timing/TimedTask.java b/src/mightypork/gamecore/util/math/timing/TimedTask.java similarity index 77% rename from src/mightypork/util/timing/TimedTask.java rename to src/mightypork/gamecore/util/math/timing/TimedTask.java index 350d60f..1e71623 100644 --- a/src/mightypork/util/timing/TimedTask.java +++ b/src/mightypork/gamecore/util/math/timing/TimedTask.java @@ -1,7 +1,8 @@ -package mightypork.util.timing; +package mightypork.gamecore.util.math.timing; -import mightypork.util.math.constraints.num.mutable.NumAnimated; +import mightypork.gamecore.eventbus.events.Updateable; +import mightypork.gamecore.util.math.constraints.num.mutable.NumAnimated; /** diff --git a/src/mightypork/util/timing/TimerDelta.java b/src/mightypork/gamecore/util/math/timing/TimerDelta.java similarity index 93% rename from src/mightypork/util/timing/TimerDelta.java rename to src/mightypork/gamecore/util/math/timing/TimerDelta.java index 07605f3..015275c 100644 --- a/src/mightypork/util/timing/TimerDelta.java +++ b/src/mightypork/gamecore/util/math/timing/TimerDelta.java @@ -1,4 +1,4 @@ -package mightypork.util.timing; +package mightypork.gamecore.util.math.timing; /** diff --git a/src/mightypork/util/timing/TimerFps.java b/src/mightypork/gamecore/util/math/timing/TimerFps.java similarity index 97% rename from src/mightypork/util/timing/TimerFps.java rename to src/mightypork/gamecore/util/math/timing/TimerFps.java index 74e639e..4daf7b6 100644 --- a/src/mightypork/util/timing/TimerFps.java +++ b/src/mightypork/gamecore/util/math/timing/TimerFps.java @@ -1,4 +1,4 @@ -package mightypork.util.timing; +package mightypork.gamecore.util.math.timing; /** diff --git a/src/mightypork/util/objects/Convert.java b/src/mightypork/gamecore/util/objects/Convert.java similarity index 95% rename from src/mightypork/util/objects/Convert.java rename to src/mightypork/gamecore/util/objects/Convert.java index 589d029..1a873a0 100644 --- a/src/mightypork/util/objects/Convert.java +++ b/src/mightypork/gamecore/util/objects/Convert.java @@ -1,11 +1,11 @@ -package mightypork.util.objects; +package mightypork.gamecore.util.objects; -import mightypork.util.logging.Log; -import mightypork.util.math.Calc; -import mightypork.util.math.Range; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.math.constraints.vect.VectConst; +import mightypork.gamecore.logging.Log; +import mightypork.gamecore.util.math.Calc; +import mightypork.gamecore.util.math.Range; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.VectConst; /** diff --git a/src/mightypork/util/objects/MapSort.java b/src/mightypork/gamecore/util/objects/MapSort.java similarity index 97% rename from src/mightypork/util/objects/MapSort.java rename to src/mightypork/gamecore/util/objects/MapSort.java index 2b3f8ab..73667c5 100644 --- a/src/mightypork/util/objects/MapSort.java +++ b/src/mightypork/gamecore/util/objects/MapSort.java @@ -1,4 +1,4 @@ -package mightypork.util.objects; +package mightypork.gamecore.util.objects; import java.util.*; diff --git a/src/mightypork/util/objects/Mutable.java b/src/mightypork/gamecore/util/objects/Mutable.java similarity index 96% rename from src/mightypork/util/objects/Mutable.java rename to src/mightypork/gamecore/util/objects/Mutable.java index 69723c2..41a3eb1 100644 --- a/src/mightypork/util/objects/Mutable.java +++ b/src/mightypork/gamecore/util/objects/Mutable.java @@ -1,4 +1,4 @@ -package mightypork.util.objects; +package mightypork.gamecore.util.objects; /** diff --git a/src/mightypork/util/objects/ObjectUtils.java b/src/mightypork/gamecore/util/objects/ObjectUtils.java similarity index 90% rename from src/mightypork/util/objects/ObjectUtils.java rename to src/mightypork/gamecore/util/objects/ObjectUtils.java index 12c1a14..15d5aff 100644 --- a/src/mightypork/util/objects/ObjectUtils.java +++ b/src/mightypork/gamecore/util/objects/ObjectUtils.java @@ -1,10 +1,10 @@ -package mightypork.util.objects; +package mightypork.gamecore.util.objects; import java.util.ArrayList; import java.util.List; -import mightypork.util.logging.Log; +import mightypork.gamecore.logging.Log; /** diff --git a/src/mightypork/util/objects/Pair.java b/src/mightypork/gamecore/util/objects/Pair.java similarity index 91% rename from src/mightypork/util/objects/Pair.java rename to src/mightypork/gamecore/util/objects/Pair.java index 070e60a..0747154 100644 --- a/src/mightypork/util/objects/Pair.java +++ b/src/mightypork/gamecore/util/objects/Pair.java @@ -1,7 +1,7 @@ -package mightypork.util.objects; +package mightypork.gamecore.util.objects; -import mightypork.util.math.Calc; +import mightypork.gamecore.util.math.Calc; /** @@ -73,7 +73,7 @@ public class Pair { @Override public int hashCode() { - int hash = 13; + int hash = 71; hash += (first == null ? 0 : first.hashCode()); hash += (second == null ? 0 : second.hashCode()); return hash; diff --git a/src/mightypork/util/objects/Triad.java b/src/mightypork/gamecore/util/objects/Triad.java similarity index 92% rename from src/mightypork/util/objects/Triad.java rename to src/mightypork/gamecore/util/objects/Triad.java index 4dcd9fd..a242331 100644 --- a/src/mightypork/util/objects/Triad.java +++ b/src/mightypork/gamecore/util/objects/Triad.java @@ -1,7 +1,7 @@ -package mightypork.util.objects; +package mightypork.gamecore.util.objects; -import mightypork.util.math.Calc; +import mightypork.gamecore.util.math.Calc; /** @@ -61,7 +61,6 @@ public class Triad extends Pair { if (!super.equals(obj)) return false; return Calc.areEqual(third, ((Triad) obj).third); - } diff --git a/src/mightypork/util/objects/VarargsParser.java b/src/mightypork/gamecore/util/objects/VarargsParser.java similarity index 97% rename from src/mightypork/util/objects/VarargsParser.java rename to src/mightypork/gamecore/util/objects/VarargsParser.java index 1a7ed66..2ca0809 100644 --- a/src/mightypork/util/objects/VarargsParser.java +++ b/src/mightypork/gamecore/util/objects/VarargsParser.java @@ -1,4 +1,4 @@ -package mightypork.util.objects; +package mightypork.gamecore.util.objects; import java.util.LinkedHashMap; diff --git a/src/mightypork/gamecore/util/strings/StringProvider.java b/src/mightypork/gamecore/util/strings/StringProvider.java new file mode 100644 index 0000000..b658076 --- /dev/null +++ b/src/mightypork/gamecore/util/strings/StringProvider.java @@ -0,0 +1,12 @@ +package mightypork.gamecore.util.strings; + + +/** + * Can be used for dynamic string generating + * + * @author MightyPork + */ +public interface StringProvider { + + String getString(); +} diff --git a/src/mightypork/util/string/StringUtils.java b/src/mightypork/gamecore/util/strings/StringUtils.java similarity index 98% rename from src/mightypork/util/string/StringUtils.java rename to src/mightypork/gamecore/util/strings/StringUtils.java index eded93c..12360a5 100644 --- a/src/mightypork/util/string/StringUtils.java +++ b/src/mightypork/gamecore/util/strings/StringUtils.java @@ -1,4 +1,4 @@ -package mightypork.util.string; +package mightypork.gamecore.util.strings; /** diff --git a/src/mightypork/gamecore/util/strings/StringWrapper.java b/src/mightypork/gamecore/util/strings/StringWrapper.java new file mode 100644 index 0000000..c167508 --- /dev/null +++ b/src/mightypork/gamecore/util/strings/StringWrapper.java @@ -0,0 +1,25 @@ +package mightypork.gamecore.util.strings; + +/** + * String provider with constant string + * + * @author MightyPork + */ +public class StringWrapper implements StringProvider { + + private final String value; + + + public StringWrapper(String value) + { + this.value = value; + } + + + @Override + public String getString() + { + return value; + } + +} \ No newline at end of file diff --git a/src/mightypork/util/string/filtering/CharFilter.java b/src/mightypork/gamecore/util/strings/filtering/CharFilter.java similarity index 57% rename from src/mightypork/util/string/filtering/CharFilter.java rename to src/mightypork/gamecore/util/strings/filtering/CharFilter.java index d9cebef..6585de7 100644 --- a/src/mightypork/util/string/filtering/CharFilter.java +++ b/src/mightypork/gamecore/util/strings/filtering/CharFilter.java @@ -1,4 +1,4 @@ -package mightypork.util.string.filtering; +package mightypork.gamecore.util.strings.filtering; public interface CharFilter { diff --git a/src/mightypork/util/string/filtering/RegexCharFilter.java b/src/mightypork/gamecore/util/strings/filtering/CharFilterRegex.java similarity index 55% rename from src/mightypork/util/string/filtering/RegexCharFilter.java rename to src/mightypork/gamecore/util/strings/filtering/CharFilterRegex.java index ee646fb..a74ba68 100644 --- a/src/mightypork/util/string/filtering/RegexCharFilter.java +++ b/src/mightypork/gamecore/util/strings/filtering/CharFilterRegex.java @@ -1,12 +1,12 @@ -package mightypork.util.string.filtering; +package mightypork.gamecore.util.strings.filtering; -public class RegexCharFilter implements CharFilter { +public class CharFilterRegex implements CharFilter { private final String formula; - public RegexCharFilter(String regex) + public CharFilterRegex(String regex) { this.formula = regex; } diff --git a/src/mightypork/util/string/filtering/WhitelistCharFilter.java b/src/mightypork/gamecore/util/strings/filtering/CharFilterWhitelist.java similarity index 54% rename from src/mightypork/util/string/filtering/WhitelistCharFilter.java rename to src/mightypork/gamecore/util/strings/filtering/CharFilterWhitelist.java index 8534463..f7cd1d1 100644 --- a/src/mightypork/util/string/filtering/WhitelistCharFilter.java +++ b/src/mightypork/gamecore/util/strings/filtering/CharFilterWhitelist.java @@ -1,12 +1,12 @@ -package mightypork.util.string.filtering; +package mightypork.gamecore.util.strings.filtering; -public class WhitelistCharFilter implements CharFilter { +public class CharFilterWhitelist implements CharFilter { private final String whitelist; - public WhitelistCharFilter(String allowed) + public CharFilterWhitelist(String allowed) { this.whitelist = allowed; } diff --git a/src/mightypork/util/string/filtering/StringFilter.java b/src/mightypork/gamecore/util/strings/filtering/StringFilter.java similarity index 61% rename from src/mightypork/util/string/filtering/StringFilter.java rename to src/mightypork/gamecore/util/strings/filtering/StringFilter.java index 8bbede6..6baf3e1 100644 --- a/src/mightypork/util/string/filtering/StringFilter.java +++ b/src/mightypork/gamecore/util/strings/filtering/StringFilter.java @@ -1,4 +1,4 @@ -package mightypork.util.string.filtering; +package mightypork.gamecore.util.strings.filtering; /** @@ -8,5 +8,5 @@ package mightypork.util.string.filtering; */ public interface StringFilter { - public boolean accept(String entry); + public boolean isValid(String entry); } diff --git a/src/mightypork/rogue/App.java b/src/mightypork/rogue/App.java index ef7af17..1392ca9 100644 --- a/src/mightypork/rogue/App.java +++ b/src/mightypork/rogue/App.java @@ -4,18 +4,22 @@ package mightypork.rogue; import java.io.File; import java.util.Locale; -import mightypork.gamecore.control.BaseApp; -import mightypork.gamecore.control.GameLoop; +import mightypork.gamecore.app.BaseApp; +import mightypork.gamecore.app.MainLoop; +import mightypork.gamecore.eventbus.BusEvent; +import mightypork.gamecore.eventbus.EventBus; +import mightypork.gamecore.gui.screens.CrossfadeRequest; import mightypork.gamecore.gui.screens.ScreenRegistry; import mightypork.gamecore.input.InputSystem; import mightypork.gamecore.input.KeyStroke; import mightypork.gamecore.input.Keys; -import mightypork.gamecore.loading.AsyncResourceLoader; +import mightypork.gamecore.logging.Log; +import mightypork.gamecore.logging.writers.LogWriter; import mightypork.gamecore.render.DisplaySystem; +import mightypork.gamecore.resources.loading.AsyncResourceLoader; +import mightypork.gamecore.util.ion.Ion; import mightypork.rogue.events.ActionRequest; import mightypork.rogue.events.ActionRequest.RequestType; -import mightypork.rogue.screens.CrossfadeOverlay; -import mightypork.rogue.screens.CrossfadeRequest; import mightypork.rogue.screens.FpsOverlay; import mightypork.rogue.screens.gamescreen.ScreenGame; import mightypork.rogue.screens.main_menu.ScreenMainMenu; @@ -25,11 +29,6 @@ import mightypork.rogue.screens.test_render.ScreenTestRender; import mightypork.rogue.world.WorldProvider; import mightypork.rogue.world.item.Item; import mightypork.rogue.world.level.Level; -import mightypork.util.control.eventbus.BusEvent; -import mightypork.util.control.eventbus.EventBus; -import mightypork.util.files.ion.Ion; -import mightypork.util.logging.Log; -import mightypork.util.logging.writers.LogWriter; /** @@ -46,93 +45,83 @@ public final class App extends BaseApp { */ public static void main(String[] args) { - Config.init(); - Config.save(); - (new App()).start(); } @Override - protected LogWriter createLog() - { - Locale.setDefault(Locale.ENGLISH); // for decimal point in numbers - - return Log.create("runtime", Paths.LOG_FILE, 5); - } - - - @Override - protected void initDisplay(DisplaySystem display) + protected File getLockFile() { - display.createMainWindow(Const.WINDOW_W, Const.WINDOW_H, true, Config.START_IN_FS, Const.TITLEBAR); - display.setTargetFps(Const.FPS_RENDER); + return Paths.LOCK; } @Override - protected void initScreens(ScreenRegistry screens) + protected void preInit() { - // world provider instance is referenced by screens - WorldProvider.init(this); - - screens.addScreen(new ScreenTestBouncy(this)); - screens.addScreen(new ScreenTestCat(this)); - screens.addScreen(new ScreenTestRender(this)); - screens.addScreen(new ScreenMainMenu(this)); - screens.addScreen(new ScreenGame(this)); - - screens.addOverlay(new FpsOverlay(this)); - screens.addOverlay(new CrossfadeOverlay(this)); + Config.init(); + Config.save(); - screens.showScreen("game_screen");//main_menu + WorldProvider.init(this); } @Override - protected GameLoop createLoop() + protected LogWriter createLog() { - return new MainLoop(this); + Locale.setDefault(Locale.ENGLISH); // for decimal point in numbers + + return Log.create("runtime", Paths.LOG_FILE, 5); } @Override - protected void initResources() + protected void registerIonizables() { - final AsyncResourceLoader thread = AsyncResourceLoader.launch(this); - thread.enableMainLoopQueuing(true); + super.registerIonizables(); - Res.load(this); + Ion.registerType(Item.ION_MARK, Item.class); + Ion.registerType(Level.ION_MARK, Level.class); } @Override - protected void preInit() + protected void initBus(EventBus bus) { - Ion.registerBinary(Item.ION_MARK, Item.class); - Ion.registerBinary(Level.ION_MARK, Level.class); + bus.detailedLogging = true; } @Override - protected void postInit() + protected void initDisplay(DisplaySystem display) { - // TODO tmp - WorldProvider.get().createWorld(42); + display.createMainWindow(Const.WINDOW_W, Const.WINDOW_H, true, Config.START_IN_FS, Const.TITLEBAR); + display.setTargetFps(Const.FPS_RENDER); } @Override - protected File getLockFile() + protected void initResources() { - return Paths.LOCK; + final AsyncResourceLoader thread = AsyncResourceLoader.launch(this); + thread.enableMainLoopQueuing(true); + + Res.load(this); } @Override - protected void initBus(EventBus bus) + protected void initScreens(ScreenRegistry screens) { - bus.detailedLogging = true; + super.initScreens(screens); + + screens.addScreen(new ScreenTestBouncy(this)); + screens.addScreen(new ScreenTestCat(this)); + screens.addScreen(new ScreenTestRender(this)); + screens.addScreen(new ScreenMainMenu(this)); + screens.addScreen(new ScreenGame(this)); + + screens.addOverlay(new FpsOverlay(this)); } @@ -144,6 +133,8 @@ public final class App extends BaseApp { bindEventToKey(new ActionRequest(RequestType.SCREENSHOT), Keys.F2); bindEventToKey(new CrossfadeRequest(null), Keys.L_CONTROL, Keys.Q); bindEventToKey(new CrossfadeRequest("main_menu"), Keys.L_CONTROL, Keys.M); + + // TODO tmp getInput().bindKey(new KeyStroke(Keys.N), new Runnable() { @Override @@ -167,4 +158,20 @@ public final class App extends BaseApp { }); } + + @Override + protected MainLoop createMainLoop() + { + return new GameLoop(this); + } + + + @Override + protected void postInit() + { + // TODO tmp + WorldProvider.get().createWorld(42); + + getEventBus().send(new CrossfadeRequest("game_screen")); + } } diff --git a/src/mightypork/rogue/Config.java b/src/mightypork/rogue/Config.java index 6266b21..ea28057 100644 --- a/src/mightypork/rogue/Config.java +++ b/src/mightypork/rogue/Config.java @@ -1,8 +1,8 @@ package mightypork.rogue; -import mightypork.util.files.config.PropertyManager; -import mightypork.util.logging.Log; +import mightypork.gamecore.logging.Log; +import mightypork.gamecore.util.files.config.PropertyManager; /** diff --git a/src/mightypork/rogue/Const.java b/src/mightypork/rogue/Const.java index b38d5c9..1fc5ec9 100644 --- a/src/mightypork/rogue/Const.java +++ b/src/mightypork/rogue/Const.java @@ -18,6 +18,6 @@ public final class Const { public static final int FPS_RENDER = 100; // max // INITIAL WINDOW SIZE - public static final int WINDOW_W = 640; - public static final int WINDOW_H = 480; + public static final int WINDOW_W = 800; + public static final int WINDOW_H = 600; } diff --git a/src/mightypork/rogue/MainLoop.java b/src/mightypork/rogue/GameLoop.java similarity index 86% rename from src/mightypork/rogue/MainLoop.java rename to src/mightypork/rogue/GameLoop.java index 205f75c..8ac684a 100644 --- a/src/mightypork/rogue/MainLoop.java +++ b/src/mightypork/rogue/GameLoop.java @@ -7,19 +7,19 @@ import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; -import mightypork.gamecore.control.BaseApp; -import mightypork.gamecore.control.GameLoop; +import mightypork.gamecore.app.BaseApp; +import mightypork.gamecore.app.MainLoop; +import mightypork.gamecore.gui.Action; +import mightypork.gamecore.logging.Log; import mightypork.gamecore.render.Screenshot; +import mightypork.gamecore.util.Utils; import mightypork.rogue.events.ActionRequest; import mightypork.rogue.events.ActionRequest.RequestType; -import mightypork.rogue.util.Utils; -import mightypork.util.control.Action; -import mightypork.util.logging.Log; -public final class MainLoop extends GameLoop implements ActionRequest.Listener { +public final class GameLoop extends MainLoop implements ActionRequest.Listener { - public MainLoop(BaseApp app) + public GameLoop(BaseApp app) { super(app); } diff --git a/src/mightypork/rogue/Res.java b/src/mightypork/rogue/Res.java index 1538316..1fef866 100644 --- a/src/mightypork/rogue/Res.java +++ b/src/mightypork/rogue/Res.java @@ -1,15 +1,15 @@ package mightypork.rogue; -import mightypork.gamecore.audio.SoundBank; -import mightypork.gamecore.audio.players.EffectPlayer; -import mightypork.gamecore.audio.players.LoopPlayer; -import mightypork.gamecore.control.BaseApp; -import mightypork.gamecore.render.fonts.FontBank; -import mightypork.gamecore.render.fonts.GLFont; -import mightypork.gamecore.render.fonts.Glyphs; -import mightypork.gamecore.render.fonts.impl.DeferredFont; -import mightypork.gamecore.render.textures.*; +import mightypork.gamecore.app.BaseApp; +import mightypork.gamecore.resources.audio.SoundBank; +import mightypork.gamecore.resources.audio.players.EffectPlayer; +import mightypork.gamecore.resources.audio.players.LoopPlayer; +import mightypork.gamecore.resources.fonts.FontBank; +import mightypork.gamecore.resources.fonts.GLFont; +import mightypork.gamecore.resources.fonts.Glyphs; +import mightypork.gamecore.resources.fonts.impl.DeferredFont; +import mightypork.gamecore.resources.textures.*; /** diff --git a/src/mightypork/rogue/events/ActionRequest.java b/src/mightypork/rogue/events/ActionRequest.java index c5adc5b..53b55d3 100644 --- a/src/mightypork/rogue/events/ActionRequest.java +++ b/src/mightypork/rogue/events/ActionRequest.java @@ -1,8 +1,8 @@ package mightypork.rogue.events; -import mightypork.util.control.eventbus.BusEvent; -import mightypork.util.control.eventbus.event_flags.SingleReceiverEvent; +import mightypork.gamecore.eventbus.BusEvent; +import mightypork.gamecore.eventbus.event_flags.SingleReceiverEvent; /** diff --git a/src/mightypork/rogue/screens/FpsOverlay.java b/src/mightypork/rogue/screens/FpsOverlay.java index 1c29e27..e0b67dd 100644 --- a/src/mightypork/rogue/screens/FpsOverlay.java +++ b/src/mightypork/rogue/screens/FpsOverlay.java @@ -1,20 +1,20 @@ package mightypork.rogue.screens; -import mightypork.gamecore.control.AppAccess; +import mightypork.gamecore.app.AppAccess; +import mightypork.gamecore.gui.Action; import mightypork.gamecore.gui.AlignX; import mightypork.gamecore.gui.components.painters.TextPainter; import mightypork.gamecore.gui.screens.Overlay; import mightypork.gamecore.input.KeyStroke; import mightypork.gamecore.input.Keys; -import mightypork.gamecore.render.fonts.GLFont; +import mightypork.gamecore.resources.fonts.GLFont; +import mightypork.gamecore.util.math.color.Color; +import mightypork.gamecore.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.strings.StringProvider; import mightypork.rogue.Res; -import mightypork.util.control.Action; -import mightypork.util.math.color.Color; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.rect.proxy.RectBound; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.string.StringProvider; public class FpsOverlay extends Overlay { diff --git a/src/mightypork/rogue/screens/gamescreen/HeartBar.java b/src/mightypork/rogue/screens/gamescreen/HeartBar.java index 1a5be6b..5ce7f86 100644 --- a/src/mightypork/rogue/screens/gamescreen/HeartBar.java +++ b/src/mightypork/rogue/screens/gamescreen/HeartBar.java @@ -4,10 +4,10 @@ package mightypork.rogue.screens.gamescreen; import mightypork.gamecore.gui.AlignX; import mightypork.gamecore.gui.components.VisualComponent; import mightypork.gamecore.render.Render; -import mightypork.gamecore.render.textures.TxQuad; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.num.mutable.NumVar; -import mightypork.util.math.constraints.rect.Rect; +import mightypork.gamecore.resources.textures.TxQuad; +import mightypork.gamecore.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.mutable.NumVar; +import mightypork.gamecore.util.math.constraints.rect.Rect; public class HeartBar extends VisualComponent { diff --git a/src/mightypork/rogue/screens/gamescreen/HudLayer.java b/src/mightypork/rogue/screens/gamescreen/HudLayer.java index 0cc3895..78cb070 100644 --- a/src/mightypork/rogue/screens/gamescreen/HudLayer.java +++ b/src/mightypork/rogue/screens/gamescreen/HudLayer.java @@ -8,10 +8,10 @@ import mightypork.gamecore.gui.screens.Screen; import mightypork.gamecore.gui.screens.ScreenLayer; import mightypork.gamecore.input.KeyStroke; import mightypork.gamecore.input.Keys; +import mightypork.gamecore.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.rect.Rect; import mightypork.rogue.Res; import mightypork.rogue.world.gui.Minimap; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.rect.Rect; public class HudLayer extends ScreenLayer { diff --git a/src/mightypork/rogue/screens/gamescreen/NavItemSlot.java b/src/mightypork/rogue/screens/gamescreen/NavItemSlot.java index ea8c145..fe8fb5f 100644 --- a/src/mightypork/rogue/screens/gamescreen/NavItemSlot.java +++ b/src/mightypork/rogue/screens/gamescreen/NavItemSlot.java @@ -1,19 +1,19 @@ package mightypork.rogue.screens.gamescreen; -import mightypork.gamecore.control.events.input.MouseMotionEvent; -import mightypork.gamecore.control.events.input.MouseMotionListener; +import mightypork.gamecore.eventbus.events.Updateable; import mightypork.gamecore.gui.components.ClickableComponent; +import mightypork.gamecore.input.events.MouseMotionEvent; +import mightypork.gamecore.input.events.MouseMotionListener; import mightypork.gamecore.render.Render; -import mightypork.gamecore.render.textures.TxQuad; +import mightypork.gamecore.resources.textures.TxQuad; +import mightypork.gamecore.util.math.Easing; +import mightypork.gamecore.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.mutable.NumAnimated; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.caching.RectCache; +import mightypork.gamecore.util.math.constraints.vect.Vect; import mightypork.rogue.Res; -import mightypork.util.math.Easing; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.num.mutable.NumAnimated; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.rect.caching.RectCache; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.timing.Updateable; public class NavItemSlot extends ClickableComponent implements MouseMotionListener, Updateable { diff --git a/src/mightypork/rogue/screens/gamescreen/ScreenGame.java b/src/mightypork/rogue/screens/gamescreen/ScreenGame.java index b7e115e..3c9c23e 100644 --- a/src/mightypork/rogue/screens/gamescreen/ScreenGame.java +++ b/src/mightypork/rogue/screens/gamescreen/ScreenGame.java @@ -1,7 +1,7 @@ package mightypork.rogue.screens.gamescreen; -import mightypork.gamecore.control.AppAccess; +import mightypork.gamecore.app.AppAccess; import mightypork.gamecore.gui.screens.LayeredScreen; import mightypork.rogue.world.WorldProvider; diff --git a/src/mightypork/rogue/screens/gamescreen/WorldLayer.java b/src/mightypork/rogue/screens/gamescreen/WorldLayer.java index d3bdbdd..3e51cf5 100644 --- a/src/mightypork/rogue/screens/gamescreen/WorldLayer.java +++ b/src/mightypork/rogue/screens/gamescreen/WorldLayer.java @@ -3,10 +3,10 @@ package mightypork.rogue.screens.gamescreen; import mightypork.gamecore.gui.screens.Screen; import mightypork.gamecore.gui.screens.ScreenLayer; +import mightypork.gamecore.util.math.constraints.num.Num; import mightypork.rogue.world.gui.MapView; import mightypork.rogue.world.gui.interaction.MIPClickPathfWalk; import mightypork.rogue.world.gui.interaction.MIPKeyWalk; -import mightypork.util.math.constraints.num.Num; public class WorldLayer extends ScreenLayer { diff --git a/src/mightypork/rogue/screens/main_menu/MenuButton.java b/src/mightypork/rogue/screens/main_menu/MenuButton.java index 1f287fb..7acaa9b 100644 --- a/src/mightypork/rogue/screens/main_menu/MenuButton.java +++ b/src/mightypork/rogue/screens/main_menu/MenuButton.java @@ -4,12 +4,12 @@ package mightypork.rogue.screens.main_menu; import mightypork.gamecore.gui.AlignX; import mightypork.gamecore.gui.components.ClickableComponent; import mightypork.gamecore.gui.components.painters.TextPainter; -import mightypork.gamecore.render.fonts.GLFont; +import mightypork.gamecore.resources.fonts.GLFont; +import mightypork.gamecore.util.math.color.Color; +import mightypork.gamecore.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.mutable.VectVar; import mightypork.rogue.Res; -import mightypork.util.math.color.Color; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.math.constraints.vect.mutable.VectVar; class MenuButton extends ClickableComponent { diff --git a/src/mightypork/rogue/screens/main_menu/MenuLayer.java b/src/mightypork/rogue/screens/main_menu/MenuLayer.java index 5ff08d4..8d0499f 100644 --- a/src/mightypork/rogue/screens/main_menu/MenuLayer.java +++ b/src/mightypork/rogue/screens/main_menu/MenuLayer.java @@ -1,19 +1,19 @@ package mightypork.rogue.screens.main_menu; +import mightypork.gamecore.gui.Action; import mightypork.gamecore.gui.AlignX; import mightypork.gamecore.gui.components.layout.GridLayout; import mightypork.gamecore.gui.components.painters.QuadPainter; import mightypork.gamecore.gui.components.painters.TextPainter; import mightypork.gamecore.gui.screens.BaseScreen; +import mightypork.gamecore.gui.screens.CrossfadeRequest; import mightypork.gamecore.gui.screens.ScreenLayer; +import mightypork.gamecore.util.math.color.pal.COMMODORE; +import mightypork.gamecore.util.math.color.pal.PAL16; +import mightypork.gamecore.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.rect.Rect; import mightypork.rogue.Res; -import mightypork.rogue.screens.CrossfadeRequest; -import mightypork.util.control.Action; -import mightypork.util.math.color.COMMODORE; -import mightypork.util.math.color.PAL16; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.rect.Rect; class MenuLayer extends ScreenLayer { diff --git a/src/mightypork/rogue/screens/main_menu/ScreenMainMenu.java b/src/mightypork/rogue/screens/main_menu/ScreenMainMenu.java index f558f89..6afaa15 100644 --- a/src/mightypork/rogue/screens/main_menu/ScreenMainMenu.java +++ b/src/mightypork/rogue/screens/main_menu/ScreenMainMenu.java @@ -1,7 +1,7 @@ package mightypork.rogue.screens.main_menu; -import mightypork.gamecore.control.AppAccess; +import mightypork.gamecore.app.AppAccess; import mightypork.gamecore.gui.screens.LayeredScreen; diff --git a/src/mightypork/rogue/screens/test_bouncyboxes/BouncyBox.java b/src/mightypork/rogue/screens/test_bouncyboxes/BouncyBox.java index 2251c72..feef5f8 100644 --- a/src/mightypork/rogue/screens/test_bouncyboxes/BouncyBox.java +++ b/src/mightypork/rogue/screens/test_bouncyboxes/BouncyBox.java @@ -3,15 +3,15 @@ package mightypork.rogue.screens.test_bouncyboxes; import java.util.Random; +import mightypork.gamecore.eventbus.events.Updateable; import mightypork.gamecore.gui.components.VisualComponent; import mightypork.gamecore.render.Render; -import mightypork.util.math.Easing; -import mightypork.util.math.color.Color; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.num.mutable.NumAnimated; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.rect.caching.RectCache; -import mightypork.util.timing.Updateable; +import mightypork.gamecore.util.math.Easing; +import mightypork.gamecore.util.math.color.Color; +import mightypork.gamecore.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.mutable.NumAnimated; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.caching.RectCache; public class BouncyBox extends VisualComponent implements Updateable { diff --git a/src/mightypork/rogue/screens/test_bouncyboxes/LayerBouncyBoxes.java b/src/mightypork/rogue/screens/test_bouncyboxes/LayerBouncyBoxes.java index a1e80cf..8375f08 100644 --- a/src/mightypork/rogue/screens/test_bouncyboxes/LayerBouncyBoxes.java +++ b/src/mightypork/rogue/screens/test_bouncyboxes/LayerBouncyBoxes.java @@ -11,10 +11,10 @@ import mightypork.gamecore.gui.screens.BaseScreen; import mightypork.gamecore.gui.screens.ScreenLayer; import mightypork.gamecore.input.KeyStroke; import mightypork.gamecore.input.Keys; +import mightypork.gamecore.util.math.color.Color; +import mightypork.gamecore.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.vect.Vect; import mightypork.rogue.Res; -import mightypork.util.math.color.Color; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.vect.Vect; public class LayerBouncyBoxes extends ScreenLayer { diff --git a/src/mightypork/rogue/screens/test_bouncyboxes/ScreenTestBouncy.java b/src/mightypork/rogue/screens/test_bouncyboxes/ScreenTestBouncy.java index 3223c46..43a5c54 100644 --- a/src/mightypork/rogue/screens/test_bouncyboxes/ScreenTestBouncy.java +++ b/src/mightypork/rogue/screens/test_bouncyboxes/ScreenTestBouncy.java @@ -1,7 +1,7 @@ package mightypork.rogue.screens.test_bouncyboxes; -import mightypork.gamecore.control.AppAccess; +import mightypork.gamecore.app.AppAccess; import mightypork.gamecore.gui.screens.LayeredScreen; diff --git a/src/mightypork/rogue/screens/test_cat_sound/LayerColor.java b/src/mightypork/rogue/screens/test_cat_sound/LayerColor.java index 22ed543..8c9fb6d 100644 --- a/src/mightypork/rogue/screens/test_cat_sound/LayerColor.java +++ b/src/mightypork/rogue/screens/test_cat_sound/LayerColor.java @@ -4,7 +4,7 @@ package mightypork.rogue.screens.test_cat_sound; import mightypork.gamecore.gui.components.painters.QuadPainter; import mightypork.gamecore.gui.screens.BaseScreen; import mightypork.gamecore.gui.screens.ScreenLayer; -import mightypork.util.math.color.Color; +import mightypork.gamecore.util.math.color.Color; public class LayerColor extends ScreenLayer { diff --git a/src/mightypork/rogue/screens/test_cat_sound/LayerFlyingCat.java b/src/mightypork/rogue/screens/test_cat_sound/LayerFlyingCat.java index f5cad55..430b201 100644 --- a/src/mightypork/rogue/screens/test_cat_sound/LayerFlyingCat.java +++ b/src/mightypork/rogue/screens/test_cat_sound/LayerFlyingCat.java @@ -3,8 +3,6 @@ package mightypork.rogue.screens.test_cat_sound; import java.util.Random; -import mightypork.gamecore.control.events.input.MouseButtonEvent; -import mightypork.gamecore.control.events.input.MouseButtonListener; import mightypork.gamecore.gui.AlignX; import mightypork.gamecore.gui.components.painters.ImagePainter; import mightypork.gamecore.gui.components.painters.QuadPainter; @@ -13,13 +11,15 @@ import mightypork.gamecore.gui.screens.BaseScreen; import mightypork.gamecore.gui.screens.ScreenLayer; import mightypork.gamecore.input.KeyStroke; import mightypork.gamecore.input.Keys; +import mightypork.gamecore.input.events.MouseButtonEvent; +import mightypork.gamecore.input.events.MouseButtonListener; +import mightypork.gamecore.util.math.Easing; +import mightypork.gamecore.util.math.color.Color; +import mightypork.gamecore.util.math.constraints.num.mutable.NumAnimated; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.mutable.VectAnimated; import mightypork.rogue.Res; -import mightypork.util.math.Easing; -import mightypork.util.math.color.Color; -import mightypork.util.math.constraints.num.mutable.NumAnimated; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.math.constraints.vect.mutable.VectAnimated; public class LayerFlyingCat extends ScreenLayer implements MouseButtonListener { diff --git a/src/mightypork/rogue/screens/test_cat_sound/ScreenTestCat.java b/src/mightypork/rogue/screens/test_cat_sound/ScreenTestCat.java index d52d695..cb61126 100644 --- a/src/mightypork/rogue/screens/test_cat_sound/ScreenTestCat.java +++ b/src/mightypork/rogue/screens/test_cat_sound/ScreenTestCat.java @@ -1,7 +1,7 @@ package mightypork.rogue.screens.test_cat_sound; -import mightypork.gamecore.control.AppAccess; +import mightypork.gamecore.app.AppAccess; import mightypork.gamecore.gui.screens.LayeredScreen; import mightypork.gamecore.input.KeyStroke; import mightypork.gamecore.input.Keys; diff --git a/src/mightypork/rogue/screens/test_render/LayerTestGradient.java b/src/mightypork/rogue/screens/test_render/LayerTestGradient.java index 028b3e6..0256248 100644 --- a/src/mightypork/rogue/screens/test_render/LayerTestGradient.java +++ b/src/mightypork/rogue/screens/test_render/LayerTestGradient.java @@ -4,8 +4,8 @@ package mightypork.rogue.screens.test_render; import mightypork.gamecore.gui.screens.BaseScreen; import mightypork.gamecore.gui.screens.ScreenLayer; import mightypork.gamecore.render.Render; -import mightypork.util.math.color.Color; -import mightypork.util.math.constraints.rect.proxy.RectBound; +import mightypork.gamecore.util.math.color.Color; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; public class LayerTestGradient extends ScreenLayer { diff --git a/src/mightypork/rogue/screens/test_render/ScreenTestRender.java b/src/mightypork/rogue/screens/test_render/ScreenTestRender.java index 9839ea6..dfa1c62 100644 --- a/src/mightypork/rogue/screens/test_render/ScreenTestRender.java +++ b/src/mightypork/rogue/screens/test_render/ScreenTestRender.java @@ -1,7 +1,7 @@ package mightypork.rogue.screens.test_render; -import mightypork.gamecore.control.AppAccess; +import mightypork.gamecore.app.AppAccess; import mightypork.gamecore.gui.screens.LayeredScreen; diff --git a/src/mightypork/rogue/world/PlayerControl.java b/src/mightypork/rogue/world/PlayerControl.java index f441845..7c53be1 100644 --- a/src/mightypork/rogue/world/PlayerControl.java +++ b/src/mightypork/rogue/world/PlayerControl.java @@ -4,8 +4,9 @@ package mightypork.rogue.world; import java.util.HashSet; import java.util.Set; +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.algo.Step; import mightypork.rogue.world.entity.Entity; -import mightypork.rogue.world.entity.PathStep; import mightypork.rogue.world.entity.modules.EntityMoveListener; import mightypork.rogue.world.level.Level; @@ -48,28 +49,28 @@ public abstract class PlayerControl { public void goNorth() { getPlayerEntity().pos.cancelPath(); - getPlayerEntity().pos.addStep(PathStep.NORTH); + getPlayerEntity().pos.addStep(Step.NORTH); } public void goSouth() { getPlayerEntity().pos.cancelPath(); - getPlayerEntity().pos.addStep(PathStep.SOUTH); + getPlayerEntity().pos.addStep(Step.SOUTH); } public void goEast() { getPlayerEntity().pos.cancelPath(); - getPlayerEntity().pos.addStep(PathStep.EAST); + getPlayerEntity().pos.addStep(Step.EAST); } public void goWest() { getPlayerEntity().pos.cancelPath(); - getPlayerEntity().pos.addStep(PathStep.WEST); + getPlayerEntity().pos.addStep(Step.WEST); } diff --git a/src/mightypork/rogue/world/PlayerInfo.java b/src/mightypork/rogue/world/PlayerInfo.java index bd02c5f..5a70bd2 100644 --- a/src/mightypork/rogue/world/PlayerInfo.java +++ b/src/mightypork/rogue/world/PlayerInfo.java @@ -3,11 +3,11 @@ package mightypork.rogue.world; import java.io.IOException; -import mightypork.util.files.ion.IonBundle; -import mightypork.util.files.ion.IonBundled; +import mightypork.gamecore.util.ion.IonBundle; +import mightypork.gamecore.util.ion.IonObjBundled; -public class PlayerInfo implements IonBundled { +public class PlayerInfo implements IonObjBundled { private int eid = -1; // marks not initialized private int level; diff --git a/src/mightypork/rogue/world/Sides.java b/src/mightypork/rogue/world/Sides.java deleted file mode 100644 index 0441378..0000000 --- a/src/mightypork/rogue/world/Sides.java +++ /dev/null @@ -1,60 +0,0 @@ -package mightypork.rogue.world; - - -public class Sides { - - public static final byte NW = (byte) 0b10000000; - public static final byte N = 0b01000000; - public static final byte NE = 0b00100000; - public static final byte E = 0b00010000; - public static final byte SE = 0b00001000; - public static final byte S = 0b00000100; - public static final byte SW = 0b00000010; - public static final byte W = 0b00000001; - - public static final byte CARDINAL = N | S | E | W; - public static final byte DIAGONAL = NE | NW | SE | SW; - - public static final byte NW_CORNER = W | NW | N; - public static final byte NE_CORNER = E | NE | N; - public static final byte SW_CORNER = W | SW | S; - public static final byte SE_CORNER = E | SE | S; - - //@formatter:off - public final static Coord[] allSides = { - Coord.make(-1, -1), - Coord.make(0, -1), - Coord.make(1, -1), - Coord.make(1, 0), - Coord.make(1, 1), - Coord.make(0, 1), - Coord.make(-1, 1), - Coord.make(-1, 0) - }; - - public final static Coord[] cardinalSides = { - Coord.make(0, -1), - Coord.make(1, 0), - Coord.make(0, 1), - Coord.make(-1, 0) - }; - - //@formatter:on - - /** - * Get element from all sides - * - * @param i side index - * @return the side coord - */ - public static Coord get(int i) - { - return allSides[i]; // FIXME Coord is mutable - } - - - public static byte bit(int i) - { - return (byte) (1 << (7 - i)); - } -} diff --git a/src/mightypork/rogue/world/World.java b/src/mightypork/rogue/world/World.java index 6f1ce8f..7f4eb2d 100644 --- a/src/mightypork/rogue/world/World.java +++ b/src/mightypork/rogue/world/World.java @@ -4,12 +4,12 @@ package mightypork.rogue.world; import java.io.IOException; import java.util.ArrayList; +import mightypork.gamecore.eventbus.events.Updateable; +import mightypork.gamecore.util.ion.IonBundle; +import mightypork.gamecore.util.ion.IonObjBundled; import mightypork.rogue.world.entity.Entities; import mightypork.rogue.world.entity.Entity; import mightypork.rogue.world.level.Level; -import mightypork.util.files.ion.IonBundle; -import mightypork.util.files.ion.IonBundled; -import mightypork.util.timing.Updateable; /** @@ -17,7 +17,7 @@ import mightypork.util.timing.Updateable; * * @author MightyPork */ -public class World implements IonBundled, Updateable { +public class World implements IonObjBundled, Updateable { private final ArrayList levels = new ArrayList<>(); diff --git a/src/mightypork/rogue/world/WorldProvider.java b/src/mightypork/rogue/world/WorldProvider.java index 6e0adf0..4dbef6d 100644 --- a/src/mightypork/rogue/world/WorldProvider.java +++ b/src/mightypork/rogue/world/WorldProvider.java @@ -4,11 +4,11 @@ package mightypork.rogue.world; import java.io.File; import java.io.IOException; +import mightypork.gamecore.eventbus.BusAccess; +import mightypork.gamecore.eventbus.clients.RootBusNode; +import mightypork.gamecore.util.ion.Ion; import mightypork.rogue.world.entity.Entity; import mightypork.rogue.world.level.Level; -import mightypork.util.control.eventbus.BusAccess; -import mightypork.util.control.eventbus.clients.RootBusNode; -import mightypork.util.files.ion.Ion; public class WorldProvider extends RootBusNode { diff --git a/src/mightypork/rogue/world/WorldRenderer.java b/src/mightypork/rogue/world/WorldRenderer.java index fea3d14..08f86d5 100644 --- a/src/mightypork/rogue/world/WorldRenderer.java +++ b/src/mightypork/rogue/world/WorldRenderer.java @@ -2,17 +2,18 @@ package mightypork.rogue.world; import mightypork.gamecore.render.Render; +import mightypork.gamecore.util.math.algo.Coord; +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.math.constraints.rect.RectConst; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectProxy; +import mightypork.gamecore.util.math.constraints.vect.Vect; +import mightypork.gamecore.util.math.constraints.vect.VectConst; import mightypork.rogue.Res; import mightypork.rogue.world.entity.Entity; import mightypork.rogue.world.level.Level; import mightypork.rogue.world.level.render.TileRenderContext; -import mightypork.util.math.color.RGB; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.rect.RectConst; -import mightypork.util.math.constraints.rect.proxy.RectProxy; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.math.constraints.vect.VectConst; /** diff --git a/src/mightypork/rogue/world/entity/AiTimer.java b/src/mightypork/rogue/world/entity/AiTimer.java new file mode 100644 index 0000000..722c2f2 --- /dev/null +++ b/src/mightypork/rogue/world/entity/AiTimer.java @@ -0,0 +1,44 @@ +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; + + +public abstract class AiTimer extends TaskRepeater implements IonObjBundled { + + public AiTimer(double duration) { + super(duration); + } + + + @Override + public abstract void run(); + + + @Override + public void load(IonBundle bundle) throws IOException + { + boolean wasPaused = bundle.get("paused", isPaused()); + if(wasPaused) { + pause(); + } else { + resume(); + } + + setProgress(bundle.get("progress", getProgress())); + setDuration(bundle.get("duration", getDuration())); + } + + + @Override + public void save(IonBundle bundle) throws IOException + { + bundle.put("paused", isPaused()); + bundle.put("progress", getProgress()); + bundle.put("duration", getDuration()); + } + +} diff --git a/src/mightypork/rogue/world/entity/Entities.java b/src/mightypork/rogue/world/entity/Entities.java index 0d0516d..e43e04f 100644 --- a/src/mightypork/rogue/world/entity/Entities.java +++ b/src/mightypork/rogue/world/entity/Entities.java @@ -4,13 +4,13 @@ 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.rogue.world.entity.entities.PlayerEntity; -import mightypork.util.files.ion.IonInput; -import mightypork.util.files.ion.IonOutput; /** - * Tile registry + * Entity registry * * @author MightyPork */ diff --git a/src/mightypork/rogue/world/entity/Entity.java b/src/mightypork/rogue/world/entity/Entity.java index bc11caa..f29944f 100644 --- a/src/mightypork/rogue/world/entity/Entity.java +++ b/src/mightypork/rogue/world/entity/Entity.java @@ -6,18 +6,19 @@ import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; +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.PathFindingContext; import mightypork.rogue.world.World; import mightypork.rogue.world.entity.modules.EntityModuleHealth; import mightypork.rogue.world.entity.modules.EntityModulePosition; -import mightypork.rogue.world.entity.modules.EntityMoveListener; +import mightypork.rogue.world.entity.renderers.EntityRenderer; import mightypork.rogue.world.level.Level; import mightypork.rogue.world.level.render.MapRenderContext; -import mightypork.rogue.world.pathfinding.PathFindingContext; -import mightypork.util.annotations.DefaultImpl; -import mightypork.util.error.IllegalValueException; -import mightypork.util.files.ion.IonBundle; -import mightypork.util.files.ion.IonBundled; -import mightypork.util.timing.Updateable; /** @@ -25,7 +26,7 @@ import mightypork.util.timing.Updateable; * * @author MightyPork */ -public abstract class Entity implements IonBundled, Updateable, EntityMoveListener { +public abstract class Entity implements IonObjBundled, Updateable { private Level level; private final EntityModel model; @@ -40,45 +41,76 @@ public abstract class Entity implements IonBundled, Updateable, EntityMoveListen public final EntityModuleHealth health = new EntityModuleHealth(this); - public Entity(EntityModel model, int eid) - { + public Entity(EntityModel model, int eid) { this.entityId = eid; this.model = model; // register modules - modules.put("pos", pos); - pos.addMoveListener(this); - modules.put("health", health); + addModule("pos", pos); + addModule("health", health); } @Override - public void save(IonBundle bundle) throws IOException + public final void save(IonBundle bundle) throws IOException { bundle.put("eid", entityId); + + IonBundle modulesBundle = new IonBundle(); for (final Entry entry : modules.entrySet()) { - bundle.putBundled(entry.getKey(), entry.getValue()); + modulesBundle.putBundled(entry.getKey(), entry.getValue()); } + bundle.put("modules", modulesBundle); + + IonBundle extra = new IonBundle(); + saveExtra(extra); + bundle.put("extra", extra); + } + + + @DefaultImpl + protected void saveExtra(IonBundle bundle) + { } @Override - public void load(IonBundle bundle) throws IOException + public final void load(IonBundle bundle) throws IOException { entityId = bundle.get("eid", -1); if (entityId < 0) throw new IllegalValueException("Bad entity id: " + entityId); + IonBundle modulesBundle = bundle.get("modules", new IonBundle()); + for (final Entry entry : modules.entrySet()) { - bundle.loadBundled(entry.getKey(), entry.getValue()); + modulesBundle.loadBundled(entry.getKey(), entry.getValue()); + } + + IonBundle extra = bundle.get("extra", new IonBundle()); + loadExtra(extra); + } + + + @DefaultImpl + protected void loadExtra(IonBundle bundle) + { + } + + + protected final void addModule(String key, EntityModule module) + { + if (modules.containsKey(key)) { + throw new RuntimeException("Entity module " + key + " already defined."); } + modules.put(key, module); } /** * @return unique entity id */ - public int getEntityId() + public final int getEntityId() { return entityId; } @@ -90,19 +122,19 @@ public abstract class Entity implements IonBundled, Updateable, EntityMoveListen } - public Level getLevel() + public final Level getLevel() { return level; } - public World getWorld() + public final World getWorld() { - return getLevel().getWorld(); + return level.getWorld(); } - public EntityModel getModel() + public final EntityModel getModel() { return model; } @@ -111,7 +143,14 @@ public abstract class Entity implements IonBundled, Updateable, EntityMoveListen public abstract PathFindingContext getPathfindingContext(); - public abstract void render(MapRenderContext context); + @DefaultImpl + public final void render(MapRenderContext context) + { + getRenderer().render(context); + } + + + protected abstract EntityRenderer getRenderer(); @Override @@ -123,26 +162,69 @@ public abstract class Entity implements IonBundled, Updateable, EntityMoveListen } + /** + * @return entity type (used for AI targeting) + */ + public abstract EntityType getType(); + + + /** + * @return entity coord in level + */ + public Coord getCoord() + { + return pos.getCoord(); + } + + + /** + * Called right after the entity's health reaches zero. + */ @DefaultImpl public void onKilled() { } - @Override - public void onStepFinished(Entity entity) + /** + * @return true if dead + */ + public final boolean isDead() { + return health.isDead(); } - @Override - public void onPathFinished(Entity entity) + /** + * @return whether this dead entity can be removed from level + */ + @DefaultImpl + public boolean canRemoveCorpse() { + return isDead(); } - @Override - public void onPathInterrupted(Entity entity) + /** + * Called when the dead entity was removed from the level. + */ + @DefaultImpl + public void onCorpseRemoved() { } + + + /** + * Receive damage from an attacker.
+ * The entity can decide whether to dodge, reduce damage etc. + * + * @param attacker the entity attacking. Can be null for environmental + * damage. + * @param attackStrength attack strength in health points to take + */ + public void receiveAttack(Entity attacker, int attackStrength) + { + health.receiveDamage(attackStrength); + } + } diff --git a/src/mightypork/rogue/world/entity/EntityModel.java b/src/mightypork/rogue/world/entity/EntityModel.java index 4f9f980..d9fda59 100644 --- a/src/mightypork/rogue/world/entity/EntityModel.java +++ b/src/mightypork/rogue/world/entity/EntityModel.java @@ -3,9 +3,9 @@ package mightypork.rogue.world.entity; import java.io.IOException; -import mightypork.util.files.ion.IonBundle; -import mightypork.util.files.ion.IonInput; -import mightypork.util.files.ion.IonOutput; +import mightypork.gamecore.util.ion.IonBundle; +import mightypork.gamecore.util.ion.IonInput; +import mightypork.gamecore.util.ion.IonOutput; /** diff --git a/src/mightypork/rogue/world/entity/EntityModule.java b/src/mightypork/rogue/world/entity/EntityModule.java index 63093d3..98d2b77 100644 --- a/src/mightypork/rogue/world/entity/EntityModule.java +++ b/src/mightypork/rogue/world/entity/EntityModule.java @@ -1,11 +1,50 @@ package mightypork.rogue.world.entity; -import mightypork.util.files.ion.IonBundled; -import mightypork.util.timing.Updateable; +import java.io.IOException; +import java.util.Random; +import mightypork.gamecore.eventbus.events.Updateable; +import mightypork.gamecore.util.annot.DefaultImpl; +import mightypork.gamecore.util.ion.IonBundle; +import mightypork.gamecore.util.ion.IonObjBundled; -public interface EntityModule extends IonBundled, Updateable { + +/** + * Abstract entity module + * + * @author MightyPork + */ +public abstract class EntityModule implements IonObjBundled, Updateable { + + protected final Entity entity; + protected final Random rand = new Random(); + + + public EntityModule(Entity entity) { + this.entity = entity; + } + + public abstract boolean isModuleSaved(); + + + @Override + @DefaultImpl + public void load(IonBundle bundle) throws IOException + { + } + + + @Override + @DefaultImpl + public void save(IonBundle bundle) throws IOException + { + } + @Override + @DefaultImpl + public void update(double delta) + { + } } diff --git a/src/mightypork/rogue/world/entity/EntityPathfindingContext.java b/src/mightypork/rogue/world/entity/EntityPathfindingContext.java index 139a734..125224f 100644 --- a/src/mightypork/rogue/world/entity/EntityPathfindingContext.java +++ b/src/mightypork/rogue/world/entity/EntityPathfindingContext.java @@ -1,11 +1,12 @@ package mightypork.rogue.world.entity; -import mightypork.rogue.world.Coord; -import mightypork.rogue.world.Sides; -import mightypork.rogue.world.pathfinding.Heuristic; -import mightypork.rogue.world.pathfinding.PathFinder; -import mightypork.rogue.world.pathfinding.PathFindingContext; +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.algo.Sides; +import mightypork.gamecore.util.math.algo.Step; +import mightypork.gamecore.util.math.algo.pathfinding.Heuristic; +import mightypork.gamecore.util.math.algo.pathfinding.PathFinder; +import mightypork.gamecore.util.math.algo.pathfinding.PathFindingContext; public abstract class EntityPathfindingContext implements PathFindingContext { @@ -42,7 +43,7 @@ public abstract class EntityPathfindingContext implements PathFindingContext { @Override - public Coord[] getWalkSides() + public Step[] getWalkSides() { return Sides.cardinalSides; } diff --git a/src/mightypork/rogue/world/entity/EntityType.java b/src/mightypork/rogue/world/entity/EntityType.java new file mode 100644 index 0000000..ec7c639 --- /dev/null +++ b/src/mightypork/rogue/world/entity/EntityType.java @@ -0,0 +1,12 @@ +package mightypork.rogue.world.entity; + + +/** + * Type of an entity + * + * @author MightyPork + */ +public enum EntityType +{ + PLAYER, MONSTER, PASSIVE; +} diff --git a/src/mightypork/rogue/world/entity/PathStep.java b/src/mightypork/rogue/world/entity/PathStep.java deleted file mode 100644 index 7381ca3..0000000 --- a/src/mightypork/rogue/world/entity/PathStep.java +++ /dev/null @@ -1,88 +0,0 @@ -package mightypork.rogue.world.entity; - - -import java.io.IOException; - -import mightypork.rogue.world.Coord; -import mightypork.util.files.ion.IonBinary; -import mightypork.util.files.ion.IonInput; -import mightypork.util.files.ion.IonOutput; - - -/** - * Path step.
- * Must be binary in order to be saveable in lists. - * - * @author MightyPork - */ -public class PathStep implements IonBinary { - - public static final PathStep NORTH = new PathStep(0, -1); - public static final PathStep SOUTH = new PathStep(0, 1); - public static final PathStep EAST = new PathStep(1, 0); - public static final PathStep WEST = new PathStep(-1, 0); - public static final PathStep NONE = new PathStep(0, 0); - - - public static PathStep make(int x, int y) - { - x = x < 0 ? -1 : x > 0 ? 1 : 0; - y = y < 0 ? -1 : y > 0 ? 1 : 0; - - if (y == -1) return NORTH; - if (y == 1) return SOUTH; - if (x == -1) return WEST; - if (x == 1) return EAST; - - return NONE; - } - - public static final int ION_MARK = 0; - - public int x; - public int y; - - - public PathStep(int x, int y) - { - this.x = x < 0 ? -1 : x > 0 ? 1 : 0; - this.y = y < 0 ? -1 : y > 0 ? 1 : 0; - } - - - @Override - public void load(IonInput in) throws IOException - { - x = in.readByte(); - y = in.readByte(); - } - - - @Override - public void save(IonOutput out) throws IOException - { - out.writeByte(x); - out.writeByte(y); - } - - - public Coord toCoord() - { - return Coord.make(x, y); - } - - - @Override - public short getIonMark() - { - return ION_MARK; - } - - - @Override - public String toString() - { - return "(" + x + ";" + y + ")"; - } - -} diff --git a/src/mightypork/rogue/world/entity/SimpleEntityPathFindingContext.java b/src/mightypork/rogue/world/entity/SimpleEntityPathFindingContext.java index 0e00597..0ce6edf 100644 --- a/src/mightypork/rogue/world/entity/SimpleEntityPathFindingContext.java +++ b/src/mightypork/rogue/world/entity/SimpleEntityPathFindingContext.java @@ -1,7 +1,7 @@ package mightypork.rogue.world.entity; -import mightypork.rogue.world.Coord; +import mightypork.gamecore.util.math.algo.Coord; public class SimpleEntityPathFindingContext extends EntityPathfindingContext { diff --git a/src/mightypork/rogue/world/entity/entities/MonsterAi.java b/src/mightypork/rogue/world/entity/entities/MonsterAi.java new file mode 100644 index 0000000..d1c39a4 --- /dev/null +++ b/src/mightypork/rogue/world/entity/entities/MonsterAi.java @@ -0,0 +1,226 @@ +package mightypork.rogue.world.entity.entities; + + +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.algo.Coord; +import mightypork.gamecore.util.math.algo.Step; +import mightypork.gamecore.util.math.algo.pathfinding.PathFinder; +import mightypork.gamecore.util.math.algo.pathfinding.PathFindingContext; +import mightypork.gamecore.util.math.algo.pathfinding.PathFindingContextProxy; +import mightypork.rogue.world.entity.AiTimer; +import mightypork.rogue.world.entity.Entity; +import mightypork.rogue.world.entity.EntityModule; +import mightypork.rogue.world.entity.EntityType; +import mightypork.rogue.world.entity.modules.EntityMoveListener; +import mightypork.rogue.world.tile.Tile; + + +public class MonsterAi extends EntityModule implements EntityMoveListener { + + private boolean sleeping = true; + private boolean chasing = false; + + private AiTimer timerFindPrey = new AiTimer(3) { + + @Override + public void run() + { + System.out.println("Mob looks around."); + lookForTarget(); + } + }; + + private AiTimer timerSleepStart = new AiTimer(10) { + + @Override + public void run() + { + System.out.println("Mob going to sleep"); + sleeping = true; + } + }; + + private PathFindingContext pathfcNoDoor; + + private int targetId = -1; + + + public MonsterAi(final Entity entity) { + super(entity); + + pathfcNoDoor = new PathFindingContextProxy(entity.getPathfindingContext()) { + + @Override + public boolean isAccessible(Coord pos) + { + Tile t = entity.getLevel().getTile(pos); + if (t.isDoor()) return false; + + return super.isAccessible(pos); + } + + }; + } + + + private void lookForTarget() + { + if (rand.nextInt(3) == 0) return; // not hungry right now + + Entity prey = entity.getLevel().getClosestEntity(entity, EntityType.PLAYER, getScanRadius()); + if (prey != null) { + + // check if reachable without leaving room + List noDoorPath = PathFinder.findPath(pathfcNoDoor, entity.getCoord(), prey.getCoord()); + + if (noDoorPath == null) { + return; // cant reach, give up + } + + startChasing(prey); + } + } + + + private void startChasing(Entity prey) + { + // TODO if too close, attack directly + + targetId = prey.getEntityId(); + chasing = true; + sleeping = false; + + // not good to take a nap while chasing + timerSleepStart.pause(); + + // follow this one prey + timerFindPrey.pause(); + + onStepFinished(); // go towards prey + } + + + private void stopChasing() + { + chasing = false; + targetId = -1; + timerSleepStart.restart(); + timerFindPrey.restart(); + } + + + private List getPathToPrey(Entity prey) + { + return PathFinder.findPathRelative(entity.getPathfindingContext(), entity.getCoord(), prey.getCoord()); + } + + + protected double getScanRadius() + { + return sleeping ? 1 + rand.nextInt(3) : 4 + rand.nextInt(4); // For override + } + + + protected int getPreyAbandonDistance() + { + return 5 + rand.nextInt(4); // For override + } + + + @DefaultImpl + @Override + public void onStepFinished() + { + if (chasing) { + Entity prey = entity.getLevel().getEntity(targetId); + if (prey == null || prey.isDead()) { + stopChasing(); + return; + } + + + stepTowardsPrey(prey); + + // TODO if close enough, attack. + } + } + + + private void stepTowardsPrey(Entity prey) + { + // if close enough + Coord preyPos = prey.getCoord(); + if(preyPos.dist(entity.getCoord()) <= 1.5) { + attackPrey(prey); + return; + } + + List preyPath = getPathToPrey(prey); + + if (preyPath.size() > getPreyAbandonDistance()) { + stopChasing(); + return; + } + + entity.pos.addStep(preyPath.get(0)); + } + + + private void attackPrey(Entity prey) + { + prey.receiveAttack(entity, getAttackStrength()); + } + + + protected int getAttackStrength() { + return 1; // For override + } + + + @Override + public void onPathFinished() + { + } + + + @Override + public void onPathInterrupted() + { + } + + + @Override + public void save(IonBundle bundle) throws IOException + { + bundle.putBundled("tscan", timerFindPrey); + bundle.putBundled("tsleep", timerSleepStart); + } + + + @Override + public void load(IonBundle bundle) throws IOException + { + bundle.loadBundled("tscan", timerFindPrey); + bundle.loadBundled("tsleep", timerSleepStart); + } + + + @Override + public boolean isModuleSaved() + { + return true; + } + + + @Override + public void update(double delta) + { + timerFindPrey.update(delta); + timerSleepStart.update(delta); + } + +} diff --git a/src/mightypork/rogue/world/entity/entities/PlayerEntity.java b/src/mightypork/rogue/world/entity/entities/PlayerEntity.java index fdec535..50a7a15 100644 --- a/src/mightypork/rogue/world/entity/entities/PlayerEntity.java +++ b/src/mightypork/rogue/world/entity/entities/PlayerEntity.java @@ -1,48 +1,87 @@ package mightypork.rogue.world.entity.entities; -import mightypork.rogue.world.Coord; -import mightypork.rogue.world.entity.Entity; -import mightypork.rogue.world.entity.EntityModel; -import mightypork.rogue.world.entity.EntityPathfindingContext; -import mightypork.rogue.world.entity.SimpleEntityPathFindingContext; +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.algo.pathfinding.PathFindingContext; +import mightypork.rogue.world.entity.*; +import mightypork.rogue.world.entity.modules.EntityMoveListener; import mightypork.rogue.world.entity.renderers.EntityRenderer; import mightypork.rogue.world.entity.renderers.EntityRendererMobLR; import mightypork.rogue.world.level.Level; -import mightypork.rogue.world.level.render.MapRenderContext; -import mightypork.rogue.world.pathfinding.PathFindingContext; public class PlayerEntity extends Entity { - private final EntityPathfindingContext pathfc = new SimpleEntityPathFindingContext(this) { + class PlayerAi extends EntityModule implements EntityMoveListener { + + public PlayerAi(Entity entity) { + super(entity); + } + + + @Override + public void onStepFinished() + { + entity.getLevel().explore(entity.pos.getCoord()); + } + @Override - public int getCost(Coord from, Coord to) + public void onPathFinished() { - - if (!getLevel().getTile(pos.getCoord()).isExplored()) { return 1000; } - - return super.getCost(from, to); - - }; - }; + } + + + @Override + public void onPathInterrupted() + { + } + + + @Override + public boolean isModuleSaved() + { + return false; + } + + } - private final EntityRenderer renderer = new EntityRendererMobLR(this, "sprite.player"); + private EntityPathfindingContext pathfc; + private EntityRenderer renderer; + private final PlayerAi ai = new PlayerAi(this); - public PlayerEntity(EntityModel model, int eid) - { + + public PlayerEntity(EntityModel model, int eid) { super(model, eid); - // init default values pos.setStepTime(0.25); + + addModule("ai", ai); + pos.addMoveListener(ai); } @Override public PathFindingContext getPathfindingContext() { + if (pathfc == null) { + pathfc = new SimpleEntityPathFindingContext(this) { + + @Override + public int getCost(Coord from, Coord to) + { + + if (!getLevel().getTile(pos.getCoord()).isExplored()) { + return 1000; + } + + return super.getCost(from, to); + + }; + }; + } + return pathfc; } @@ -51,20 +90,24 @@ public class PlayerEntity extends Entity { public void setLevel(Level level) { super.setLevel(level); - onStepFinished(this); + ai.onStepFinished(); // explore start area } @Override - public void render(MapRenderContext context) + protected EntityRenderer getRenderer() { - renderer.render(context); + if (renderer == null) { + renderer = new EntityRendererMobLR(this, "sprite.player"); + } + + return renderer; } - @Override - public void onStepFinished(Entity entity) + public EntityType getType() { - getLevel().explore(pos.getCoord()); + return EntityType.PLAYER; } + } diff --git a/src/mightypork/rogue/world/entity/entities/SimpleMonster.java b/src/mightypork/rogue/world/entity/entities/SimpleMonster.java new file mode 100644 index 0000000..015259f --- /dev/null +++ b/src/mightypork/rogue/world/entity/entities/SimpleMonster.java @@ -0,0 +1,38 @@ +package mightypork.rogue.world.entity.entities; + + +import mightypork.gamecore.util.math.algo.pathfinding.PathFindingContext; +import mightypork.rogue.world.entity.*; + + +public abstract class SimpleMonster extends Entity { + + /** Navigation PFC */ + private EntityPathfindingContext pathfc; + + private EntityModule ai = new MonsterAi(this); + + public SimpleMonster(EntityModel model, int eid) { + super(model, eid); + + addModule("ai", ai); + } + + + @Override + public PathFindingContext getPathfindingContext() + { + if (pathfc == null) { + pathfc = new SimpleEntityPathFindingContext(this); + } + + return pathfc; + } + + @Override + public EntityType getType() + { + return EntityType.MONSTER; + } + +} diff --git a/src/mightypork/rogue/world/entity/modules/EntityModuleHealth.java b/src/mightypork/rogue/world/entity/modules/EntityModuleHealth.java index e779987..15256ab 100644 --- a/src/mightypork/rogue/world/entity/modules/EntityModuleHealth.java +++ b/src/mightypork/rogue/world/entity/modules/EntityModuleHealth.java @@ -3,22 +3,19 @@ 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.rogue.world.entity.Entity; import mightypork.rogue.world.entity.EntityModule; -import mightypork.util.error.IllegalValueException; -import mightypork.util.files.ion.IonBundle; -import mightypork.util.math.Calc; -public class EntityModuleHealth implements EntityModule { +public class EntityModuleHealth extends EntityModule { - public EntityModuleHealth(Entity entity) - { - this.entity = entity; + public EntityModuleHealth(Entity entity) { + super(entity); } - private final Entity entity; - protected int health = 1; protected int maxHealth = 1; protected boolean dead = false; @@ -43,8 +40,9 @@ public class EntityModuleHealth implements EntityModule { @Override - public void update(double delta) + public boolean isModuleSaved() { + return true; } @@ -90,4 +88,10 @@ public class EntityModuleHealth implements EntityModule { this.dead = dead; } + + public void receiveDamage(int attackStrength) + { + setHealth(health - attackStrength); + } + } diff --git a/src/mightypork/rogue/world/entity/modules/EntityModulePosition.java b/src/mightypork/rogue/world/entity/modules/EntityModulePosition.java index ced6c82..80cbd4e 100644 --- a/src/mightypork/rogue/world/entity/modules/EntityModulePosition.java +++ b/src/mightypork/rogue/world/entity/modules/EntityModulePosition.java @@ -8,25 +8,23 @@ import java.util.List; import java.util.Queue; import java.util.Set; -import mightypork.rogue.world.Coord; +import mightypork.gamecore.util.ion.IonBundle; +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.algo.Step; +import mightypork.gamecore.util.math.algo.pathfinding.PathFinder; +import mightypork.gamecore.util.math.algo.pathfinding.PathFindingContext; +import mightypork.gamecore.util.math.constraints.vect.VectConst; import mightypork.rogue.world.entity.Entity; import mightypork.rogue.world.entity.EntityModule; -import mightypork.rogue.world.entity.PathStep; -import mightypork.rogue.world.pathfinding.PathFinder; -import mightypork.rogue.world.pathfinding.PathFindingContext; -import mightypork.util.files.ion.IonBundle; -import mightypork.util.math.constraints.vect.VectConst; -public class EntityModulePosition implements EntityModule { - - private final Entity entity; +public class EntityModulePosition extends EntityModule { /** Last pos, will be freed upon finishing move */ private final Coord lastPos = new Coord(0, 0); private boolean walking = false; - private final Queue path = new LinkedList<>(); + private final Queue path = new LinkedList<>(); private final EntityPos entityPos = new EntityPos(); private double stepTime = 0.5; @@ -39,7 +37,7 @@ public class EntityModulePosition implements EntityModule { public EntityModulePosition(Entity entity) { - this.entity = entity; + super(entity); } @@ -60,6 +58,12 @@ public class EntityModulePosition implements EntityModule { stepTime = bundle.get("step_time", stepTime); } + + @Override + public boolean isModuleSaved() + { + return true; + } public void setPosition(Coord coord) @@ -85,12 +89,12 @@ public class EntityModulePosition implements EntityModule { entity.getLevel().freeTile(lastPos); for (final EntityMoveListener l : moveListeners) { - l.onStepFinished(entity); + l.onStepFinished(); } if (path.isEmpty()) { for (final EntityMoveListener l : moveListeners) { - l.onPathFinished(entity); + l.onPathFinished(); } } } @@ -99,7 +103,7 @@ public class EntityModulePosition implements EntityModule { walking = true; - final PathStep step = path.poll(); + final Step step = path.poll(); final Coord planned = entityPos.getCoord().add(step.toCoord()); @@ -107,15 +111,15 @@ public class EntityModulePosition implements EntityModule { cancelPath(); for (final EntityMoveListener l : moveListeners) { - l.onPathInterrupted(entity); + l.onPathInterrupted(); } walking = false; } else { // tmp for renderer - if (step.x != 0) this.lastXDir = step.x; - if (step.y != 0) this.lastYDir = step.y; + if (step.x() != 0) this.lastXDir = step.x(); + if (step.y() != 0) this.lastYDir = step.y(); lastPos.setTo(entityPos.getCoord()); entityPos.walk(step, stepTime); @@ -131,7 +135,7 @@ public class EntityModulePosition implements EntityModule { } - public void addStep(PathStep step) + public void addStep(Step step) { path.add(step); } @@ -147,7 +151,7 @@ public class EntityModulePosition implements EntityModule { { if (target.equals(getCoord())) return true; final PathFindingContext pfc = entity.getPathfindingContext(); - final List newPath = PathFinder.findPathRelative(pfc, entityPos.getCoord(), target); + final List newPath = PathFinder.findPathRelative(pfc, entityPos.getCoord(), target); if (newPath == null) return false; cancelPath(); @@ -165,7 +169,7 @@ public class EntityModulePosition implements EntityModule { } - public void addSteps(List path) + public void addSteps(List path) { this.path.addAll(path); } diff --git a/src/mightypork/rogue/world/entity/modules/EntityMoveListener.java b/src/mightypork/rogue/world/entity/modules/EntityMoveListener.java index 1bdb7f8..1c4c23e 100644 --- a/src/mightypork/rogue/world/entity/modules/EntityMoveListener.java +++ b/src/mightypork/rogue/world/entity/modules/EntityMoveListener.java @@ -1,7 +1,6 @@ package mightypork.rogue.world.entity.modules; -import mightypork.rogue.world.entity.Entity; public interface EntityMoveListener { @@ -9,18 +8,18 @@ public interface EntityMoveListener { /** * One step of a path finished */ - void onStepFinished(Entity entity); + void onStepFinished(); /** * Scheduled path finished */ - void onPathFinished(Entity entity); + void onPathFinished(); /** * Path was interrupted (bumped into a wall or entity) */ - void onPathInterrupted(Entity entity); + void onPathInterrupted(); } diff --git a/src/mightypork/rogue/world/entity/modules/EntityPos.java b/src/mightypork/rogue/world/entity/modules/EntityPos.java index 485d295..78c95ce 100644 --- a/src/mightypork/rogue/world/entity/modules/EntityPos.java +++ b/src/mightypork/rogue/world/entity/modules/EntityPos.java @@ -3,15 +3,15 @@ package mightypork.rogue.world.entity.modules; import java.io.IOException; -import mightypork.rogue.world.Coord; -import mightypork.rogue.world.entity.PathStep; -import mightypork.util.files.ion.IonBundle; -import mightypork.util.files.ion.IonBundled; -import mightypork.util.math.Easing; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.math.constraints.vect.VectConst; -import mightypork.util.math.constraints.vect.mutable.VectAnimated; -import mightypork.util.timing.Updateable; +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.Step; +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; /** @@ -19,7 +19,7 @@ import mightypork.util.timing.Updateable; * * @author MightyPork */ -class EntityPos implements IonBundled, Updateable { +class EntityPos implements IonObjBundled, Updateable { private final Coord coord = new Coord(0, 0); private final VectAnimated walkOffset = new VectAnimated(Vect.ZERO, Easing.LINEAR); @@ -128,10 +128,10 @@ class EntityPos implements IonBundled, Updateable { } - public void walk(PathStep step, double secs) + public void walk(Step step, double secs) { - setTo(coord.x + step.x, coord.y + step.y); - walkOffset.setTo(-step.x, -step.y); + setTo(coord.x + step.x(), coord.y + step.y()); + walkOffset.setTo(-step.x(), -step.y()); walkOffset.animate(0, 0, 0, secs); } diff --git a/src/mightypork/rogue/world/entity/renderers/EntityRendererMobLR.java b/src/mightypork/rogue/world/entity/renderers/EntityRendererMobLR.java index f87e7aa..316b253 100644 --- a/src/mightypork/rogue/world/entity/renderers/EntityRendererMobLR.java +++ b/src/mightypork/rogue/world/entity/renderers/EntityRendererMobLR.java @@ -2,14 +2,14 @@ package mightypork.rogue.world.entity.renderers; import mightypork.gamecore.render.Render; -import mightypork.gamecore.render.textures.TxQuad; -import mightypork.gamecore.render.textures.TxSheet; +import mightypork.gamecore.resources.textures.TxQuad; +import mightypork.gamecore.resources.textures.TxSheet; +import mightypork.gamecore.util.math.Calc; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.vect.Vect; import mightypork.rogue.Res; import mightypork.rogue.world.entity.Entity; import mightypork.rogue.world.level.render.MapRenderContext; -import mightypork.util.math.Calc; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.vect.Vect; /** diff --git a/src/mightypork/rogue/world/gen/LevelGenerator.java b/src/mightypork/rogue/world/gen/LevelGenerator.java index 75a1d53..56ec53b 100644 --- a/src/mightypork/rogue/world/gen/LevelGenerator.java +++ b/src/mightypork/rogue/world/gen/LevelGenerator.java @@ -3,7 +3,7 @@ package mightypork.rogue.world.gen; import java.util.Random; -import mightypork.rogue.world.Coord; +import mightypork.gamecore.util.math.algo.Coord; import mightypork.rogue.world.gen.rooms.DeadEndRoom; import mightypork.rogue.world.gen.rooms.SimpleRectRoom; import mightypork.rogue.world.gen.themes.ThemeDungeon; diff --git a/src/mightypork/rogue/world/gen/RoomBuilder.java b/src/mightypork/rogue/world/gen/RoomBuilder.java index fd5c57c..02bdf4f 100644 --- a/src/mightypork/rogue/world/gen/RoomBuilder.java +++ b/src/mightypork/rogue/world/gen/RoomBuilder.java @@ -3,7 +3,7 @@ package mightypork.rogue.world.gen; import java.util.Random; -import mightypork.rogue.world.Coord; +import mightypork.gamecore.util.math.algo.Coord; /** diff --git a/src/mightypork/rogue/world/gen/RoomDesc.java b/src/mightypork/rogue/world/gen/RoomDesc.java index 8a1be99..4d2f622 100644 --- a/src/mightypork/rogue/world/gen/RoomDesc.java +++ b/src/mightypork/rogue/world/gen/RoomDesc.java @@ -1,7 +1,7 @@ package mightypork.rogue.world.gen; -import mightypork.rogue.world.Coord; +import mightypork.gamecore.util.math.algo.Coord; /** diff --git a/src/mightypork/rogue/world/gen/ScratchMap.java b/src/mightypork/rogue/world/gen/ScratchMap.java index 575c14e..751b2b7 100644 --- a/src/mightypork/rogue/world/gen/ScratchMap.java +++ b/src/mightypork/rogue/world/gen/ScratchMap.java @@ -7,19 +7,25 @@ import java.util.List; import java.util.Random; import java.util.Set; -import mightypork.rogue.world.Coord; -import mightypork.rogue.world.Sides; +import mightypork.gamecore.logging.Log; +import mightypork.gamecore.util.math.Calc; +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.algo.Sides; +import mightypork.gamecore.util.math.algo.Step; +import mightypork.gamecore.util.math.algo.pathfinding.Heuristic; +import mightypork.gamecore.util.math.algo.pathfinding.PathFinder; +import mightypork.gamecore.util.math.algo.pathfinding.PathFindingContext; import mightypork.rogue.world.level.Level; -import mightypork.rogue.world.pathfinding.Heuristic; -import mightypork.rogue.world.pathfinding.PathFinder; -import mightypork.rogue.world.pathfinding.PathFindingContext; import mightypork.rogue.world.tile.Tile; import mightypork.rogue.world.tile.TileModel; import mightypork.rogue.world.tile.Tiles; -import mightypork.util.logging.Log; -import mightypork.util.math.Calc; +/** + * Temporary tile map used for level generation. + * + * @author MightyPork + */ public class ScratchMap { private Tile[][] map; @@ -27,7 +33,9 @@ public class ScratchMap { private final int height; private final List rooms = new ArrayList<>(); - private final List nodes = new ArrayList<>(); // points to connect with corridors + + /** Coords to connect with corridors */ + private final List nodes = new ArrayList<>(); private final PathFindingContext pfc = new PathFindingContext() { @@ -79,7 +87,7 @@ public class ScratchMap { @Override - public Coord[] getWalkSides() + public Step[] getWalkSides() { return Sides.cardinalSides; } diff --git a/src/mightypork/rogue/world/gen/rooms/DeadEndRoom.java b/src/mightypork/rogue/world/gen/rooms/DeadEndRoom.java index a093543..23f2cb4 100644 --- a/src/mightypork/rogue/world/gen/rooms/DeadEndRoom.java +++ b/src/mightypork/rogue/world/gen/rooms/DeadEndRoom.java @@ -3,7 +3,7 @@ package mightypork.rogue.world.gen.rooms; import java.util.Random; -import mightypork.rogue.world.Coord; +import mightypork.gamecore.util.math.algo.Coord; import mightypork.rogue.world.gen.RoomBuilder; import mightypork.rogue.world.gen.RoomDesc; import mightypork.rogue.world.gen.ScratchMap; diff --git a/src/mightypork/rogue/world/gen/rooms/SimpleRectRoom.java b/src/mightypork/rogue/world/gen/rooms/SimpleRectRoom.java index d93c725..df31f42 100644 --- a/src/mightypork/rogue/world/gen/rooms/SimpleRectRoom.java +++ b/src/mightypork/rogue/world/gen/rooms/SimpleRectRoom.java @@ -3,8 +3,8 @@ package mightypork.rogue.world.gen.rooms; import java.util.Random; -import mightypork.rogue.world.Coord; -import mightypork.rogue.world.Sides; +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.algo.Sides; import mightypork.rogue.world.gen.RoomBuilder; import mightypork.rogue.world.gen.RoomDesc; import mightypork.rogue.world.gen.ScratchMap; diff --git a/src/mightypork/rogue/world/gui/MapView.java b/src/mightypork/rogue/world/gui/MapView.java index 28bcb64..bd8325b 100644 --- a/src/mightypork/rogue/world/gui/MapView.java +++ b/src/mightypork/rogue/world/gui/MapView.java @@ -4,24 +4,23 @@ package mightypork.rogue.world.gui; import java.util.HashSet; import java.util.Set; -import mightypork.gamecore.control.events.input.KeyEvent; -import mightypork.gamecore.control.events.input.KeyListener; -import mightypork.gamecore.control.events.input.MouseButtonEvent; -import mightypork.gamecore.control.events.input.MouseButtonListener; +import mightypork.gamecore.eventbus.events.Updateable; import mightypork.gamecore.gui.components.InputComponent; import mightypork.gamecore.input.Keys; -import mightypork.rogue.world.Coord; +import mightypork.gamecore.input.events.KeyEvent; +import mightypork.gamecore.input.events.KeyListener; +import mightypork.gamecore.input.events.MouseButtonEvent; +import mightypork.gamecore.input.events.MouseButtonListener; +import mightypork.gamecore.util.math.Easing; +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.constraints.num.Num; +import mightypork.gamecore.util.math.constraints.num.mutable.NumAnimated; +import mightypork.gamecore.util.math.constraints.vect.Vect; import mightypork.rogue.world.PlayerControl; import mightypork.rogue.world.WorldProvider; import mightypork.rogue.world.WorldRenderer; -import mightypork.rogue.world.entity.Entity; import mightypork.rogue.world.entity.modules.EntityMoveListener; import mightypork.rogue.world.gui.interaction.MapInteractionPlugin; -import mightypork.util.math.Easing; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.num.mutable.NumAnimated; -import mightypork.util.math.constraints.vect.Vect; -import mightypork.util.timing.Updateable; /** @@ -69,7 +68,7 @@ public class MapView extends InputComponent implements KeyListener, MouseButtonL @Override - public void onStepFinished(Entity entity) + public void onStepFinished() { for (final MapInteractionPlugin p : plugins) { p.onStepEnd(this, pc); @@ -78,7 +77,7 @@ public class MapView extends InputComponent implements KeyListener, MouseButtonL @Override - public void onPathFinished(Entity entity) + public void onPathFinished() { for (final MapInteractionPlugin p : plugins) { p.onStepEnd(this, pc); @@ -87,7 +86,7 @@ public class MapView extends InputComponent implements KeyListener, MouseButtonL @Override - public void onPathInterrupted(Entity entity) + public void onPathInterrupted() { for (final MapInteractionPlugin p : plugins) { p.onStepEnd(this, pc); diff --git a/src/mightypork/rogue/world/gui/Minimap.java b/src/mightypork/rogue/world/gui/Minimap.java index 6e37eb8..f722557 100644 --- a/src/mightypork/rogue/world/gui/Minimap.java +++ b/src/mightypork/rogue/world/gui/Minimap.java @@ -1,21 +1,21 @@ package mightypork.rogue.world.gui; -import mightypork.gamecore.control.events.input.MouseButtonEvent; -import mightypork.gamecore.control.events.input.MouseButtonListener; import mightypork.gamecore.gui.components.InputComponent; +import mightypork.gamecore.input.events.MouseButtonEvent; +import mightypork.gamecore.input.events.MouseButtonListener; import mightypork.gamecore.render.Render; -import mightypork.rogue.world.Coord; +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.color.Color; +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.math.constraints.rect.mutable.RectMutable; +import mightypork.gamecore.util.math.constraints.vect.Vect; import mightypork.rogue.world.WorldProvider; import mightypork.rogue.world.entity.Entity; import mightypork.rogue.world.level.Level; import mightypork.rogue.world.tile.Tile; -import mightypork.util.math.color.Color; -import mightypork.util.math.color.RGB; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.rect.mutable.RectMutable; -import mightypork.util.math.constraints.vect.Vect; import org.lwjgl.opengl.GL11; diff --git a/src/mightypork/rogue/world/gui/interaction/MIPClickPathfWalk.java b/src/mightypork/rogue/world/gui/interaction/MIPClickPathfWalk.java index 113b144..f142020 100644 --- a/src/mightypork/rogue/world/gui/interaction/MIPClickPathfWalk.java +++ b/src/mightypork/rogue/world/gui/interaction/MIPClickPathfWalk.java @@ -2,10 +2,10 @@ package mightypork.rogue.world.gui.interaction; import mightypork.gamecore.input.InputSystem; -import mightypork.rogue.world.Coord; +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.constraints.vect.Vect; import mightypork.rogue.world.PlayerControl; import mightypork.rogue.world.gui.MapView; -import mightypork.util.math.constraints.vect.Vect; public class MIPClickPathfWalk implements MapInteractionPlugin { diff --git a/src/mightypork/rogue/world/gui/interaction/MIPKeyWalk.java b/src/mightypork/rogue/world/gui/interaction/MIPKeyWalk.java index 958d1f2..14bb129 100644 --- a/src/mightypork/rogue/world/gui/interaction/MIPKeyWalk.java +++ b/src/mightypork/rogue/world/gui/interaction/MIPKeyWalk.java @@ -3,9 +3,9 @@ package mightypork.rogue.world.gui.interaction; import mightypork.gamecore.input.InputSystem; import mightypork.gamecore.input.Keys; +import mightypork.gamecore.util.math.constraints.vect.Vect; import mightypork.rogue.world.PlayerControl; import mightypork.rogue.world.gui.MapView; -import mightypork.util.math.constraints.vect.Vect; public class MIPKeyWalk implements MapInteractionPlugin { diff --git a/src/mightypork/rogue/world/gui/interaction/MIPMouseWalk.java b/src/mightypork/rogue/world/gui/interaction/MIPMouseWalk.java index c8aed7a..2cec069 100644 --- a/src/mightypork/rogue/world/gui/interaction/MIPMouseWalk.java +++ b/src/mightypork/rogue/world/gui/interaction/MIPMouseWalk.java @@ -2,12 +2,12 @@ package mightypork.rogue.world.gui.interaction; import mightypork.gamecore.input.InputSystem; -import mightypork.rogue.world.Coord; +import mightypork.gamecore.util.math.Calc.Deg; +import mightypork.gamecore.util.math.Polar; +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.constraints.vect.Vect; import mightypork.rogue.world.PlayerControl; import mightypork.rogue.world.gui.MapView; -import mightypork.util.math.Calc.Deg; -import mightypork.util.math.Polar; -import mightypork.util.math.constraints.vect.Vect; public class MIPMouseWalk implements MapInteractionPlugin { diff --git a/src/mightypork/rogue/world/gui/interaction/MapInteractionPlugin.java b/src/mightypork/rogue/world/gui/interaction/MapInteractionPlugin.java index c97c01a..588f257 100644 --- a/src/mightypork/rogue/world/gui/interaction/MapInteractionPlugin.java +++ b/src/mightypork/rogue/world/gui/interaction/MapInteractionPlugin.java @@ -1,9 +1,9 @@ package mightypork.rogue.world.gui.interaction; +import mightypork.gamecore.util.math.constraints.vect.Vect; import mightypork.rogue.world.PlayerControl; import mightypork.rogue.world.gui.MapView; -import mightypork.util.math.constraints.vect.Vect; public interface MapInteractionPlugin { diff --git a/src/mightypork/rogue/world/item/Item.java b/src/mightypork/rogue/world/item/Item.java index 1bd8bce..0248bb0 100644 --- a/src/mightypork/rogue/world/item/Item.java +++ b/src/mightypork/rogue/world/item/Item.java @@ -3,13 +3,13 @@ package mightypork.rogue.world.item; import java.io.IOException; -import mightypork.util.files.ion.IonBinary; -import mightypork.util.files.ion.IonInput; -import mightypork.util.files.ion.IonOutput; -import mightypork.util.math.constraints.rect.proxy.RectBound; +import mightypork.gamecore.util.ion.IonInput; +import mightypork.gamecore.util.ion.IonObjBinary; +import mightypork.gamecore.util.ion.IonOutput; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; -public class Item implements IonBinary { +public class Item implements IonObjBinary { public static final short ION_MARK = 51; diff --git a/src/mightypork/rogue/world/item/ItemModel.java b/src/mightypork/rogue/world/item/ItemModel.java index 66356e9..d32412c 100644 --- a/src/mightypork/rogue/world/item/ItemModel.java +++ b/src/mightypork/rogue/world/item/ItemModel.java @@ -1,8 +1,8 @@ package mightypork.rogue.world.item; -import mightypork.util.annotations.DefaultImpl; -import mightypork.util.math.constraints.rect.proxy.RectBound; +import mightypork.gamecore.util.annot.DefaultImpl; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; public abstract class ItemModel { diff --git a/src/mightypork/rogue/world/level/Level.java b/src/mightypork/rogue/world/level/Level.java index 3d2d9a5..1ebbacd 100644 --- a/src/mightypork/rogue/world/level/Level.java +++ b/src/mightypork/rogue/world/level/Level.java @@ -2,29 +2,27 @@ package mightypork.rogue.world.level; import java.io.IOException; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; +import java.util.*; -import mightypork.rogue.world.Coord; -import mightypork.rogue.world.Sides; +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.algo.Coord; +import mightypork.gamecore.util.math.algo.Sides; +import mightypork.gamecore.util.math.algo.Step; +import mightypork.gamecore.util.math.algo.floodfill.FillContext; +import mightypork.gamecore.util.math.algo.floodfill.FloodFill; +import mightypork.gamecore.util.math.noise.NoiseGen; import mightypork.rogue.world.World; import mightypork.rogue.world.entity.Entities; import mightypork.rogue.world.entity.Entity; -import mightypork.rogue.world.pathfinding.FillContext; -import mightypork.rogue.world.pathfinding.FloodFill; +import mightypork.rogue.world.entity.EntityType; import mightypork.rogue.world.tile.Tile; import mightypork.rogue.world.tile.TileModel; import mightypork.rogue.world.tile.TileType; import mightypork.rogue.world.tile.Tiles; -import mightypork.util.files.ion.IonBinary; -import mightypork.util.files.ion.IonBundle; -import mightypork.util.files.ion.IonInput; -import mightypork.util.files.ion.IonOutput; -import mightypork.util.logging.Log; -import mightypork.util.math.noise.NoiseGen; /** @@ -32,7 +30,7 @@ import mightypork.util.math.noise.NoiseGen; * * @author MightyPork */ -public class Level implements MapAccess, IonBinary { +public class Level implements MapAccess, IonObjBinary { public static final int ION_MARK = 53; @@ -53,13 +51,11 @@ public class Level implements MapAccess, IonBinary { private transient NoiseGen noiseGen; - public Level() - { + public Level() { } - public Level(int width, int height) - { + public Level(int width, int height) { size.setTo(width, height); buildArray(); } @@ -91,7 +87,7 @@ public class Level implements MapAccess, IonBinary { public final Tile getTile(Coord pos) { if (!pos.isInRange(0, 0, size.x - 1, size.y - 1)) return Tiles.NULL.createTile(); // out of range - + return tiles[pos.y][pos.x]; } @@ -155,7 +151,6 @@ public class Level implements MapAccess, IonBinary { ib.loadBundled("size", size); ib.loadBundled("enter_point", enterPoint); - // -- binary data -- // load tiles @@ -167,7 +162,6 @@ public class Level implements MapAccess, IonBinary { } } - // load entities Entities.loadEntities(in, entitySet); @@ -296,6 +290,16 @@ public class Level implements MapAccess, IonBinary { getTile(pos).setOccupied(false); } + public void cleanCorpses() { + for(Iterator i = entitySet.iterator(); i.hasNext();) { + Entity e = i.next(); + + if(e.isDead() && e.canRemoveCorpse()) { + e.onCorpseRemoved(); + removeEntity(e); + } + } + } public Collection getEntities() { @@ -341,7 +345,7 @@ public class Level implements MapAccess, IonBinary { private final FillContext exploreFc = new FillContext() { @Override - public Coord[] getSpreadSides() + public Step[] getSpreadSides() { return Sides.allSides; } @@ -376,4 +380,33 @@ public class Level implements MapAccess, IonBinary { return true; } }; + + + public Entity getClosestEntity(Entity self, EntityType type, double radius) + { + Entity closest = null; + double minDist = Double.MAX_VALUE; + + for (Entity e : entitySet) { + if (e == self) continue; + if (e.isDead()) continue; + + if (e.getType() == type) { + double dist = e.getCoord().dist(self.getCoord()); + + if (dist <= radius && dist < minDist) { + minDist = dist; + closest = e; + } + } + } + + return closest; + } + + + public boolean isEntityPresent(Entity entity) + { + return entitySet.contains(entity); + } } diff --git a/src/mightypork/rogue/world/level/MapAccess.java b/src/mightypork/rogue/world/level/MapAccess.java index 3acf6cf..bff3f2c 100644 --- a/src/mightypork/rogue/world/level/MapAccess.java +++ b/src/mightypork/rogue/world/level/MapAccess.java @@ -1,9 +1,9 @@ package mightypork.rogue.world.level; -import mightypork.rogue.world.Coord; +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.noise.NoiseGen; import mightypork.rogue.world.tile.Tile; -import mightypork.util.math.noise.NoiseGen; /** diff --git a/src/mightypork/rogue/world/level/render/EntityRenderContext.java b/src/mightypork/rogue/world/level/render/EntityRenderContext.java index 8101220..696e70b 100644 --- a/src/mightypork/rogue/world/level/render/EntityRenderContext.java +++ b/src/mightypork/rogue/world/level/render/EntityRenderContext.java @@ -1,8 +1,8 @@ package mightypork.rogue.world.level.render; +import mightypork.gamecore.util.math.constraints.rect.Rect; import mightypork.rogue.world.level.MapAccess; -import mightypork.util.math.constraints.rect.Rect; public class EntityRenderContext extends MapRenderContext { diff --git a/src/mightypork/rogue/world/level/render/MapRenderContext.java b/src/mightypork/rogue/world/level/render/MapRenderContext.java index b54451e..0aceb8b 100644 --- a/src/mightypork/rogue/world/level/render/MapRenderContext.java +++ b/src/mightypork/rogue/world/level/render/MapRenderContext.java @@ -1,10 +1,10 @@ package mightypork.rogue.world.level.render; -import mightypork.rogue.world.Coord; +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.builders.TiledRect; import mightypork.rogue.world.level.MapAccess; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.rect.builders.TiledRect; public abstract class MapRenderContext { diff --git a/src/mightypork/rogue/world/level/render/TileRenderContext.java b/src/mightypork/rogue/world/level/render/TileRenderContext.java index 6bad077..23c8ad1 100644 --- a/src/mightypork/rogue/world/level/render/TileRenderContext.java +++ b/src/mightypork/rogue/world/level/render/TileRenderContext.java @@ -1,12 +1,13 @@ package mightypork.rogue.world.level.render; -import mightypork.rogue.world.Coord; +import mightypork.gamecore.util.math.algo.Coord; +import mightypork.gamecore.util.math.algo.Step; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound; +import mightypork.gamecore.util.math.noise.NoiseGen; import mightypork.rogue.world.level.MapAccess; import mightypork.rogue.world.tile.Tile; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.rect.proxy.RectBound; -import mightypork.util.math.noise.NoiseGen; /** @@ -45,7 +46,7 @@ public final class TileRenderContext extends MapRenderContext implements RectBou * @param offset offsets * @return the tile at that position */ - public Tile getAdjacentTile(Coord offset) + public Tile getAdjacentTile(Step offset) { return map.getTile(pos.add(offset)); } diff --git a/src/mightypork/rogue/world/tile/DroppedItemRenderer.java b/src/mightypork/rogue/world/tile/DroppedItemRenderer.java index 33464f9..f5edceb 100644 --- a/src/mightypork/rogue/world/tile/DroppedItemRenderer.java +++ b/src/mightypork/rogue/world/tile/DroppedItemRenderer.java @@ -1,13 +1,13 @@ package mightypork.rogue.world.tile; +import mightypork.gamecore.util.math.Easing; +import mightypork.gamecore.util.math.constraints.rect.Rect; +import mightypork.gamecore.util.math.constraints.rect.proxy.RectBoundAdapter; +import mightypork.gamecore.util.math.timing.Animator; +import mightypork.gamecore.util.math.timing.AnimatorBounce; import mightypork.rogue.world.item.Item; import mightypork.rogue.world.level.render.TileRenderContext; -import mightypork.util.math.Easing; -import mightypork.util.math.constraints.rect.Rect; -import mightypork.util.math.constraints.rect.proxy.RectBoundAdapter; -import mightypork.util.timing.Animator; -import mightypork.util.timing.AnimatorBounce; public class DroppedItemRenderer { diff --git a/src/mightypork/rogue/world/tile/Tile.java b/src/mightypork/rogue/world/tile/Tile.java index 0c3b828..808901b 100644 --- a/src/mightypork/rogue/world/tile/Tile.java +++ b/src/mightypork/rogue/world/tile/Tile.java @@ -3,14 +3,14 @@ package mightypork.rogue.world.tile; import java.io.IOException; +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.rogue.world.item.Item; import mightypork.rogue.world.level.Level; import mightypork.rogue.world.level.render.TileRenderContext; -import mightypork.util.annotations.DefaultImpl; -import mightypork.util.files.ion.IonBinaryHeadless; -import mightypork.util.files.ion.IonInput; -import mightypork.util.files.ion.IonOutput; -import mightypork.util.math.color.Color; /** @@ -18,7 +18,7 @@ import mightypork.util.math.color.Color; * * @author MightyPork */ -public abstract class Tile implements IonBinaryHeadless { +public abstract class Tile implements IonObjBlob { // tmp extras public final TileRenderData renderData = new TileRenderData(); diff --git a/src/mightypork/rogue/world/tile/TileModel.java b/src/mightypork/rogue/world/tile/TileModel.java index b15f86a..8abc344 100644 --- a/src/mightypork/rogue/world/tile/TileModel.java +++ b/src/mightypork/rogue/world/tile/TileModel.java @@ -3,8 +3,8 @@ package mightypork.rogue.world.tile; import java.io.IOException; -import mightypork.util.files.ion.IonInput; -import mightypork.util.files.ion.IonOutput; +import mightypork.gamecore.util.ion.IonInput; +import mightypork.gamecore.util.ion.IonOutput; /** diff --git a/src/mightypork/rogue/world/tile/TileRenderer.java b/src/mightypork/rogue/world/tile/TileRenderer.java index 39a974a..f447b7a 100644 --- a/src/mightypork/rogue/world/tile/TileRenderer.java +++ b/src/mightypork/rogue/world/tile/TileRenderer.java @@ -2,11 +2,11 @@ package mightypork.rogue.world.tile; import mightypork.gamecore.render.Render; -import mightypork.gamecore.render.textures.TxQuad; +import mightypork.gamecore.resources.textures.TxQuad; +import mightypork.gamecore.util.math.algo.Sides; +import mightypork.gamecore.util.math.constraints.rect.Rect; import mightypork.rogue.Res; -import mightypork.rogue.world.Sides; import mightypork.rogue.world.level.render.TileRenderContext; -import mightypork.util.math.constraints.rect.Rect; /** diff --git a/src/mightypork/rogue/world/tile/TileType.java b/src/mightypork/rogue/world/tile/TileType.java index 163b9a0..c7c8235 100644 --- a/src/mightypork/rogue/world/tile/TileType.java +++ b/src/mightypork/rogue/world/tile/TileType.java @@ -1,9 +1,9 @@ package mightypork.rogue.world.tile; -import mightypork.util.math.color.Color; -import mightypork.util.math.color.PAL16; -import mightypork.util.math.color.RGB; +import mightypork.gamecore.util.math.color.Color; +import mightypork.gamecore.util.math.color.pal.PAL16; +import mightypork.gamecore.util.math.color.pal.RGB; /** diff --git a/src/mightypork/rogue/world/tile/Tiles.java b/src/mightypork/rogue/world/tile/Tiles.java index 70ec4b4..d23e9ea 100644 --- a/src/mightypork/rogue/world/tile/Tiles.java +++ b/src/mightypork/rogue/world/tile/Tiles.java @@ -3,6 +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.rogue.world.tile.renderers.BasicTileRenderer; import mightypork.rogue.world.tile.renderers.DoorTileRenderer; import mightypork.rogue.world.tile.renderers.NullTileRenderer; @@ -10,8 +12,6 @@ import mightypork.rogue.world.tile.tiles.DoorTile; import mightypork.rogue.world.tile.tiles.FloorTile; import mightypork.rogue.world.tile.tiles.NullTile; import mightypork.rogue.world.tile.tiles.WallTile; -import mightypork.util.files.ion.IonInput; -import mightypork.util.files.ion.IonOutput; /** diff --git a/src/mightypork/rogue/world/tile/renderers/BasicTileRenderer.java b/src/mightypork/rogue/world/tile/renderers/BasicTileRenderer.java index ef99a73..a3021f3 100644 --- a/src/mightypork/rogue/world/tile/renderers/BasicTileRenderer.java +++ b/src/mightypork/rogue/world/tile/renderers/BasicTileRenderer.java @@ -2,11 +2,11 @@ package mightypork.rogue.world.tile.renderers; import mightypork.gamecore.render.Render; -import mightypork.gamecore.render.textures.TxSheet; +import mightypork.gamecore.resources.textures.TxSheet; +import mightypork.gamecore.util.math.constraints.rect.Rect; import mightypork.rogue.Res; import mightypork.rogue.world.level.render.TileRenderContext; import mightypork.rogue.world.tile.TileRenderer; -import mightypork.util.math.constraints.rect.Rect; public class BasicTileRenderer extends TileRenderer { diff --git a/src/mightypork/rogue/world/tile/renderers/DoorTileRenderer.java b/src/mightypork/rogue/world/tile/renderers/DoorTileRenderer.java index 86e365c..85c7290 100644 --- a/src/mightypork/rogue/world/tile/renderers/DoorTileRenderer.java +++ b/src/mightypork/rogue/world/tile/renderers/DoorTileRenderer.java @@ -2,12 +2,12 @@ package mightypork.rogue.world.tile.renderers; import mightypork.gamecore.render.Render; -import mightypork.gamecore.render.textures.TxQuad; +import mightypork.gamecore.resources.textures.TxQuad; +import mightypork.gamecore.util.math.constraints.rect.Rect; import mightypork.rogue.Res; import mightypork.rogue.world.level.render.TileRenderContext; import mightypork.rogue.world.tile.Tile; import mightypork.rogue.world.tile.TileRenderer; -import mightypork.util.math.constraints.rect.Rect; public class DoorTileRenderer extends TileRenderer { diff --git a/src/mightypork/rogue/world/tile/tiles/GroundTile.java b/src/mightypork/rogue/world/tile/tiles/GroundTile.java index 7d73099..678c45b 100644 --- a/src/mightypork/rogue/world/tile/tiles/GroundTile.java +++ b/src/mightypork/rogue/world/tile/tiles/GroundTile.java @@ -4,6 +4,8 @@ package mightypork.rogue.world.tile.tiles; import java.io.IOException; import java.util.Stack; +import mightypork.gamecore.util.ion.IonInput; +import mightypork.gamecore.util.ion.IonOutput; import mightypork.rogue.world.item.Item; import mightypork.rogue.world.level.Level; import mightypork.rogue.world.level.render.TileRenderContext; @@ -11,8 +13,6 @@ import mightypork.rogue.world.tile.DroppedItemRenderer; import mightypork.rogue.world.tile.Tile; import mightypork.rogue.world.tile.TileModel; import mightypork.rogue.world.tile.TileRenderer; -import mightypork.util.files.ion.IonInput; -import mightypork.util.files.ion.IonOutput; public abstract class GroundTile extends Tile { diff --git a/src/mightypork/rogue/world/tile/tiles/LockedDoorTile.java b/src/mightypork/rogue/world/tile/tiles/LockedDoorTile.java index 361c785..5e34df1 100644 --- a/src/mightypork/rogue/world/tile/tiles/LockedDoorTile.java +++ b/src/mightypork/rogue/world/tile/tiles/LockedDoorTile.java @@ -3,10 +3,10 @@ package mightypork.rogue.world.tile.tiles; import java.io.IOException; +import mightypork.gamecore.util.ion.IonInput; +import mightypork.gamecore.util.ion.IonOutput; import mightypork.rogue.world.tile.TileModel; import mightypork.rogue.world.tile.TileRenderer; -import mightypork.util.files.ion.IonInput; -import mightypork.util.files.ion.IonOutput; public class LockedDoorTile extends DoorTile { diff --git a/src/mightypork/util/string/StringProvider.java b/src/mightypork/util/string/StringProvider.java deleted file mode 100644 index 4f21e9b..0000000 --- a/src/mightypork/util/string/StringProvider.java +++ /dev/null @@ -1,36 +0,0 @@ -package mightypork.util.string; - - -/** - * Can be used for dynamic string generating - * - * @author MightyPork - */ -public interface StringProvider { - - String getString(); - - /** - * String provider with constant string - * - * @author MightyPork - */ - public static class StringWrapper implements StringProvider { - - private final String value; - - - public StringWrapper(String value) - { - this.value = value; - } - - - @Override - public String getString() - { - return value; - } - - } -} diff --git a/src/mightypork/util/timing/Animator.java b/src/mightypork/util/timing/Animator.java deleted file mode 100644 index f389beb..0000000 --- a/src/mightypork/util/timing/Animator.java +++ /dev/null @@ -1,87 +0,0 @@ -package mightypork.util.timing; - - -import mightypork.util.annotations.DefaultImpl; -import mightypork.util.math.Easing; -import mightypork.util.math.constraints.num.Num; -import mightypork.util.math.constraints.num.mutable.NumAnimated; - - -public abstract class Animator extends Num implements Updateable, Pauseable { - - private final NumAnimated animator; - private final Num num; - - - public Animator(double period) - { - this(0, 1, period, Easing.LINEAR); - } - - - public Animator(double start, double end, double period) - { - this(start, end, period, Easing.LINEAR); - } - - - public Animator(double period, Easing easing) - { - this(0, 1, period, easing); - } - - - public Animator(double start, double end, double period, Easing easing) - { - animator = new NumAnimated(0, easing); - animator.setDefaultDuration(period); - - this.num = animator.mul(end - start).add(start); - } - - - @Override - public final void pause() - { - animator.pause(); - } - - - @Override - public final void resume() - { - animator.resume(); - } - - - @Override - public final boolean isPaused() - { - return animator.isPaused(); - } - - - public final void reset() - { - animator.reset(); - } - - - @Override - public final void update(double delta) - { - animator.update(delta); - if (animator.isFinished()) nextCycle(animator); - } - - - @DefaultImpl - protected abstract void nextCycle(NumAnimated anim); - - - @Override - public final double value() - { - return num.value(); - } -}