Beispiel #1
0
Datei: Unit.cs Projekt: 7474/SRC
        protected override ValueType InvokeInternal(SRC SRC, Units.Unit unit, 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 = unit?.IsFeatureAvailable(name) ?? false ? 1d : 0d;
            if (etype == ValueType.StringType)
            {
                str_result = GeneralLib.FormatNum(num_result);
                return(ValueType.StringType);
            }
            else
            {
                return(ValueType.NumericType);
            }
        }
Beispiel #2
0
        private bool ConfirmMoveFinish(Units.Unit u)
        {
            if (Map.MapDataForUnit[SelectedX, SelectedY] != null)
            {
                GuiDialogResult res;
                if (Map.MapDataForUnit[SelectedX, SelectedY].IsFeatureAvailable("母艦") && !u.IsFeatureAvailable("母艦"))
                {
                    res = GUI.Confirm("着艦しますか?", "着艦", GuiConfirmOption.OkCancel | GuiConfirmOption.Question);
                }
                else
                {
                    res = GUI.Confirm("合体しますか?", "合体", GuiConfirmOption.OkCancel | GuiConfirmOption.Question);
                }

                if (res == GuiDialogResult.Cancel)
                {
                    CancelCommand();
                    GUI.UnlockGUI();
                    return(false);
                }
            }
            return(true);
        }