コード例 #1
0
        public override void Entry(IModHelper helper)
        {
            obj[0]     = PathFindingLogic.source;
            obj[1]     = PathFindingLogic.currentGoal;
            obj[2]     = PathFindingLogic.queue;
            CoreHelper = helper;

            // string[] s = new string[10];

            CoreMonitor = this.Monitor;
            CoreMonitor.Log("Hello AI WORLD!", LogLevel.Info);
            Commands.initializeCommands();
            PathFindingCore.Utilities.initializeTileExceptionList();
            ExecutionCore.TaskMetaDataHeuristics.initializeToolCostDictionary();
            //throw new NotImplementedException();
            StardewModdingAPI.Events.LocationEvents.CurrentLocationChanged += LocationEvents_CurrentLocationChanged;

            StardewModdingAPI.Events.ControlEvents.KeyPressed += ControlEvents_KeyPressed;
            StardewModdingAPI.Events.SaveEvents.AfterLoad     += SaveEvents_AfterLoad;
            // StardewModdingAPI.Events.GraphicsEvents.OnPreRenderEvent += PathFindingCore.Utilities.addFromPlacementListBeforeDraw;


            StardustCore.ModCore.SerializationManager.acceptedTypes.Add("StarAI.PathFindingCore.TileNode", new StardustCore.Serialization.SerializerDataNode(new StardustCore.Serialization.SerializerDataNode.SerializingFunction(StarAI.PathFindingCore.TileNode.Serialize), new StardustCore.Serialization.SerializerDataNode.ParsingFunction(StarAI.PathFindingCore.TileNode.ParseIntoInventory), new StardustCore.Serialization.SerializerDataNode.WorldParsingFunction(StarAI.PathFindingCore.TileNode.SerializeFromWorld), new StardustCore.Serialization.SerializerDataNode.SerializingToContainerFunction(StarAI.PathFindingCore.TileNode.Serialize)));
        }