block cursor size update
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
This commit is contained in:
parent
9156844657
commit
7217b5a5ba
@ -1731,6 +1731,8 @@ Fix server simulation starting prior to database connection
|
|||||||
Scaffolding macro character simulation
|
Scaffolding macro character simulation
|
||||||
Fix block generation thread filtering repairable structures
|
Fix block generation thread filtering repairable structures
|
||||||
Catch errors in pathfinding threads
|
Catch errors in pathfinding threads
|
||||||
|
Remove old data classes
|
||||||
|
Update default block cursor size
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -55,6 +55,11 @@ public class CursorState {
|
|||||||
*/
|
*/
|
||||||
public static final int MIN_BLOCK_SIZE = 1;
|
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
|
* Maximum size of the block cursor
|
||||||
*/
|
*/
|
||||||
@ -68,7 +73,7 @@ public class CursorState {
|
|||||||
/**
|
/**
|
||||||
* Size of blocks to edit
|
* Size of blocks to edit
|
||||||
*/
|
*/
|
||||||
private int blockSize = MIN_BLOCK_SIZE;
|
private int blockSize = DEFAULT_BLOCK_SIZE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The current selection of the area selector
|
* The current selection of the area selector
|
||||||
|
|||||||
@ -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<String,EquippedItem> slotToItemMap = new HashMap<String,EquippedItem>();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the slots in the equip data
|
|
||||||
* @return The set of equip slot ids
|
|
||||||
*/
|
|
||||||
public Set<String> 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -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<String,EntitySerialization> slotToItemMap = new HashMap<String,EntitySerialization>();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Maps a toolbar slot to its corresponding server ID
|
|
||||||
*/
|
|
||||||
Map<String,Integer> slotToIdMap = new HashMap<String,Integer>();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the slots in the equip data
|
|
||||||
* @return The set of equip slot ids
|
|
||||||
*/
|
|
||||||
public Set<String> 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();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user