public ActionDefinition(ActionLibrary parent, string name, int id)
 {
     Library = parent;
     GameMakerVersion = 520;
     Name = name;
     ActionID = id;
     System.IO.MemoryStream ms = new System.IO.MemoryStream();
     Properties.Resources.DefaultAction.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
     OriginalImage = ms.ToArray();
     ms.Close();
     Image = new System.Drawing.Bitmap(24, 24, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
     System.Drawing.Graphics.FromImage(Image).DrawImage(Properties.Resources.DefaultAction, new System.Drawing.Rectangle(0, 0, 24, 24), new System.Drawing.Rectangle(0, 0, 24, 24), System.Drawing.GraphicsUnit.Pixel);
     (Image as System.Drawing.Bitmap).MakeTransparent(Properties.Resources.DefaultAction.GetPixel(0, Properties.Resources.DefaultAction.Height - 1));
     Hidden = false;
     Advanced = false;
     RegisteredOnly = false;
     Description = string.Empty;
     ListText = string.Empty;
     HintText = string.Empty;
     Kind = ActionKind.Normal;
     InterfaceKind = ActionInferfaceKind.Normal;
     IsQuestion = false;
     ShowApplyTo = true;
     ShowRelative = true;
     ArgumentCount = 0;
     Arguments = new ActionArgument[8];
     for (int i = 0; i < 8; i++) Arguments[i] = new ActionArgument();
     ExecutionType = ActionExecutionType.None;
     FunctionName = string.Empty;
     Code = string.Empty;
 }
		private void AddActionArgument()
		{
			string error;

			try
			{
				ActionArgument actionArg = new ActionArgument();
				actionArg.Name = txtName.Text;
				actionArg.Expression = BuildExpression();

				if (actionArg.IsValid())
				{
					actionArgs.Add(actionArg);
					RefreshActionArguments();

					txtName.Text = string.Empty;
					cbTarget.Text = string.Empty;
					cbPropertyOrValue.Text = string.Empty;
					ckIgnoreErrors.Checked = false;

					return;
				}
				else
				{
					error = actionArg.Error;
				}
			}
			catch(Exception e)
			{
				error = e.Message;
			}

			MessageBox.Show(error, "Add Action Argument",
			                MessageBoxButtons.OK, MessageBoxIcon.Error);
		}
Beispiel #3
0
    // we don't need [Command] for Stun
    // because stun can only be triggered on server
    private void StunMethod(GameObject sender, ActionArgument args)
    {
        float stunTime = (args as StunArgument).time;

        RpcStun(stunTime);
        _StunMethod(stunTime);
    }
Beispiel #4
0
        private static List <ActionType> LoadActionTypes()
        {
            var on = new ActionArgument {
                Identifer = 1, Value = "on"
            };
            var off = new ActionArgument {
                Identifer = 2, Value = "off"
            };
            var location = new ActionArgument {
                Identifer = 3, Value = "location"
            };

            return(new List <ActionType>
            {
                new ActionType
                {
                    Identifer = 1, Name = "switch",
                    DeviceCapability = DeviceCapability.Switchable,
                    ActionArguments = new List <ActionArgument> {
                        on, off
                    }
                },
                new ActionType
                {
                    Identifer = 2, Name = "IFTTT Maker Event",
                    DeviceCapability = DeviceCapability.WebService,
                    ActionArguments = new List <ActionArgument> {
                        location
                    }
                }
            });
        }
Beispiel #5
0
 public override void Remove(ActionArgument arg)
 {
     arg.NeedMapException();
     foreach (var ele in arg.holder.data)
     {
         arg.onMap.data.modi.Remove(ele.Key);
     }
 }
Beispiel #6
0
 private void StopMovementMethod(GameObject sender, ActionArgument args)
 {
     m_rigidbody.velocity = Vector3.zero;
     if (isServer)
     {
         RpcStopMovement();
     }
 }
Beispiel #7
0
 public override void Remove(ActionArgument arg)
 {
     arg.NeedMapException();
     foreach (var ele in arg.holder.data)
     {
         Set(arg.onMap, ele.Key, ConvertHelper.Int(ele.Value) * -1);
     }
 }
Beispiel #8
0
 // server only
 private void DieMethod(GameObject sender, ActionArgument args)
 {
     if (isServer)
     {
         _DieServer();
         RpcDie();
         _Die();
     }
 }
Beispiel #9
0
        public void ConvertValue_Always_ReturnsSameValue()
        {
            string         value      = "Hello, World!";
            ActionArgument argument   = new ActionArgument(0, "name", value);
            IDictionary    parameters = new Hashtable();

            Assert.IsTrue(_service.ConvertArgument(null, argument, parameters));
            Assert.AreEqual(value, parameters["name"]);
        }
		public void ConvertValue_Always_ReturnsSameValue()
		{
			var value = "Hello, World!";
			var argument = new ActionArgument(0, "name", value);
			var parameters = new Hashtable();

			Assert.IsTrue(service.ConvertArgument(null, argument, parameters));
			Assert.AreEqual(value, parameters["name"]);
		}
Beispiel #11
0
    public void Perform(string action, GameObject sender, ActionArgument args)
    {
        ActionFunction method;
        bool           valid = actions[currentState].TryGetValue(action, out method);

        if (valid)
        {
            method(sender, args);
        }
    }
 public Tournament()
 {
     Arguments = new ActionArgument[]
     {
         new ActionArgument("Bボタンに対するAボタンの回数")
         {
             Value = "10"
         }
     };
 }
Beispiel #13
0
 public RaidBattle()
 {
     Arguments = new ActionArgument[]
     {
         new ActionArgument("バトルする時間[s]")
         {
             Value = "200"
         }
     };
 }
Beispiel #14
0
 private void EndCastingMethod(GameObject sender, ActionArgument args)
 {
     if (isServer)
     {
         RpcEndCastingMethod();
         if (currentState == CharacterState.Casting)
         {
             Transit(CharacterState.Normal);
         }
     }
 }
Beispiel #15
0
        public ArgumentParser Add(string prototype, string description, ArgumentAction <string, string> action, bool hidden)
        {
            if (action == null)
            {
                throw new ArgumentNullException(nameof(action));
            }
            Argument p = new ActionArgument(prototype, description, 2,
                                            delegate(ArgumentValueCollection v) { action(v[0], v[1]); }, hidden);

            base.Add(p);
            return(this);
        }
Beispiel #16
0
        public string Removes(ActionEvent evt, Player player, [CanBeNull] MapElementInfo info, NVector pos)
        {
            ActionArgument arg = new ActionArgument(evt, null, player, info, pos);

            foreach (var action in Is(evt))
            {
                arg.holder = action;
                Remove(arg);
            }

            //todo
            return(null);
        }
        private IList <UPnPAction> ParseActions(XContainer xml)
        {
            IList <UPnPAction> actions = new List <UPnPAction>();

            foreach (XElement statevar in xml.Descendants().Where(x => x.Name.LocalName == "actionList").Elements())
            {
                UPnPAction action = new UPnPAction();

                foreach (XElement element in statevar.Elements())
                {
                    switch (element.Name.LocalName)
                    {
                    case "name":
                        action.Name = element.Value;
                        break;

                    case "argumentList":
                        foreach (XElement xElement in element.Elements())
                        {
                            ActionArgument arg = new ActionArgument();
                            foreach (XElement xElement1 in xElement.Elements())
                            {
                                switch (xElement1.Name.LocalName)
                                {
                                case "name":
                                    arg.Name = xElement1.Value;
                                    break;

                                case "direction":
                                    arg.Direction = xElement1.Value == "in"
                                                                                                ? ActionArgument.ArgumentDirection.In
                                                                                                : ActionArgument.ArgumentDirection.Out;
                                    break;

                                case "relatedStateVariable":
                                    arg.RelatedStateVariable = xElement1.Value;
                                    break;
                                }
                            }
                            action.Arguments.Add(arg);
                        }

                        break;
                    }
                }

                actions.Add(action);
            }

            return(actions);
        }
Beispiel #18
0
 public FastForwardDays()
 {
     Arguments = new ActionArgument[]
     {
         new ActionArgument("現在の日付")
         {
             Value = DateTime.Now.ToString("yyyy-MM-dd")
         },
         new ActionArgument("進める日数")
         {
             Value = "1"
         },
     };
 }
 public GainWatt()
 {
     Arguments = new ActionArgument[]
     {
         new ActionArgument("現在の日付")
         {
             Value = DateTime.Now.ToString("yyyy-MM-dd")
         },
         new ActionArgument("短縮版")
         {
             Value = false.ToString()
         },
     };
 }
Beispiel #20
0
 public Berry()
 {
     Arguments = new ActionArgument[]
     {
         new ActionArgument("A連打する時間[s]")
         {
             Value = "65"
         },
         new ActionArgument("回数")
         {
             Value = "400"
         }
     };
 }
    void ChargeMethod(GameObject sender, ActionArgument args)
    {
        bool originalCharging = m_Charging;

        if (m_InteractingPowerSource != null)
        {
            m_Charging = true;
        }
        else
        {
            m_Charging = false;
        }
        if (originalCharging != m_Charging)
        {
            CmdCharge(m_Charging);
        }
    }
Beispiel #22
0
    void HookMethod(GameObject sender, ActionArgument args)
    {
        if (!hasHook)
        {
            return;
        }

        if (GetComponent <AICharacter>() != null)
        {
            DirectionArgument dirc = (DirectionArgument)args;
            CmdHook(dirc.direction.normalized);
            return;
        }

        else
        {
            CmdHook(transform.forward);

            // was implemented to add flicking support for human players
            character.SwitchCoroutine(StartCoroutine(_ThrowHookDelayPlayer(transform.forward, hookSpellTime)));
        }
    }
Beispiel #23
0
        private static void CategorizeParameter(
            IDictionary <string, string> queryParameters,
            IDictionary <string, string> routeParameters,
            ActionArgument argument)
        {
            var argumentValue       = argument.Value;
            var parameterDescriptor = argument.Descriptor;

            switch (parameterDescriptor.BindingInfo.BindingSource.Id)
            {
            case "Query":
                queryParameters[parameterDescriptor.Name] = argumentValue.ToString();
                break;

            case "Path":
                routeParameters[parameterDescriptor.Name] = argumentValue.ToString();
                break;

            default:
                return;
            }
        }
Beispiel #24
0
 private void AttackMethod(GameObject sender, ActionArgument args)
 {
     CmdAttack();
 }
Beispiel #25
0
 public virtual void Remove(ActionArgument arg)
 {
     //todo
     throw new NotImplementedException();
 }
 void SmokeMethod(GameObject sender, ActionArgument args)
 {
     CmdThrowSmoke();
 }
 void DeployMethod(GameObject sender, ActionArgument args)
 {
     CmdDeploy();
 }
		internal ActionArgumentDescriptor(ActionArgument actionArg)
			: base(actionArg.Name, new Attribute[] {DataCategory})
		{
			this.actionArg = actionArg;
		}
Beispiel #29
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="action"></param>
 /// <param name="evt"></param>
 /// <param name="player"></param>
 /// <param name="info"></param>
 /// <param name="pos"></param>
 /// <returns>null or error message</returns>
 public void Remove(ActionArgument arg)
 {
     arg.holder.PerformAction().Remove(arg);
 }
Beispiel #30
0
 public bool ConvertArgument(MethodSignature signature, ActionArgument argument, IDictionary parameters)
 {
     parameters.Add(argument.Name, argument.Value);
     return(true);
 }
 public Horidashimono()
 {
     Arguments = new ActionArgument[] { };
 }
Beispiel #32
0
 private void WarSenseMethod(GameObject sender, ActionArgument args)
 {
     // cmd activate war sense
     CmdWarSense();
 }
 public TryLotoID()
 {
     Arguments = new ActionArgument[] { };
 }
 public CaptureCalyrex()
 {
     Arguments = new ActionArgument[]
     {
     };
 }