Exemple #1
0
        protected override ValueType InvokeInternal(SRC SRC, Pilots.Pilot pilot, ValueType etype, string[] @params, int pcount, bool[] is_term, out string str_result, out double num_result)
        {
            str_result = "";
            num_result = pilot?.Plana ?? 0d;

            if (etype == ValueType.StringType)
            {
                str_result = GeneralLib.FormatNum(num_result);
                return(ValueType.StringType);
            }
            else
            {
                return(ValueType.NumericType);
            }
        }
        public void GenerateNPCPilots(int inAmount = 10)
        {
            if (inAmount < 1)
            {
                return;
            }

            Pilots.Pilot iPilot = null;

            for (int i = 0; i < inAmount; i++)
            {
                iPilot = Data.Pilots.Pilot.CreateRandom(this);

                if (iPilot != null)
                {
                    this.Pilots.Add(iPilot);
                }
            }
        }
Exemple #3
0
        protected override ValueType InvokeInternal(SRC SRC, ValueType etype, string[] @params, int pcount, bool[] is_term, out string str_result, out double num_result)
        {
            Pilots.Pilot pilot = null;

            if (OptionArgCount >= pcount)
            {
                pilot = SRC.Event.SelectedUnitForEvent?.MainPilot();
            }
            else
            {
                var pname = SRC.Expression.GetValueAsString(@params[1], is_term[1]);
                if (SRC.UList.IsDefined2(pname))
                {
                    pilot = SRC.UList.Item2(pname).MainPilot();
                }
                else if (SRC.PList.IsDefined(pname))
                {
                    pilot = SRC.PList.Item(pname);
                }
            }

            return(InvokeInternal(SRC, pilot, etype, @params, pcount, is_term, out str_result, out num_result));
        }
        public void LoadPlayerPilotsFromDatabase(int inAmount = 50)
        {
            if (inAmount < 1)
            {
                return;
            }

            List <Pilots._Pilot_Serialized> PilotsFromDB = Database.Tables.PilotTable.ReadPlayerPilots();

            if (PilotsFromDB != null && PilotsFromDB.Count > 0)
            {
                Pilots.Pilot newPilot = null;

                for (int iPilot = 0; iPilot < PilotsFromDB.Count; iPilot++)
                {
                    newPilot = Data.Pilots.Pilot.CreateFromSerialized(this, PilotsFromDB[iPilot]);

                    if (newPilot != null)
                    {
                        this.Pilots.Add(newPilot);
                    }
                }
            }
        }
Exemple #5
0
        protected override ValueType InvokeInternal(SRC SRC, Pilots.Pilot pilot, ValueType etype, string[] @params, int pcount, bool[] is_term, out string str_result, out double num_result)
        {
            str_result = "";
            num_result = 0d;
            var name = pcount == 1
                ? SRC.Expression.GetValueAsString(@params[1], is_term[1])
                : SRC.Expression.GetValueAsString(@params[2], is_term[2]);

            // エリアスが定義されている?
            if (SRC.ALDList.IsDefined(name))
            {
                name = SRC.ALDList.Item(name).ReplaceTypeName(name);
            }
            num_result = pilot?.SkillLevel(name) ?? 0d;
            if (etype == ValueType.StringType)
            {
                str_result = GeneralLib.FormatNum(num_result);
                return(ValueType.StringType);
            }
            else
            {
                return(ValueType.NumericType);
            }
        }
Exemple #6
0
 protected abstract ValueType InvokeInternal(SRC SRC, Pilots.Pilot pilot, ValueType etype, string[] @params, int pcount, bool[] is_term, out string str_result, out double num_result);