001package com.fs.starfarer.api.characters;
002
003import java.awt.Color;
004
005import com.fs.starfarer.api.Global;
006import com.fs.starfarer.api.campaign.FactionAPI;
007import com.fs.starfarer.api.campaign.RepLevel;
008
009public interface RelationshipAPI {
010
011        public static enum RelationshipTargetType {
012                FACTION,
013                PERSON,
014                PLAYER,
015        }
016
017        public static class RelationshipTarget {
018                private RelationshipTargetType type;
019                private PersonAPI person;
020                private FactionAPI faction;
021                public RelationshipTarget(RelationshipTargetType type) {
022                        this.type = type;
023                }
024                public RelationshipTarget(RelationshipTargetType type, FactionAPI faction) {
025                        this.type = type;
026                        this.faction = faction;
027                }
028                public RelationshipTarget(RelationshipTargetType type, PersonAPI person) {
029                        this.type = type;
030                        this.person = person;
031                }
032                public RelationshipTargetType getType() {
033                        return type;
034                }
035                public void setType(RelationshipTargetType type) {
036                        this.type = type;
037                }
038                public PersonAPI getPerson() {
039                        return person;
040                }
041                public void setPerson(PersonAPI person) {
042                        this.person = person;
043                }
044                public FactionAPI getFaction() {
045                        return faction;
046                }
047                public void setFaction(FactionAPI faction) {
048                        this.faction = faction;
049                }
050                public boolean isPlayer() {
051                        return type == RelationshipTargetType.PLAYER || 
052                                        (person != null && person == Global.getSector().getPlayerPerson());
053                }
054//              public String getTargetId() {
055//                      if (faction != null) return faction.getId();
056//                      //if (person != null) return person.get
057//              }
058        }
059        
060        
061        RelationshipTarget getTarget();
062        void setTarget(RelationshipTarget target);
063
064        float getRel();
065        void setRel(float rel);
066        
067        RepLevel getLevel();
068        void setLevel(RepLevel level);
069
070        boolean isAtWorst(RepLevel level);
071        boolean isAtBest(RepLevel level);
072        
073        boolean ensureAtBest(RepLevel level);
074        boolean ensureAtWorst(RepLevel level);
075
076        boolean adjustRelationship(float delta, RepLevel limit);
077
078        boolean isHostile();
079
080        Color getRelColor();
081        Color getRelColor(RepLevel level);
082        int getRepInt();
083        
084}