Example #1
0
 void FlagImpl(FlagMap flagDic, string[] args)
 {
     if (args.Length < 2)
     {
         throw new NRuntimeException("引数が足りません。");
     }
     flagDic[args[1]] = args[0] == "on";
 }
Example #2
0
        protected override void Awake()
        {
            base.Awake();
            Flags     = SaveDataHelper.Load <FlagMap>("flag.json") ?? new FlagMap();
            SkipFlags = new FlagMap();
            AreaFlags = new FlagMap();

            Wyte.GameSave += (wyte) =>
            {
                SaveDataHelper.Save("flag.json", Flags);
                // スキップフラグはセーブされない.
            };

            Map.MapChanged += (wyte) =>
            {
                // さようなら.
                AreaFlags.Clear();
            };
        }
Example #3
0
        private IEnumerator OnFlagImpl(FlagMap flagDic, string key, string[] labels)
        {
            if (labels.Length < 1)
            {
                return(null);
            }
            var useGosub = false;

            if (labels.Length >= 3 || labels[0].ToLower() == "goto" || labels[0].ToLower() == "gosub")
            {
                useGosub = labels[0].ToLower() == "gosub";
                labels   = labels.Skip(1).ToArray();
            }
            if (flagDic[key])
            {
                return(useGosub ? Novel.Runtime.Gosub("", labels[0]) : Novel.Runtime.Goto("", labels[0]));
            }
            if (labels.Length >= 2)
            {
                return(useGosub ? Novel.Runtime.Gosub("", labels[1]) : Novel.Runtime.Goto("", labels[1]));
            }
            return(null);
        }