001package com.fs.starfarer.api.combat;
002
003import java.util.Map;
004
005import org.lwjgl.util.vector.Vector2f;
006
007public interface CombatEntityAPI {
008        Vector2f getLocation();
009
010        /**
011         * Note: For projectiles, do not use this! Projectile movement is defined by its moveSpeed and facing, not velocity!
012         * @return
013         */
014        Vector2f getVelocity();
015        float getFacing();
016        void setFacing(float facing);
017        float getAngularVelocity();
018        void setAngularVelocity(float angVel);
019        
020        /**
021         * 0 = player
022         * 1 = enemy
023         * 100 = neutral (used for ship hulks)
024         * @return
025         */
026        int getOwner();
027        /**
028         * 0 = player
029         * 1 = enemy
030         * 100 = neutral (used for ship hulks)
031         * @return
032         */
033        void setOwner(int owner);
034        
035        float getCollisionRadius();
036        
037        CollisionClass getCollisionClass();
038        void setCollisionClass(CollisionClass collisionClass);
039
040        float getMass();
041        void setMass(float mass);
042        
043        /**
044         * Can return null if there aren't any bounds, in which case just the collision radius should be used.
045         * The bounds are guaranteed to be inside the collision radius.
046         * @return
047         */
048        BoundsAPI getExactBounds();
049        
050        /**
051         * Returns null for entities without shields.
052         * @return
053         */
054        ShieldAPI getShield();
055        
056        /**
057         * @return hull level, normalized to (0, 1)
058         */
059        float getHullLevel();
060        
061        /**
062         * @return actual hull points left
063         */
064        float getHitpoints();
065        
066        /**
067         * @return maximum hull points for the ship
068         */
069        float getMaxHitpoints();
070        
071        
072        /**
073         * Should always circumscribe the bounds, if any.
074         * @param radius
075         */
076        void setCollisionRadius(float radius);
077        
078        
079        Object getAI();
080        boolean isExpired();
081        void setCustomData(String key, Object data);
082        void removeCustomData(String key);
083        
084        /**
085         * DO NOT call .put() methods on the returned map. Use setCustomData() instead.
086         * When the map is empty, it will return a new non-null map that will not be retained,
087         * so any additions to it would be lost. 
088         * 
089         * @return
090         */
091        Map<String, Object> getCustomData();
092        void setHitpoints(float hitpoints);
093        boolean isPointInBounds(Vector2f p);
094        boolean wasRemoved();
095        
096}
097
098