コード例 #1
0
ファイル: SpawnBuilder.cs プロジェクト: CWolfs/MissionControl
        public SpawnBuilder(ContractTypeBuilder contractTypeBuilder, GameObject parent, JObject spawner)
        {
            this.contractTypeBuilder = contractTypeBuilder;
            this.parent                = parent;
            this.name                  = spawner["Name"].ToString();
            this.subType               = spawner["SubType"].ToString();
            this.team                  = spawner["Team"].ToString();
            this.guid                  = spawner["Guid"].ToString();
            this.spawnPointGuids       = spawner["SpawnPointGuids"].ToObject <List <string> >();
            this.preciseSpawnPoints    = spawner.ContainsKey("PreciseSpawnPoints") ? (bool)spawner["PreciseSpawnPoints"] : false;
            this.mountOnTargets        = spawner.ContainsKey("MountOn") ? (JObject)spawner["MountOn"] : null;
            this.spawnPointPositions   = spawner.ContainsKey("SpawnPointPositions") ? (JObject)spawner["SpawnPointPositions"] : null;
            this.spawnPointRotations   = spawner.ContainsKey("SpawnPointRotations") ? (JObject)spawner["SpawnPointRotations"] : null;
            this.spawnType             = spawner["SpawnType"].ToString();
            this.position              = spawner.ContainsKey("Position") ? (JObject)spawner["Position"] : null;
            this.rotation              = spawner.ContainsKey("Rotation") ? (JObject)spawner["Rotation"] : null;
            this.aiOrdersArray         = spawner.ContainsKey("AI") ? (JArray)spawner["AI"] : null;
            this.alertLanceOnSpawn     = spawner.ContainsKey("AlertLanceOnSpawn") ? (bool)spawner["AlertLanceOnSpawn"] : false;
            this.defaultDetectionRange = spawner.ContainsKey("DefaultDetectionRange") ? (int)spawner["DefaultDetectionRange"] : 200;
            this.tags                  = spawner.ContainsKey("Tags") ? spawner["Tags"].ToObject <List <string> >() : null;

            if (this.aiOrdersArray != null)
            {
                AiOrderBuilder orderBuilder = new AiOrderBuilder(contractTypeBuilder, aiOrdersArray, name);
                orders = orderBuilder.Build();
            }
        }
コード例 #2
0
        public DialogueActivatorBuilder(ContractTypeBuilder contractTypeBuilder, GameObject parent, JObject activator)
        {
            this.contractTypeBuilder = contractTypeBuilder;
            this.activator           = activator;

            this.parent       = parent;
            this.dialogueGuid = activator["EncounterGuid"].ToString();
        }
コード例 #3
0
 public GenericTriggerBuilder(ContractTypeBuilder contractTypeBuilder, string name, MessageCenterMessageType triggerMessageType, GenericCompoundConditional conditional, string description, List <DesignResult> results)
 {
     this.name = name;
     this.triggerMessageType = triggerMessageType;
     this.conditional        = conditional;
     this.description        = description;
     this.results            = results;
 }
コード例 #4
0
        public ContractEditBuilder(ContractTypeBuilder contractTypeBuilder, GameObject parent, JObject objective)
        {
            this.contractTypeBuilder = contractTypeBuilder;
            this.objective           = objective;

            this.parent  = parent;
            this.name    = objective["Name"].ToString();
            this.subType = objective["SubType"].ToString();
        }
コード例 #5
0
        public CombatStateBuilder(ContractTypeBuilder contractTypeBuilder, GameObject parent, JObject state)
        {
            this.contractTypeBuilder = contractTypeBuilder;
            this.state = state;

            this.parent  = parent;
            this.name    = state["Name"].ToString();
            this.subType = state["SubType"].ToString();
        }
コード例 #6
0
        public SetChunkStateAtRandomActivatorBuilder(ContractTypeBuilder contractTypeBuilder, GameObject parent, JObject activator)
        {
            this.contractTypeBuilder = contractTypeBuilder;
            this.activator           = activator;

            this.parent       = parent;
            this.chunkGuids   = ((JArray)activator["ChunkGuids"]).ToObject <List <string> >();
            this.statusString = activator.ContainsKey("Status") ? activator["Status"].ToString() : "Active";
            this.statusType   = (EncounterObjectStatus)Enum.Parse(typeof(EncounterObjectStatus), statusString);
        }
コード例 #7
0
        public PlacementBuilder(ContractTypeBuilder contractTypeBuilder, GameObject parent, JObject objective)
        {
            this.contractTypeBuilder = contractTypeBuilder;
            this.objective           = objective;

            this.parent      = parent;
            this.name        = objective["Name"].ToString();
            this.subType     = objective["SubType"].ToString();
            this.targetGuid1 = objective["TargetGuid1"].ToString();
            this.targetGuid2 = objective["TargetGuid2"].ToString();
        }
コード例 #8
0
 public ChunkTypeBuilder(ContractTypeBuilder contractTypeBuilder, string name, string type, string subType, bool controlledByContract, string guid, JObject position, JArray children)
 {
     this.contractTypeBuilder = contractTypeBuilder;
     this.name = name;
     this.type = type;
     this.controlledByContract = controlledByContract;
     this.subType  = subType;
     this.guid     = (guid == null) ? Guid.NewGuid().ToString() : guid;
     this.position = position;
     this.children = children;
 }
