コード例 #1
0
        // using a prebuilt list of croptypes
        public static void registerTrackedTypes()
        {
            // loop through each growable type
            foreach (GrowableType gt in GrowableTypesTracker)
            {
                // register each crop with our custom crop actions


                ItemTypesServer.RegisterOnAdd(gt.TypeName, gt.OnAddAction);
                ItemTypesServer.RegisterOnRemove(gt.TypeName, gt.OnRemoveAction);
                ItemTypesServer.RegisterOnChange(gt.TypeName, gt.OnChangeAction);
            }
        }
コード例 #2
0
        // using a prebuilt list of croptypes
        public static void registerTrackedTypes()
        {
            // loop through each growable type
            foreach (GrowableType gt in GrowableTypesTracker)
            {
                // register each crop with our custom crop actions


                ItemTypesServer.RegisterOnAdd(gt.TypeName, gt.OnAddAction);
                ItemTypesServer.RegisterOnRemove(gt.TypeName, gt.OnRemoveAction);
                ItemTypesServer.RegisterOnChange(gt.TypeName, gt.OnChangeAction);
            }

            ColonyAPI.Helpers.Utilities.WriteLog("ColonyPlusPlus-Core", "Registered Crop Actions");
        }
コード例 #3
0
        public void RegisterActionCallback()
        {
            // Utilities.WriteLog("Registering actions for:" + this.TypeName);
            if (this._HasAddAction)
            {
                ItemTypesServer.RegisterOnAdd(this.TypeName, this.onAddAction);
            }

            if (this._HasChangeAction)
            {
                ItemTypesServer.RegisterOnChange(this.TypeName, this.onChangeAction);
            }

            if (this._HasRemoveAction)
            {
                ItemTypesServer.RegisterOnRemove(this.TypeName, this.onRemoveAction);
            }
        }