示例#1
0
        protected virtual bool astronautStatusChange(ConfigNode node)
        {
            eventType = BARISEventTypes.astronautStatusChange;

            //Optional: status
            if (node.HasValue("status"))
            {
                switch (node.GetValue("status"))
                {
                case "dead":
                    statusType = BARISStatusTypes.dead;
                    break;

                case "missing":
                    statusType = BARISStatusTypes.missing;
                    break;

                default:
                case "badS":
                    statusType = BARISStatusTypes.badS;
                    break;
                }
            }

            return(true);
        }
示例#2
0
        protected virtual bool loadAstronautRecruitedResult(ConfigNode node)
        {
            eventType = BARISEventTypes.astronautRecruited;

            //Rank is optional
            if (node.HasValue("rank"))
            {
                if (!int.TryParse(node.GetValue("rank"), out rank))
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }

            //Is badass?
            if (node.HasValue("isBadass"))
            {
                bool isBadass = bool.Parse(node.GetValue("isBadass"));
                if (isBadass)
                {
                    statusType = BARISStatusTypes.badS;
                }
            }

            return(true);
        }