001package com.fs.starfarer.api.combat; 002 003import java.util.List; 004 005import java.awt.Color; 006 007import org.lwjgl.util.vector.Vector2f; 008 009import com.fs.starfarer.api.util.ColorShifterAPI; 010import com.fs.starfarer.api.util.ValueShifterAPI; 011 012public interface ShipEngineControllerAPI { 013 public interface ShipEngineAPI { 014 /** 015 * @return location, in absolute coordinates. 016 */ 017 Vector2f getLocation(); 018 019 /** 020 * @return whether this engine is currently engaged (some engines are only "active" when a ship system is in use, for example.) 021 */ 022 boolean isActive(); 023 024 /** 025 * @return whether this engine is only shown when the ship system is active. 026 */ 027 boolean isSystemActivated(); 028 029 String getStyleId(); 030 031 boolean isDisabled(); 032 void disable(); 033 void disable(boolean permanent); 034 035 /** 036 * Fraction of total engine power this engine provides. 037 * @return 038 */ 039 float getContribution(); 040 041 boolean isPermanentlyDisabled(); 042 void applyDamage(float damAmount, Object source); 043 float getMaxHitpoints(); 044 float getHitpoints(); 045 EngineSlotAPI getEngineSlot(); 046 047 void setHitpoints(float hp); 048 049 Color getEngineColor(); 050 051 Color getContrailColor(); 052 053 void repair(); 054 } 055 056 057 boolean isAccelerating(); 058 boolean isAcceleratingBackwards(); 059 boolean isDecelerating(); 060 boolean isTurningLeft(); 061 boolean isTurningRight(); 062 boolean isStrafingLeft(); 063 boolean isStrafingRight(); 064 boolean isIdle(); 065 066 List<ShipEngineAPI> getShipEngines(); 067 void fadeToOtherColor(Object key, Color other, Color contrailColor, float effectLevel, float maxBlend); 068 void extendFlame(Object key, float extendLengthFraction, float extendWidthFraction, float extendGlowFraction); 069 void forceFlameout(); 070 void forceFlameout(boolean suppressFloaty); 071 float getMaxSpeedWithoutBoost(); 072 float computeDisabledFraction(); 073 float getFlameoutFraction(); 074 void computeEffectiveStats(boolean forceShowFloaty); 075 boolean isFlamedOut(); 076 boolean isDisabled(); 077 boolean isFlamingOut(); 078 079 /** 080 * How extended the engine flame is. 1.0 = maximum, 0 = not at all, 0.4 = default idle level. 081 * @param slot 082 * @param level 083 */ 084 void setFlameLevel(EngineSlotAPI slot, float level); 085 ValueShifterAPI getExtendLengthFraction(); 086 ValueShifterAPI getExtendWidthFraction(); 087 ValueShifterAPI getExtendGlowFraction(); 088 void forceShowAccelerating(); 089 ColorShifterAPI getFlameColorShifter(); 090 float getTurnDeceleration(); 091 092 093}