public void SetLevel(Level _level, TileVector _tiles, ActionHandler _undoStack) { level = _level; tiles = _tiles; undoStack = _undoStack; Resize(); }
public InGameUser(StageEntity stageEntity, Status.Handle onGoldChanged, TimedConsumableCommandSet.Handle onChargedAttack) { status = new Status<User>(null, null); actionHandler = new ActionHandler(status); status.InitMinMaxVal(User.Gold, 0, stageEntity.maxGold, 0); status.InitMinMaxVal(User.Exp, 0, stageEntity.maxEXP, 0); status.InitMinMaxVal(User.Key, 0, stageEntity.maxKey, 0); AddAction(Action.E_Type.Money, delegate(float value, GameInstance firer, string[] param) { return new ActionHandler.Result(User.Gold, value); } ); AddAction(Action.E_Type.GetKey, delegate(float value, GameInstance firer, string[] param) { return new ActionHandler.Result(User.Key, value); } ); AddAction(Action.E_Type.Exp, delegate(float value, GameInstance firer, string[] param) { return new ActionHandler.Result(User.Exp, value); } ); status.RegisterOnChangeEvent(User.Gold, onGoldChanged); commandQueue = new TimedConsumableCommandSet(null, 100, false, null, onChargedAttack); }
public Action(ActionHandler aH, GameObject target = null) { this.target = target; AH = aH; Entity = aH.Entity; }
// public bool axisx; // public bool axisY; // public bool axisZ; void Start() { actionHandler = GetComponent<ActionHandler>(); if(actionHandler) { actionHandler.TakeAction += Teleporter; } }
public MappingDataItem(string propertyFrom, string propertyTo = null, ActionHandler<object, object> converter = null, bool ignoreCase = true) : this() { this.PropertyFrom = propertyFrom; this.PropertyTo = string.IsNullOrEmpty(propertyTo) ? this.PropertyFrom : propertyTo; this.IgnoreCase = ignoreCase; this.Converter = converter; }
public Search(ActionHandler aH, Vector3 targ) : base(aH, null) { targetPos = targ; setPriority(2); hangTime = Random.Range(3, 10); hangDistance = Random.Range(0.6f, 2); }
public void FocusCameraToPos(Vector3 _focalPos, float _focusDuration, Graph _focusGraph) { _focalPos.y -= mfCenterYOffset; _focalPos = ConstrainVectorToCameraBounds(_focalPos); MoveToAction focusToPos = new MoveToAction(camTransform, _focusGraph, _focalPos, _focusDuration); TickAction updateMiniMap = new TickAction(_focusDuration, UpdateMiniMap); ActionHandler.RunAction(focusToPos, updateMiniMap); }
public LayerViewModel(int number = -1, Action <LayerViewModel> delete = null) { deleteHandler = new ActionHandler(() => delete(this), o => true); Number = number; NeuronsCount = 1; ActivateFunctions = ActivationFunctionTypes.TypeNames; SelectedAF = ActivateFunctions[0]; IsUsingW0 = true; }
void Awake() { if (sInstance == null) sInstance = this; else Destroy(this.gameObject); SetUpActionHandler(); }
private void OnCollectionChanged() { ActionHandler handler = CollectionChanged; if (handler != null) { handler(); } }
public void RequestCleanupAndShutdown() { ActionHandler handler = CleanupAndShutdown; if (handler != null) { handler(); } }
void Start() { allComps = gameObject.GetComponents<MonoBehaviour>(); actionHandler = GetComponent<ActionHandler>(); if(actionHandler) { actionHandler.TakeAction += StopCheck; } }
/// <summary> /// Member CacheInt64Prop /// </summary> /// <param name="obj">obj</param><param name="tag">tag</param><param name="val">val</param> /// <remarks> /// IVwCacheDa method /// </remarks> public void CacheInt64Prop(int obj, int tag, long val) { var before = new CacheInfo(ObjType.Long, obj, tag, m_cache.get_Prop(obj, tag)); var after = new CacheInfo(ObjType.Long, obj, tag, val); ActionHandler.AddAction(new CacheUndoAction(m_cache, before, after)); m_cache.CacheInt64Prop(obj, tag, val); }
public CreateSolutionViewModel(string taskName) { canSave = true; Task = (models.Task)models.Task.where (new Query("Task").addTypeQuery(TypeQuery.select) .addCondition("Name", "=", taskName), typeof(models.Task))[0]; createHandler = new ActionHandler(createSolution, e => CanSave()); TaskName = taskName; TemplateName = Templates[0]; }
public LearnSolverViewModel(models.Task task, TaskSolver taskSolver) { TaskName = task.Name; SolverName = taskSolver.Name; solver = taskSolver; LearningList = new ObservableCollection <LearningModel>(); addHandler = new ActionHandler(() => Add(new LearningModel(this, task, taskSolver)), e => true); learnHandler = new ActionHandler(learnSolver, e => LearningList.All(lm => lm.CanSolve)); }
// private PlayerSwitch pSwitch; // Use this for initialization void Awake() { // pSwitch = GameObject.Find("Player").GetComponent<PlayerSwitch>(); actionHandler = GetComponent<ActionHandler>(); if(actionHandler) { actionHandler.TakeAction += Fade; } }
public void TurnOff() { var num = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "WaitForReady")); if (ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "Toggle")) != ActionResult.Handled && !SetToggleState(toggleState: ToggleState.Off)) { throw new ActionException(message: StringResource.Get(id: "ToggleSwitch_TurnOffFailed", (object)SafeGetName(uiObject: this))); } }
/// <summary> /// Initializes a new TestAction that runs on manual test, and optionally, automatic test. /// </summary> public TestAction(bool manualOnly, KeyCode keyCode, ActionHandler action, string description) { hasKey = true; this.Trigger = manualOnly ? ActionTrigger.Manual : ActionTrigger.Both; this.Key = keyCode; this.Handler = action; this.Description = description; }
/// <summary> /// Member CacheVecProp /// </summary> /// <param name="obj">obj</param><param name="tag">tag</param><param name="rghvo">rghvo</param><param name="chvo">chvo</param> public void CacheVecProp(int obj, int tag, int[] rghvo, int chvo) { var before = new CacheInfo(ObjType.Vector, obj, tag, m_cache.get_Prop(obj, tag)); var after = new CacheInfo(ObjType.Vector, obj, tag, rghvo); ActionHandler.AddAction(new CacheUndoAction(m_cache, before, after)); m_cache.CacheVecProp(obj, tag, rghvo, chvo); }
public AsyncTask Then(ActionHandler actionHandler) { AsyncTask next = new AsyncTask(actionHandler); next.parent = this; nextTasks.Add(next); return(next); }
/// <summary> /// Member CacheUnicodeProp /// </summary> /// <param name="obj">obj</param><param name="tag">tag</param><param name="val">val</param><param name="cch">cch</param> /// <remarks> /// IVwCacheDa method /// </remarks> public void CacheUnicodeProp(int obj, int tag, string val, int cch) { var before = new CacheInfo(ObjType.String, obj, tag, m_cache.get_Prop(obj, tag)); var after = new CacheInfo(ObjType.String, obj, tag, val); ActionHandler.AddAction(new CacheUndoAction(m_cache, before, after)); m_cache.CacheUnicodeProp(obj, tag, val, cch); }
void Start() { // Create a layer mask for the floor layer. floorMask = LayerMask.GetMask("Floor"); // Set up references. playerRigidbody = GetComponent <Rigidbody>(); action = GetComponent <ActionHandler>(); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Caches the boolean prop. /// </summary> /// <param name="hvo">The hvo.</param><param name="tag">The tag.</param><param name="value">if set to <c>true</c> [value].</param> /// <remarks> /// IVwCacheDa method /// </remarks> /// ------------------------------------------------------------------------------------ public void CacheBooleanProp(int hvo, int tag, bool value) { var before = new CacheInfo(ObjType.Bool, hvo, tag, m_cache.get_Prop(hvo, tag)); var after = new CacheInfo(ObjType.Bool, hvo, tag, value); ActionHandler.AddAction(new CacheUndoAction(m_cache, before, after)); m_cache.CacheBooleanProp(hvo, tag, value); }
public void SetUp(VillageManager villageManager, ActionHandler actionHandler) { _villageManager = villageManager; this.actionHandler = actionHandler; diseases = new List <DiseaseSO>(); Reset(); SetVillageStatusIcon(); }
/// <summary> /// Member CacheGuidProp /// </summary> /// <param name="obj">obj</param><param name="tag">tag</param><param name="uid">uid</param> /// <remarks> /// IVwCacheDa method /// </remarks> public void CacheGuidProp(int obj, int tag, Guid uid) { var before = new CacheInfo(ObjType.Guid, obj, tag, m_cache.get_Prop(obj, tag)); var after = new CacheInfo(ObjType.Guid, obj, tag, uid); ActionHandler.AddAction(new CacheUndoAction(m_cache, before, after)); m_cache.CacheGuidProp(obj, tag, uid); }
void Start() { mCol = GetComponent<MeshCollider>(); actionHandler = GetComponent<ActionHandler>(); if(actionHandler) { actionHandler.TakeAction += EnableG; } }
public HomeController(ApplicationContext db) { _commandHandler = new CommandHandler(); _actionHandler = new ActionHandler(); _commands = Bot.Commands; _actions = Bot.ActionList; _callbacks = Bot.CallbackList; }
public SolveViewModel(models.Task task, models.TaskSolver solver) { TaskID = task.ID; SolvingList = new ObservableCollection <SolvingInstance>(); SolverName = solver.Name; TaskName = task.Name; List <LearningInfo> learningList = new List <LearningInfo>(); List <models.LearnedSolver> learnedSolvers = models.LearnedSolver.learnedSolversOfTaskSolverID(solver.ID); foreach (models.LearnedSolver learnedSolver in learnedSolvers) { models.Selection selection = (models.Selection)models.Selection.getById(learnedSolver.SelectionID, typeof(models.Selection)); List <models.LearningQuality> qualities = models.LearningQuality.qualitiesOfSolverId(learnedSolver.ID); models.LearningScenario scenario = (models.LearningScenario)models.LearningScenario.getById(learnedSolver.LearningScenarioID, typeof(models.LearningScenario)); models.TaskTemplate template = (models.TaskTemplate)models.TaskTemplate.getById(selection.TaskTemplateID, typeof(models.TaskTemplate)); models.LearningQuality quality = (qualities != null && qualities.Count > 0) ? qualities[0] : null; List <models.Parameter> parameters = models.Parameter.parametersOfTaskTemplateId(template.ID); int outputParam = 0; foreach (models.Parameter param in parameters) { if (param.IsOutput == 1) { outputParam = param.ID; break; } } learningList.Add(new LearningInfo { SelectionID = selection.ID, ParameterID = outputParam, SelectionName = selection.Name, LearningScenarioName = scenario.Name, PreprocessingName = template.Name, TestMistake = (quality != null) ? quality.MistakeTest : 0, TrainMistake = (quality != null) ? quality.MistakeTrain : 0, ClosingError = Convert.ToSingle((quality != null) ? quality.ClosingError : 0), TaskTemplate = template, LearnedSolver = learnedSolver }); } LearningList = learningList.ToArray(); addHandler = new ActionHandler(() => { SolvingList.Add(new SolvingInstance(this, this.SelectedLearning.TaskTemplate)); solveHandler.RaiseCanExecuteChanged(); saveHandler.RaiseCanExecuteChanged(); SelectedSolution = Solutions[0]; NotifyPropertyChanged("SelectedSolution"); NotifyPropertyChanged("Solutions"); }, e => SelectedLearning != null); solveHandler = new ActionHandler(Solve, e => SolvingList.Count > 0); saveHandler = new ActionHandler(saveSolutions, e => SolvingList.Count > 0); SelectedSolution = Solutions[0]; }
public void WaitForInputIdle(int milliseconds) { var num = (int)ActionHandler.Invoke(sender: UIObject, actionInfo: ActionEventArgs.GetDefault(action: "WaitForReady")); if (ActionHandler.Invoke(sender: UIObject, actionInfo: new ActionEventArgs(action: nameof(WaitForInputIdle), milliseconds)) != ActionResult.Unhandled) { return; } Pattern.WaitForInputIdle(milliseconds: milliseconds); }
public SolverLeaf(models.Task task, models.TaskSolver solver, string solverType, TaskTreeViewModel vm) : base(solver.Name) { parentTask = task; this.solverType = solverType; this.solver = solver; showSolverInfoHandler = new ActionHandler(() => vm.SendRequestCreateView(CreateSolverInfoViewModel()), e => true); showSolveDialogHandler = new ActionHandler(() => vm.SendRequestCreateView(new SolveViewModel(parentTask, solver)), e => true); showLearnDialogHandler = new ActionHandler(() => vm.SendRequestCreateView(new LearnSolverViewModel(parentTask, solver)), e => true); }
public void TestMainActionsOrder() { var l = ActionHandler.List(); var old = l.main; l.main = new [] { "action,a,1", "action,a,2", "action,a,3", "action,a,4" }; Assert.AreEqual(new [] { "action,a,4", "action,a,1", "action,a,2", "action,a,3" }, ActionHandler.Main(3).Select(a => a.ToString()).ToArray()); l.main = old; }
public void TestLoadAutomationActions() { var astr = ActionHandler.Automaton(); Assert.IsNotNull(astr); Assert.AreEqual("require", astr[0].location); Assert.AreEqual("Route", astr[0].first); Assert.AreEqual("Route: Lodgings", astr[0].second); Assert.AreEqual(new[] { "1", "RentLodgings" }, astr[0].third); }
public UrlInfo(ActionHandler handler) { Url = handler.SourceUrl; Http = new HttpInvoke(); Http.Build(handler); WebSocket = new WebSocketInvoke(); WebSocket.Build(handler); Remark = handler.Remark; Handler = handler; }
public void SetValue(double value) { var num1 = (int)ActionHandler.Invoke(sender: UIObject, actionInfo: ActionEventArgs.GetDefault(action: "WaitForReady")); if (ActionHandler.Invoke(sender: UIObject, actionInfo: new ActionEventArgs(action: "RangeSetValue", value)) == ActionResult.Unhandled) { Pattern.SetValue(value: value); } var num2 = (int)ActionHandler.Invoke(sender: UIObject, actionInfo: ActionEventArgs.GetDefault(action: "UIScrollComplete")); }
public SolverCreationViewModel(models.Task task) { parentTask = task; TaskName = task.Name; SolverName = "Решатель 1"; SolverTypes = SolverParameterFactory.Types; SelectedType = SolverTypes[0]; createHandler = new ActionHandler(CreateSolver, o => Parameters.CanCreateSolver(SolverName, parentTask)); cancelHandler = new ActionHandler(() => OnClose?.Invoke(this, null), o => true); }
private void Start() { btn = gameObject.GetComponent <Button>(); btn.onClick.AddListener(unlockAction); ActionHandlerScript = GameObject.Find("DataReader").GetComponent <ActionHandler>(); player = GameObject.Find("Player").GetComponent <PlayerActions>(); errorDiplay = GameObject.Find("DialogueBox").GetComponent <Text>(); btnText = btn.GetComponentInChildren <Text>(); init_text = btnText.text; }
void UpdateFighterAction() { ActionHandler actionHandler = fighterObject.GetComponent <ActionHandler>(); actionHandler.DoAction(editor.currentAction); while (actionHandler.CurrentAction.current_frame < editor.currentFrame) { actionHandler.ManualUpdate(); } }
void Start() { particleSys = GetComponent<ParticleSystem>(); actionHandler = GetComponent<ActionHandler>(); if(actionHandler) { actionHandler.TakeAction += StartEmission; } }
public LearningScenarioManagerViewModel() { learningScenario = new LearningScenario(); listLearningScenarion = Entity.all(typeof(LearningScenario)); ScenarioList = new ObservableCollection <LearningScenarioViewModel>(); updateLearningScenariosInfo(); propertiesHandler = new ActionHandler(() => requestShowLearningScenario?.Invoke(SelectedScenario), e => SelectedScenario != null); deleteHandler = new ActionHandler(() => removeLearningScenario(SelectedScenario), e => SelectedScenario != null); createHandler = new ActionHandler(() => requestCreateLearningScenario?.Invoke(), e => true); }
public void ScrollIntoView() { var num = (int)ActionHandler.Invoke(sender: UIObject, actionInfo: ActionEventArgs.GetDefault(action: "WaitForReady")); if (ActionHandler.Invoke(sender: UIObject, actionInfo: new ActionEventArgs(action: nameof(ScrollIntoView), args: Array.Empty <object>())) != ActionResult.Unhandled) { return; } Pattern.ScrollIntoView(); }
public void TestLoadMainActions() { var mstr = ActionHandler.Main(0); var shifted = ActionHandler.Main(1); var dayshifted = ActionHandler.Main(); var day = System.DateTime.UtcNow.DayOfYear % dayshifted.Length; Assert.AreEqual(mstr[1].ToString(), shifted[0].ToString()); Assert.AreEqual(mstr[day].ToString(), dayshifted[0].ToString()); }
void Start() { sColor = GetComponent<Renderer>().material.color; noAlpha =new Color(GetComponent<Renderer>().material.color.r, GetComponent<Renderer>().material.color.g, GetComponent<Renderer>().material.color.b, 0); actionHandler = GetComponent<ActionHandler>(); if(actionHandler) { actionHandler.TakeAction += Fader; } GetComponent<Renderer>().enabled = false; }
// public ActionHandler actionHandler; void Awake() { // onOff = true; pSwitch = GameObject.FindObjectOfType<PlayerSwitch>(); gameObject.transform.position = moveStartPos; actionHandler = GetComponent<ActionHandler>(); if(actionHandler) { actionHandler.TakeAction += TransformPositionT; } // actionHandler = GetComponent<ActionHandler>(); }
public MenuItem AddItem(string title, ActionHandler action, string keyEquivalent) { MenuItem item = (MenuItem) Object.FromIntPtr ((IntPtr) ObjCMessaging.objc_msgSend ( NativeObject, "addItemWithTitle:action:keyEquivalent:", typeof (IntPtr), typeof (IntPtr), new Cocoa.String (title).NativeObject, typeof (IntPtr), IntPtr.Zero, typeof (IntPtr), new Cocoa.String (keyEquivalent).NativeObject)); if (action != null) item.Click += action; return item; }
void Start() { aSource = GetComponent<AudioSource>(); if(duration == 0) { duration = aSource.clip.length; } actionHandler = GetComponent<ActionHandler>(); if(actionHandler) { actionHandler.TakeAction += PlayClip; } aSource.volume = 0; }
internal XmlElement GetXml(ActionHandler.UDS.Service.ServiceAction serviceAction) { XmlHelper h = new XmlHelper("<Field/>"); XmlElement e = h.GetElement("."); e.SetAttribute("Source", this.Source); if (serviceAction == ServiceAction.Select && !string.IsNullOrWhiteSpace(this.Alias)) e.SetAttribute("Alias", this.Alias); if (serviceAction == ServiceAction.Insert && this.AutoNumber) e.SetAttribute("AutoNumber", this.AutoNumber.ToString()); if (serviceAction != ServiceAction.Select && !this.InputConverter.Equals(ConverterType.Empty)) e.SetAttribute("InputConverter", this.InputConverter.ToString()); if (serviceAction == ServiceAction.Select && !this.OutputConverter.Equals(ConverterType.Empty)) e.SetAttribute("OutputConverter", this.OutputConverter.ToString()); if (serviceAction != ServiceAction.Select && this.InputType != IOType.Element) e.SetAttribute("InputType", this.InputType.ToString()); if (serviceAction == ServiceAction.Select && this.Mandatory) e.SetAttribute("Mandatory", this.Mandatory.ToString()); if (serviceAction == ServiceAction.Select && this.OutputType != IOType.Element) e.SetAttribute("OutputType", this.OutputType.ToString()); if (serviceAction != ServiceAction.Select && !this.Quote) e.SetAttribute("Quote", this.Quote.ToString()); if (serviceAction != ServiceAction.Select && this.Required) e.SetAttribute("Required", this.Required.ToString()); if (serviceAction != ServiceAction.Select && this.SourceType != Service.SourceType.Request) e.SetAttribute("SourceType", this.SourceType.ToString()); e.SetAttribute("Target", this.Target); return e; }
public ActionTuple(string label, ActionHandler handler) { Label = label; Handler = handler; }
// Checks whether the system allows adding buttons to a notification, // prevents error messages in Ubuntu. public new void AddAction(string action, string label, ActionHandler handler) { if (Array.IndexOf (Notifications.Global.Capabilities, "actions") > -1) base.AddAction (action, label, handler); }
public void AddAction(string action, string label, ActionHandler handler) { lock (action_map) { action_map[action] = new ActionTuple (label, handler); } Update (); }
void Start() { pSys = GetComponent<ParticleSystem>(); actionHandler = GetComponent<ActionHandler>(); if(actionHandler) { actionHandler.TakeAction += FadeS; } }
void AddAction(Action.E_Type type, ActionHandler.HandleFunc handleFunc) { actionHandler.Add(type, handleFunc); }
static void DBOpenClose(ActionHandler action) { m_dbConnection = new SQLiteConnection("Data Source=MyDatabase.sqlite;Version=3;"); m_dbConnection.Open(); action(); m_dbConnection.Close(); }
void Start() { fadeBlack = GameObject.Find ("BlackFade"); anim = GetComponentInChildren<Animator>(); charGfx = anim.gameObject.transform; sMove = GameObject.FindObjectOfType<SpiritMovement>(); pMove = GetComponent<PlayerMovement>(); pSwitch = GetComponent<PlayerSwitch>(); actionHandler = GetComponent<ActionHandler>(); if(actionHandler) { actionHandler.TakeAction += End; } // StartCoroutine("EndCR"); }
void Start () { Entity entity = gameObject.GetComponent<Entity>(); AH = new ActionHandler(entity); SH = new SenseHandler(entity,isDeaf,isBlind); }
/// <summary> /// Applies the given action handler to this parser /// </summary> /// <param name="act">An ActionHandler</param> /// <returns>this</returns> public virtual Parser this[ActionHandler act] { get { Act += act; return this; } }
public Walk(ActionHandler aH, GameObject target = null) : base(aH, target) { setPriority(1); hangTime = Random.Range(3, 30); }
protected void AddAction(Action.E_Type type, ActionHandler.HandleFunc handleFunc) { if (actionHandler == null) { actionHandler = new ActionHandler(status); } actionHandler.Add(type, handleFunc); }
void OnDestroy() { sInstance = null; }
public Attack(ActionHandler aH, GameObject target = null) : base(aH, target) { setPriority(4); this.target = target; }
public void AddAction (string action, string label, ActionHandler handler) { if (Notifications.Global.Capabilities != null && Array.IndexOf (Notifications.Global.Capabilities, "actions") > -1) { lock (action_map) { action_map[action] = new ActionTuple (label, handler); } Update (); } }