From 7217b5a5ba706af6a5429d6b7c9f2ef0983797bf Mon Sep 17 00:00:00 2001 From: austin Date: Sun, 11 May 2025 15:35:54 -0400 Subject: [PATCH] block cursor size update --- docs/src/progress/renderertodo.md | 2 + .../controls/cursor/CursorState.java | 7 +- .../types/creature/CreatureEquipData.java | 91 ------------------- .../types/creature/CreatureToolbarData.java | 76 ---------------- 4 files changed, 8 insertions(+), 168 deletions(-) delete mode 100644 src/main/java/electrosphere/entity/types/creature/CreatureEquipData.java delete mode 100644 src/main/java/electrosphere/entity/types/creature/CreatureToolbarData.java diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index 1519faef..1920f7bf 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -1731,6 +1731,8 @@ Fix server simulation starting prior to database connection Scaffolding macro character simulation Fix block generation thread filtering repairable structures Catch errors in pathfinding threads +Remove old data classes +Update default block cursor size diff --git a/src/main/java/electrosphere/controls/cursor/CursorState.java b/src/main/java/electrosphere/controls/cursor/CursorState.java index c2ff9fcd..e08d5863 100644 --- a/src/main/java/electrosphere/controls/cursor/CursorState.java +++ b/src/main/java/electrosphere/controls/cursor/CursorState.java @@ -55,6 +55,11 @@ public class CursorState { */ public static final int MIN_BLOCK_SIZE = 1; + /** + * Default size to edit by + */ + public static final int DEFAULT_BLOCK_SIZE = 2; + /** * Maximum size of the block cursor */ @@ -68,7 +73,7 @@ public class CursorState { /** * Size of blocks to edit */ - private int blockSize = MIN_BLOCK_SIZE; + private int blockSize = DEFAULT_BLOCK_SIZE; /** * The current selection of the area selector diff --git a/src/main/java/electrosphere/entity/types/creature/CreatureEquipData.java b/src/main/java/electrosphere/entity/types/creature/CreatureEquipData.java deleted file mode 100644 index 05ac92a5..00000000 --- a/src/main/java/electrosphere/entity/types/creature/CreatureEquipData.java +++ /dev/null @@ -1,91 +0,0 @@ -package electrosphere.entity.types.creature; - -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -/** - * Data on what a creature has equipped currently - */ -public class CreatureEquipData { - - //Map of equip slot -> item definition - Map slotToItemMap = new HashMap(); - - /** - * Gets the slots in the equip data - * @return The set of equip slot ids - */ - public Set getSlots(){ - return slotToItemMap.keySet(); - } - - /** - * Gets the item occupying a given slot - * @param slotId The id of the slot - * @return The item definition - */ - public EquippedItem getSlotItem(String slotId){ - return slotToItemMap.get(slotId); - } - - /** - * Sets a slot as containing an item type - * @param slotId The slot - * @param itemType The item definition - */ - public void setSlotItem(String slotId, EquippedItem itemType){ - slotToItemMap.put(slotId, itemType); - } - - /** - * Clears the equip data - */ - public void clear(){ - slotToItemMap.clear(); - } - - /** - * An item that is equipped - */ - public static class EquippedItem { - - /** - * The type of the item - */ - String itemType; - - /** - * The entity id of the item - */ - int entityId; - - /** - * Constructor - * @param entityId The id of the item entity - * @param itemType The type of the item - */ - public EquippedItem(int entityId, String itemType){ - this.entityId = entityId; - this.itemType = itemType; - } - - /** - * The type of the item - * @return The type - */ - public String getItemType(){ - return itemType; - } - - /** - * The id of the entity that is this item - * @return The id - */ - public int getEntityId(){ - return entityId; - } - - } - -} diff --git a/src/main/java/electrosphere/entity/types/creature/CreatureToolbarData.java b/src/main/java/electrosphere/entity/types/creature/CreatureToolbarData.java deleted file mode 100644 index c94253a6..00000000 --- a/src/main/java/electrosphere/entity/types/creature/CreatureToolbarData.java +++ /dev/null @@ -1,76 +0,0 @@ -package electrosphere.entity.types.creature; - -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import electrosphere.server.entity.serialization.EntitySerialization; - -/** - * The data about what is in the creature's toolbar - */ -public class CreatureToolbarData { - - /** - * Map of equip slot -> item definition - */ - Map slotToItemMap = new HashMap(); - - /** - * Maps a toolbar slot to its corresponding server ID - */ - Map slotToIdMap = new HashMap(); - - /** - * Gets the slots in the equip data - * @return The set of equip slot ids - */ - public Set getSlots(){ - return slotToItemMap.keySet(); - } - - /** - * Gets the item occupying a given slot - * @param slotId The id of the slot - * @return The item definition - */ - public EntitySerialization getSlotItem(String slotId){ - return slotToItemMap.get(slotId); - } - - /** - * Sets a slot as containing an item type - * @param slotId The slot - * @param itemType The item definition - */ - public void setSlotItem(String slotId, EntitySerialization itemType){ - slotToItemMap.put(slotId, itemType); - } - - /** - * Gets the id of the entity at a given slot - * @param slotId The slot id - * @return The entity id - */ - public Integer getId(String slotId){ - return slotToIdMap.get(slotId); - } - - /** - * Sets the id of the entity at a given slot - * @param slotId The slot id - * @param id The entity id - */ - public void setSlotId(String slotId, Integer id){ - slotToIdMap.put(slotId, id); - } - - /** - * Clears the equip data - */ - public void clear(){ - slotToItemMap.clear(); - } - - -}