Clean repo for open source release
Remove build artifacts, dev tool configs, unused dependencies, and third-party source dumps. Add proper README, update .gitignore, clean up Makefile.
This commit is contained in:
171
src/main/java/com/tiedup/remake/state/ICaptor.java
Normal file
171
src/main/java/com/tiedup/remake/state/ICaptor.java
Normal file
@@ -0,0 +1,171 @@
|
||||
package com.tiedup.remake.state;
|
||||
|
||||
import net.minecraft.world.entity.Entity;
|
||||
|
||||
/**
|
||||
* Phase 8: Master-Captive Relationships
|
||||
* Phase 14.1.6: Refactored to use IRestrainable for NPC capture support
|
||||
* Phase 17: Terminology refactoring - slave → captive
|
||||
* C6-V2: Narrowed parameters from IRestrainable to IBondageState (minimum needed type)
|
||||
*
|
||||
* Interface for entities that can capture other entities (players or NPCs).
|
||||
*
|
||||
* Terminology (Phase 17):
|
||||
* - "Captive" = Entity attached by leash (active physical control)
|
||||
* - "Slave" = Entity wearing a collar owned by someone (passive ownership via CollarRegistry)
|
||||
*
|
||||
* Design Pattern:
|
||||
* - Interface-based design allows both players (PlayerCaptorManager)
|
||||
* and NPCs (EntityKidnapper - Phase 14.2+) to act as captors
|
||||
* - Separates concerns: ICaptor manages captives, IBondageState is managed
|
||||
*
|
||||
* Implementation:
|
||||
* - PlayerCaptorManager: For player captors (Phase 8)
|
||||
* - EntityKidnapper: For NPC captors (Phase 14.2+)
|
||||
*
|
||||
* @see IBondageState
|
||||
* @see PlayerCaptorManager
|
||||
*/
|
||||
public interface ICaptor {
|
||||
// ========================================
|
||||
// Captive Management
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Add a captive to this captor's captive list.
|
||||
* Called when capture succeeds.
|
||||
*
|
||||
* Phase 14.1.6: Changed from PlayerBindState to IRestrainable
|
||||
* Phase 17: Renamed from addSlave to addCaptive
|
||||
* C6-V2: Narrowed from IRestrainable to IBondageState
|
||||
*
|
||||
* @param captive The IBondageState entity to capture
|
||||
*/
|
||||
void addCaptive(IBondageState captive);
|
||||
|
||||
/**
|
||||
* Remove a captive from this captor's captive list.
|
||||
* Called when freeing a captive or when captive escapes.
|
||||
*
|
||||
* Phase 14.1.6: Changed from PlayerBindState to IRestrainable
|
||||
* Phase 17: Renamed from removeSlave to removeCaptive
|
||||
* C6-V2: Narrowed from IRestrainable to IBondageState
|
||||
*
|
||||
* @param captive The IBondageState captive to remove
|
||||
* @param transportState If true, also despawn the transport entity
|
||||
*/
|
||||
void removeCaptive(IBondageState captive, boolean transportState);
|
||||
|
||||
/**
|
||||
* Check if this captor can capture the given target.
|
||||
*
|
||||
* Conditions (from original):
|
||||
* - Target must be tied up OR have collar with this captor as owner
|
||||
* - Target must not already be captured
|
||||
*
|
||||
* Phase 14.1.6: Changed from PlayerBindState to IRestrainable
|
||||
* Phase 17: Renamed from canEnslave to canCapture
|
||||
* C6-V2: Narrowed from IRestrainable to IBondageState
|
||||
*
|
||||
* @param target The potential IBondageState captive
|
||||
* @return true if capture is allowed
|
||||
*/
|
||||
boolean canCapture(IBondageState target);
|
||||
|
||||
/**
|
||||
* Check if this captor can release the given captive.
|
||||
* Only the current captor can release their captive.
|
||||
*
|
||||
* Phase 14.1.6: Changed from PlayerBindState to IRestrainable
|
||||
* Phase 17: Renamed from canFree to canRelease
|
||||
* C6-V2: Narrowed from IRestrainable to IBondageState
|
||||
*
|
||||
* @param captive The IBondageState captive to check
|
||||
* @return true if this captor is the captive's captor
|
||||
*/
|
||||
boolean canRelease(IBondageState captive);
|
||||
|
||||
// ========================================
|
||||
// Configuration
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Whether this captor allows captives to be transferred to other captors.
|
||||
*
|
||||
* Phase 17: Renamed from allowSlaveTransfer to allowCaptiveTransfer
|
||||
*
|
||||
* @return true if captive transfer is allowed (default for players)
|
||||
*/
|
||||
boolean allowCaptiveTransfer();
|
||||
|
||||
/**
|
||||
* Whether this captor can have multiple captives simultaneously.
|
||||
*
|
||||
* Phase 17: Renamed from allowMultipleSlaves to allowMultipleCaptives
|
||||
*
|
||||
* @return true if multiple captives allowed (default for players)
|
||||
*/
|
||||
boolean allowMultipleCaptives();
|
||||
|
||||
// ========================================
|
||||
// Event Callbacks
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Called when a captive logs out while captured.
|
||||
* Allows the captor to handle cleanup or persistence.
|
||||
*
|
||||
* Phase 14.1.6: Changed from PlayerBindState to IRestrainable
|
||||
* Phase 17: Renamed from onSlaveLogout to onCaptiveLogout
|
||||
* C6-V2: Narrowed from IRestrainable to IBondageState
|
||||
* Note: For NPC captives, this may never be called (NPCs don't log out)
|
||||
*
|
||||
* @param captive The IBondageState captive that logged out
|
||||
*/
|
||||
void onCaptiveLogout(IBondageState captive);
|
||||
|
||||
/**
|
||||
* Called when a captive is released (freed).
|
||||
* Allows the captor to react to losing a captive.
|
||||
*
|
||||
* Phase 14.1.6: Changed from PlayerBindState to IRestrainable
|
||||
* Phase 17: Renamed from onSlaveReleased to onCaptiveReleased
|
||||
* C6-V2: Narrowed from IRestrainable to IBondageState
|
||||
*
|
||||
* @param captive The IBondageState captive that was released
|
||||
*/
|
||||
void onCaptiveReleased(IBondageState captive);
|
||||
|
||||
/**
|
||||
* Called when a captive attempts to struggle.
|
||||
* Allows the captor to react (e.g., shock collar activation).
|
||||
*
|
||||
* Phase 14.1.6: Changed from PlayerBindState to IRestrainable
|
||||
* Phase 17: Renamed from onSlaveStruggle to onCaptiveStruggle
|
||||
* C6-V2: Narrowed from IRestrainable to IBondageState
|
||||
*
|
||||
* @param captive The IBondageState captive that struggled
|
||||
*/
|
||||
void onCaptiveStruggle(IBondageState captive);
|
||||
|
||||
// ========================================
|
||||
// Queries
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Check if this captor currently has any captives.
|
||||
*
|
||||
* Phase 17: Renamed from hasSlaves to hasCaptives
|
||||
*
|
||||
* @return true if captive list is not empty
|
||||
*/
|
||||
boolean hasCaptives();
|
||||
|
||||
/**
|
||||
* Get the entity representing this captor.
|
||||
* Used for lead attachment and position queries.
|
||||
*
|
||||
* @return The entity (Player or custom entity)
|
||||
*/
|
||||
Entity getEntity();
|
||||
}
|
||||
Reference in New Issue
Block a user