コード例 #9
0
        public DialogueBuilder(ContractTypeBuilder contractTypeBuilder, GameObject parent, JObject objective)
        {
            this.contractTypeBuilder = contractTypeBuilder;
            this.objective           = objective;

            this.parent       = parent;
            this.name         = objective["Name"].ToString();
            this.subType      = objective["SubType"].ToString();
            this.guid         = objective["Guid"].ToString();
            this.trigger      = objective.ContainsKey("Trigger") ? objective["Trigger"].ToString() : null;
            this.showOnlyOnce = objective.ContainsKey("ShowOnlyOnce") ? (bool)objective["ShowOnlyOnce"] : false;
        }
コード例 #10
0
        public RegionBuilder(ContractTypeBuilder contractTypeBuilder, GameObject parent, JObject objective)
        {
            this.contractTypeBuilder = contractTypeBuilder;
            this.objective           = objective;

            this.parent   = parent;
            this.name     = objective["Name"].ToString();
            this.subType  = objective["SubType"].ToString();
            this.width    = objective.ContainsKey("Width") ? (int)objective["Width"] : DEFAULT_WIDTH;
            this.length   = objective.ContainsKey("Length") ? (int)objective["Length"] : DEFAULT_LENGTH;
            this.position = objective.ContainsKey("Position") ? (JObject)objective["Position"] : null;
        }
コード例 #11
0
        public ObjectiveBuilder(ContractTypeBuilder contractTypeBuilder, GameObject parent, JObject objective)
        {
            this.contractTypeBuilder = contractTypeBuilder;
            this.objective           = objective;

            this.parent                = parent;
            this.name                  = objective["Name"].ToString();
            this.subType               = objective["SubType"].ToString();
            this.guid                  = objective["Guid"].ToString();
            this.isPrimaryObjectve     = (bool)objective["IsPrimaryObjective"];
            this.title                 = objective["Title"].ToString();
            this.priority              = (int)objective["Priority"];
            this.contractObjectiveGuid = objective["ContractObjectiveGuid"].ToString();
        }
コード例 #12
0
 public SpawnBuilder(ContractTypeBuilder contractTypeBuilder, GameObject parent, JObject spawner)
 {
     this.contractTypeBuilder = contractTypeBuilder;
     this.parent          = parent;
     this.name            = spawner["Name"].ToString();
     this.subType         = spawner["SubType"].ToString();
     this.team            = spawner["Team"].ToString();
     this.guid            = spawner["Guid"].ToString();
     this.spawnPoints     = (int)spawner["SpawnPoints"];
     this.spawnPointGuids = spawner["SpawnPointGuids"].ToObject <List <string> >();
     this.spawnType       = spawner["SpawnType"].ToString();
     this.position        = spawner.ContainsKey("Position") ? (JObject)spawner["Position"] : null;
     this.rotation        = spawner.ContainsKey("Rotation") ? (JObject)spawner["Rotation"] : null;
 }
コード例 #13
0
        public GenericTriggerBuilder(ContractTypeBuilder contractTypeBuilder, JObject trigger, string name)
        {
            this.contractTypeBuilder = contractTypeBuilder;
            this.trigger             = trigger;

            this.name        = name;
            this.triggerOn   = trigger["TriggerOn"].ToString();
            this.description = (trigger.ContainsKey("Description")) ? trigger["Description"].ToString() : "";

            this.conditionalEvaluationString = (trigger.ContainsKey("SucceedOn")) ? trigger["SucceedOn"].ToString() : "All";
            this.conditionalEvaluation       = (LogicEvaluation)Enum.Parse(typeof(LogicEvaluation), conditionalEvaluationString);

            if (trigger.ContainsKey("Conditionals"))
            {
                ConditionalBuilder conditionalBuilder = new ConditionalBuilder(contractTypeBuilder, (JArray)trigger["Conditionals"]);
                this.conditional = conditionalBuilder.Build();
                this.conditional.whichMustBeTrue = this.conditionalEvaluation;
            }

            if (trigger.ContainsKey("Results"))
            {
                ResultsBuilder resultsBuilder = new ResultsBuilder(contractTypeBuilder, (JArray)trigger["Results"]);
                this.results = resultsBuilder.Build();
            }
            else
            {
                Main.Logger.LogError("[GenericTriggerBuilder] Generic Triggers require 'Results'");
            }

            if (!Enum.TryParse(this.triggerOn, out triggerMessageType))
            {
                MessageTypes messageType;
                if (!Enum.TryParse(this.triggerOn, out messageType))
                {
                    Main.Logger.LogError("[GenericTriggerBuilder] Invalid 'TriggerOn' provided.");
                }
                else
                {
                    triggerMessageType = (MessageCenterMessageType)messageType;
                }
            }
        }
コード例 #14
0
 public ConditionalBuilder(ContractTypeBuilder contractTypeBuilder, JArray conditionalsObject)
 {
     this.contractTypeBuilder = contractTypeBuilder;
     this.conditionalsObject  = conditionalsObject;
 }
コード例 #15
0
 public ResultsBuilder(ContractTypeBuilder contractTypeBuilder, JArray resultsArray)
 {
     this.contractTypeBuilder = contractTypeBuilder;
     this.resultsArray        = resultsArray;
 }
コード例 #16
0
 public TeamDataBuilder(ContractTypeBuilder contractTypeBuilder, JObject teamData)
 {
     this.contractTypeBuilder = contractTypeBuilder;
     this.teamData            = teamData;
 }
コード例 #17
0
 public AiOrderBuilder(ContractTypeBuilder contractTypeBuilder, JArray ordersArray, string lanceName)
 {
     this.contractTypeBuilder = contractTypeBuilder;
     this.ordersArray         = ordersArray;
     this.lanceName           = lanceName;
 }