public LinkEventArgs(string link, string href, string text, TargetEnum target) { Link = link; Href = href; Text = text; Target = target; }
void OnGUI() { EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("读取文件(*.csv)")) { fileName = EditorUtility.OpenFilePanel("", Application.dataPath, "csv"); content = File.ReadAllText(fileName); } te = (TargetEnum)EditorGUILayout.EnumPopup("平台", te); if (te == TargetEnum.Android) { target = BuildTarget.Android; } else if (te == TargetEnum.iOS) { target = BuildTarget.iOS; } fe = (FileEnum)EditorGUILayout.EnumPopup("文本列表名", fe); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(fileName); if (GUILayout.Button("生成AssetBundle")) { BuildFiles(); } EditorGUILayout.EndHorizontal(); }
public void AI_kill(Ship ship) { //turning ship into dead station for (int i = 0; i < ship.Len; i++) { int x, y; if (ship.Horizontal) { x = ship.x; y = ship.y + i; } else { x = ship.x + i; y = ship.y; } playersBoard.Board[x][y] = BoardSquareState.Dead; } tn = TargetEnum.None; goodHits = new List <int[]>(); recomended = new List <int[]>(); if (Set.CanTouch == false) { AI_cover(ship); } }
private static void TryAssertionTargetCurrentMatch( RegressionEnvironment env, bool testSoda, TargetEnum target) { var fields = new[] {"a1.Id", "aarr[0].Id", "b.Id"}; var epl = "@Name('s0') select * from pattern " + GetText(target) + "[every a1=SupportIdEventA -> [:10] aarr=SupportIdEventA until b=SupportIdEventB]"; env.CompileDeploy(testSoda, epl).AddListener("s0"); SendAEvent(env, "A1"); SendAEvent(env, "A2"); SendBEvent(env, "B1"); if (target == TargetEnum.SUPPRESS_ONLY || target == TargetEnum.DISCARD_AND_SUPPRESS) { EPAssertionUtil.AssertProps( env.Listener("s0").AssertOneGetNewAndReset(), fields, new object[] {"A1", "A2", "B1"}); } else { EPAssertionUtil.AssertPropsPerRowAnyOrder( env.Listener("s0").GetAndResetLastNewData(), fields, new[] { new object[] {"A1", "A2", "B1"}, new object[] {"A2", null, "B1"} }); } env.UndeployAll(); }
public FunctionCompiler(Assembly configurationSourceAssembly, string outputBinaryFolder, bool outputProxiesJson, TargetEnum target, IAssemblyCompiler assemblyCompiler = null, ITriggerReferenceProvider triggerReferenceProvider = null) { _configurationSourceAssembly = configurationSourceAssembly; _outputBinaryFolder = outputBinaryFolder; _outputProxiesJson = outputProxiesJson; _target = target; _serviceCollection = new ServiceCollection(); CommandingDependencyResolverAdapter adapter = new CommandingDependencyResolverAdapter( (fromType, toInstance) => _serviceCollection.AddSingleton(fromType, toInstance), (fromType, toType) => _serviceCollection.AddTransient(fromType, toType), (resolveType) => null // we never resolve during compilation ); _commandRegistry = adapter.AddCommanding(); _assemblyCompiler = assemblyCompiler ?? new AssemblyCompiler(); _triggerReferenceProvider = triggerReferenceProvider ?? new TriggerReferenceProvider(); _jsonCompiler = new JsonCompiler(); _proxiesJsonCompiler = new ProxiesJsonCompiler(); _openApiCompiler = new OpenApiCompiler(); }
public CameraControl(TargetEnum argTarget, KeyCode argKeyCode, MouseCodeEnum argMouseCode, float argStepSize) { target = argTarget; keyCode = argKeyCode; mouseCode = argMouseCode; stepSize = argStepSize; }
private static void TryAssertionTargetNextMatch( RegressionEnvironment env, bool testSoda, TargetEnum target) { var fields = new[] {"a.Id", "b.Id", "c.Id"}; var epl = "@Name('s0') select * from pattern " + GetText(target) + "[every a=SupportIdEventA -> b=SupportIdEventB -> c=SupportIdEventC(Pc=a.Pa)]"; env.CompileDeploy(testSoda, epl).AddListener("s0"); SendAEvent(env, "A1", "x"); SendAEvent(env, "A2", "y"); SendBEvent(env, "B1"); SendCEvent(env, "C1", "y"); EPAssertionUtil.AssertProps( env.Listener("s0").AssertOneGetNewAndReset(), fields, new object[] {"A2", "B1", "C1"}); SendCEvent(env, "C2", "x"); if (target == TargetEnum.SUPPRESS_ONLY || target == TargetEnum.NONE) { EPAssertionUtil.AssertProps( env.Listener("s0").AssertOneGetNewAndReset(), fields, new object[] {"A1", "B1", "C2"}); } else { Assert.IsFalse(env.Listener("s0").IsInvoked); } env.UndeployAll(); }
/// <summary> /// Initializes a new instance of the <see cref="InputConvertDuration" /> class. /// </summary> /// <param name="input">input (required).</param> /// <param name="source">source (required).</param> /// <param name="target">target (required).</param> public InputConvertDuration(decimal input = default(decimal), SourceEnum source = default(SourceEnum), TargetEnum target = default(TargetEnum)) { // to ensure "input" is required (not null) if (input == null) { throw new InvalidDataException("input is a required property for InputConvertDuration and cannot be null"); } else { this.Input = input; } // to ensure "source" is required (not null) if (source == null) { throw new InvalidDataException("source is a required property for InputConvertDuration and cannot be null"); } else { this.Source = source; } // to ensure "target" is required (not null) if (target == null) { throw new InvalidDataException("target is a required property for InputConvertDuration and cannot be null"); } else { this.Target = target; } }
public void SetMap(Game game, Debug debug, Unit enemy, TargetEnum targetType) { _game = game; for (int x = 1; x < 39; x++) { for (int y = 1; y < 29; y++) { if ((game.Level.Tiles[x][y] != Tile.Wall && !(game.Level.Tiles[x][y + 1] == Tile.Wall && game.Level.Tiles[x][y - 1] == Tile.Wall)) && (game.Level.Tiles[x][y] != Tile.JumpPad && game.Level.Tiles[x + 1][y] != Tile.JumpPad && game.Level.Tiles[x - 1][y] != Tile.JumpPad)) { if (targetType != TargetEnum.Enemy && x == (int)enemy.Position.X && (y == (int)enemy.Position.Y || y == (int)enemy.Position.Y + 1)) { MGrid[x, y] = 0; //debug.Draw(new CustomData.Rect(new Vec2Float(x, y), new Vec2Float(1, 1), new ColorFloat(255, 0, 0, 0.4F))); } else { MGrid[x, y] = 1; } } else { MGrid[x, y] = 0; //debug.Draw(new CustomData.Rect(new Vec2Float(x, y), new Vec2Float(1, 1), new ColorFloat(255, 0, 0, 0.4F))); } } } }
public LinkEventArgs(string link, string href, string text, TargetEnum target) { _link = link; _href = href; _text = text; _target = target; }
public AttackTypeRange(string[] data) { Debug.Assert(data.Length == 6); minAttackRange = int.Parse(data[2]); maxAttackRange = int.Parse(data[3]); damage = int.Parse(data[4]); coolTime = float.Parse(data[5]); target = (TargetEnum)Enum.Parse(typeof(TargetEnum), data[6]); }
/// <summary> /// Adds an event receiver to the specified target /// </summary> /// <param name="url">The URL.</param> /// <param name="contentTypeName">Name of the content type.</param> /// <param name="target">The target.</param> /// <param name="assembly">The assembly.</param> /// <param name="className">Name of the class.</param> /// <param name="type">The type.</param> /// <param name="sequence">The sequence.</param> /// <param name="name">The name.</param> public static void Add(string url, string contentTypeName, TargetEnum target, string assembly, string className, SPEventReceiverType type, int sequence, string name) { using (SPSite site = new SPSite(url)) using (SPWeb web = site.OpenWeb()) { SPContentType contentType = null; SPEventReceiverDefinitionCollection eventReceivers; if (target == TargetEnum.List) { SPList list = Utilities.GetListFromViewUrl(web, url); if (list == null) { throw new Exception("List not found."); } eventReceivers = list.EventReceivers; } else if (target == TargetEnum.Site) { eventReceivers = web.EventReceivers; } else { try { contentType = web.AvailableContentTypes[contentTypeName]; } catch (ArgumentException) { } if (contentType == null) { throw new SPSyntaxException("The specified content type could not be found."); } eventReceivers = contentType.EventReceivers; } SPEventReceiverDefinition def = Add(eventReceivers, type, assembly, className, name); if (sequence >= 0) { def.SequenceNumber = sequence; def.Update(); } if (contentType != null) { try { contentType.Update((contentType.ParentList == null)); } catch (Exception ex) { Exception ex1 = new Exception("An error occured updating the content type. Most likely the content type was updated but changes may not have been pushed down to any children.", ex); Logger.WriteException(new ErrorRecord(ex1, null, ErrorCategory.NotSpecified, contentType)); } } } }
/// <summary> /// 添加标的信息 /// </summary> /// <param name="typeId"></param> /// <returns></returns> private bool AddAction(int typeId) { TargetProperty targetModel = new TargetProperty(); TargetPropertyManager targetBLL = new TargetPropertyManager(); TargetEnum enumModel = new TargetEnum(); TargetEnumManager enumBLL = new TargetEnumManager(); if (HidMainFlag.Value == string.Empty) { targetModel.MainFlag = null; } else { targetModel.MainFlag = HidMainFlag.Value == "chkMain_0" ? true : false; //判断是否是主标 } targetModel.IsRequired = this.isrequired.Checked; //判断是否必填 targetModel.PropertyName = txtName.Text; //标的描述 targetModel.PropertyType = Convert.ToInt32(rdoDataType.SelectedValue); //数据类型 try { targetModel.PropertyId = targetBLL.GetMaxID(typeId) + 1;//自动生成 } catch (Exception) { targetModel.PropertyId = 0; } targetModel.EnumTypeId = 0; //属性数据关联id targetModel.PropertyNO = txtNum.Text; //标的编号 targetModel.TargetTypeId = typeId; //标的种类关联id if (rdoDataType.Items.FindByValue("9").Selected) //数据类型为多选一 { targetModel.EnumTypeId = enumBLL.GetMaxId() + 1; enumModel.EnumTypeId = enumBLL.GetMaxId() + 1; string temp = HidItem.Value; if (temp.EndsWith("$¥$")) { temp = temp.TrimEnd("$¥$".ToCharArray()); } temp = temp.Replace("$¥$", "$"); string[] enumValues = temp.Split('$'); for (int i = 0; i < enumValues.Count(); i++) { enumModel.EnumId = i + 1; enumModel.EnumValue = enumValues[i]; enumBLL.Add(enumModel); } } return(targetBLL.Add(targetModel)); }
public AttackTypeSprite(string[] data) { Debug.Assert(data.Length == 8); minAttackRange = int.Parse(data[1]); maxAttackRange = int.Parse(data[2]); attackWidth = int.Parse(data[3]); attackHeight = int.Parse(data[4]); damage = int.Parse(data[5]); coolTime = float.Parse(data[6]); target = (TargetEnum)Enum.Parse(typeof(TargetEnum), data[7]); }
private void RunAssertionTargetCurrentMatch(bool testSoda, TargetEnum target) { var listener = new SupportUpdateListener(); var fields = "a1.id,aarr[0].id,b.id".Split(','); var epl = "select * from pattern " + target.GetText() + "[every a1=A -> [:10] aarr=A until b=B]"; if (testSoda) { var model = _epService.EPAdministrator.CompileEPL(epl); Assert.AreEqual(epl, model.ToEPL()); _epService.EPAdministrator.Create(model).Events += listener.Update; } else { _epService.EPAdministrator.CreateEPL(epl).Events += listener.Update; } SendAEvent("A1"); SendAEvent("A2"); SendBEvent("B1"); if (target == TargetEnum.SUPPRESS_ONLY || target == TargetEnum.DISCARD_AND_SUPPRESS) { EPAssertionUtil.AssertProps( listener.AssertOneGetNewAndReset(), fields, new Object[] { "A1", "A2", "B1" }); } else { EPAssertionUtil.AssertPropsPerRowAnyOrder( listener.GetAndResetLastNewData(), fields, new Object[][] { new Object[] { "A1", "A2", "B1" }, new Object[] { "A2", null, "B1" } }); } _epService.EPAdministrator.DestroyAllStatements(); }
/// <summary> /// Adds an event receiver to the specified target /// </summary> /// <param name="url">The URL.</param> /// <param name="contentTypeName">Name of the content type.</param> /// <param name="target">The target.</param> /// <param name="assembly">The assembly.</param> /// <param name="className">Name of the class.</param> /// <param name="type">The type.</param> /// <param name="sequence">The sequence.</param> /// <param name="name">The name.</param> public static void Add(string url, string contentTypeName, TargetEnum target, string assembly, string className, SPEventReceiverType type, int sequence, string name) { using (SPSite site = new SPSite(url)) using (SPWeb web = site.OpenWeb()) { SPContentType contentType = null; SPEventReceiverDefinitionCollection eventReceivers; if (target == TargetEnum.List) { SPList list = Utilities.GetListFromViewUrl(web, url); if (list == null) { throw new Exception("List not found."); } eventReceivers = list.EventReceivers; } else if (target == TargetEnum.Site) eventReceivers = web.EventReceivers; else { try { contentType = web.AvailableContentTypes[contentTypeName]; } catch (ArgumentException) { } if (contentType == null) throw new SPSyntaxException("The specified content type could not be found."); eventReceivers = contentType.EventReceivers; } SPEventReceiverDefinition def = Add(eventReceivers, type, assembly, className, name); if (sequence >= 0) { def.SequenceNumber = sequence; def.Update(); } if (contentType != null) { try { contentType.Update((contentType.ParentList == null)); } catch (Exception ex) { Exception ex1 = new Exception("An error occured updating the content type. Most likely the content type was updated but changes may not have been pushed down to any children.", ex); Logger.WriteException(new ErrorRecord(ex1, null, ErrorCategory.NotSpecified, contentType)); } } } }
public void InCharactorDetectorRange(Collider collider) { var targetDirection = collider.transform.position - _transform.position; var targetEuler = Vector3.Angle(_transform.forward, targetDirection); //視角内 if (targetEuler <= status.ViewEuler) { //話しかける前 if (!status.IsFind) { //〇ボタン吹き出し if (collider.CompareTag("ButtonRound")) { buttonRoundCanvas.alpha = 1; //親オブジェクトのタグ情報を取得 _targetObject = collider.transform.parent.gameObject; switch (_targetObject.gameObject.tag) { case "Item": _target = TargetEnum.Item; break; case "Guild": _target = TargetEnum.Guild; break; case "Shop": _target = TargetEnum.Shop; break; case "GuildBox": _target = TargetEnum.GuildBox; break; } } } //話しかけた後 else { buttonRoundCanvas.alpha = 0; } } //視角外 else { buttonRoundCanvas.alpha = 0; _target = TargetEnum.None; } }
public AI(GameBoard gb, Settings set) { Set = set; playersBoard = gb; moves = new List <int[]>(); recomended = new List <int[]>(); goodHits = new List <int[]>(); tn = TargetEnum.None; for (int i = 0; i < playersBoard.Size; i++) { for (int j = 0; j < playersBoard.Size; j++) { moves.Add(new[] { i, j }); } } }
private bool UpdateAction(int typeId, int targetId) { TargetProperty targetModel = new TargetProperty(); TargetPropertyManager targetBLL = new TargetPropertyManager(); targetModel = targetBLL.GetModel(typeId, targetId); if (HidMainFlag.Value == string.Empty) { targetModel.MainFlag = null; } else { targetModel.MainFlag = HidMainFlag.Value == "chkMain_0" ? true : false; } targetModel.IsRequired = this.isrequired.Checked;//是否必填 targetModel.PropertyName = txtName.Text; targetModel.PropertyType = Convert.ToInt32(rdoDataType.SelectedValue); if (rdoDataType.Items.FindByValue("9").Selected)//数据类型为多选一 { TargetEnum enumModel = new TargetEnum(); TargetEnumManager enumBLL = new TargetEnumManager(); string temp = HidItem.Value; if (temp.EndsWith("$¥$")) { temp = temp.TrimEnd("$¥$".ToCharArray()); } temp = temp.Replace("$¥$", "$"); string[] enumValues = temp.Split('$'); int id = targetModel.EnumTypeId; enumBLL.Delete(id); enumModel.EnumTypeId = id; for (int i = 0; i < enumValues.Count(); i++) { enumModel.EnumId = i + 1; enumModel.EnumValue = enumValues[i]; enumBLL.Add(enumModel); } } return(targetBLL.Update(targetModel)); }
private void RunAssertionTargetNextMatch(bool testSoda, TargetEnum target) { var fields = "a.id,b.id,c.id".Split(','); var epl = "select * from pattern " + target.GetText() + "[every a=A -> b=B -> c=C(pc=a.pa)]"; if (testSoda) { var model = _epService.EPAdministrator.CompileEPL(epl); Assert.AreEqual(epl, model.ToEPL()); _epService.EPAdministrator.Create(model).Events += _listener.Update; } else { _epService.EPAdministrator.CreateEPL(epl).Events += _listener.Update; } SendAEvent("A1", "x"); SendAEvent("A2", "y"); SendBEvent("B1"); SendCEvent("C1", "y"); EPAssertionUtil.AssertProps( _listener.AssertOneGetNewAndReset(), fields, new Object[] { "A2", "B1", "C1" }); SendCEvent("C2", "x"); if (target == TargetEnum.SUPPRESS_ONLY || target == TargetEnum.NONE) { EPAssertionUtil.AssertProps( _listener.AssertOneGetNewAndReset(), fields, new Object[] { "A1", "B1", "C2" }); } else { Assert.IsFalse(_listener.IsInvoked); } _epService.EPAdministrator.DestroyAllStatements(); }
public static string GetText(this TargetEnum value) { switch (value) { case TargetEnum.DISCARD_ONLY: return("@DiscardPartialsOnMatch "); case TargetEnum.DISCARD_AND_SUPPRESS: return("@DiscardPartialsOnMatch @SuppressOverlappingMatches "); case TargetEnum.SUPPRESS_ONLY: return("@SuppressOverlappingMatches "); case TargetEnum.NONE: return(""); } throw new ArgumentException(); }
public LinkEventArgs(string link, string href, string text, TargetEnum target) { _link = link; _href = href; _text = text; _target = target; if (target == TargetEnum.External) { _cssclass = "externallink"; } else if (target == TargetEnum.InterWiki) { _cssclass = "interwikilink"; } else { _cssclass = "internallink"; } }
internal static string GetText(TargetEnum targetEnum) { switch (targetEnum) { case TargetEnum.DISCARD_ONLY: return "@DiscardPartialsOnMatch "; case TargetEnum.DISCARD_AND_SUPPRESS: return "@DiscardPartialsOnMatch @SuppressOverlappingMatches "; case TargetEnum.SUPPRESS_ONLY: return "@SuppressOverlappingMatches "; case TargetEnum.NONE: return ""; default: throw new ArgumentException(nameof(targetEnum)); } }
/// <summary> /// Initializes a new instance of the <see cref="InputCurrencyFormat" /> class. /// </summary> /// <param name="input">Amount to format (required).</param> /// <param name="target">target (required).</param> public InputCurrencyFormat(decimal input = default(decimal), TargetEnum target = default(TargetEnum)) { // to ensure "input" is required (not null) if (input == null) { throw new InvalidDataException("input is a required property for InputCurrencyFormat and cannot be null"); } else { this.Input = input; } // to ensure "target" is required (not null) if (target == null) { throw new InvalidDataException("target is a required property for InputCurrencyFormat and cannot be null"); } else { this.Target = target; } }
public override System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> ReadFields(System.IO.BinaryReader binaryReader) { System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> pointerQueue = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(base.ReadFields(binaryReader)); pointerQueue.Enqueue(binaryReader.ReadBlamPointer(1)); this.LayerPassIndex = binaryReader.ReadInt16(); this.fieldpad = binaryReader.ReadBytes(2); this.Primary0AndSecondary0 = binaryReader.ReadByte(); this.Primary0AndSecondary00 = binaryReader.ReadByte(); this.Primary0AndSecondary01 = binaryReader.ReadByte(); this.Primary0AndSecondary02 = binaryReader.ReadByte(); this.fieldpad0 = binaryReader.ReadBytes(64); this.Stage0Mode = ((Stage0ModeEnum)(binaryReader.ReadInt16())); this.Stage1Mode = ((Stage1ModeEnum)(binaryReader.ReadInt16())); this.Stage2Mode = ((Stage2ModeEnum)(binaryReader.ReadInt16())); this.Stage3Mode = ((Stage3ModeEnum)(binaryReader.ReadInt16())); pointerQueue.Enqueue(binaryReader.ReadBlamPointer(72)); this.Target = ((TargetEnum)(binaryReader.ReadInt16())); this.fieldpad1 = binaryReader.ReadBytes(2); this.fieldpad2 = binaryReader.ReadBytes(64); pointerQueue.Enqueue(binaryReader.ReadBlamPointer(92)); return(pointerQueue); }
/// <summary> /// Initializes a new instance of the <see cref="InputCurrencyConversion" /> class. /// </summary> /// <param name="input">Amount to convert (required).</param> /// <param name="source">source (required) (default to SourceEnum.USD).</param> /// <param name="target">target (required).</param> public InputCurrencyConversion(decimal input = default(decimal), SourceEnum source = SourceEnum.USD, TargetEnum target = default(TargetEnum)) { this.Input = input; this.Source = source; this.Target = target; }
public void Test_EnumAdapter_WithValidEnumValue() { TargetEnum TargetEnumValue = EnumAdapter.GetEnumValue <TargetEnum>(SourceEnum.VS2005); Assert.AreEqual(TargetEnum.VS2005, TargetEnumValue); }
public void Test_EnumAdapter_WithInvalidEnumValue() { TargetEnum TargetEnumValue = EnumAdapter.GetEnumValue <TargetEnum>(SourceEnum.Office2007); }
public HttpConverterAttribute(TargetEnum target) { Target = target; }
/// <summary> /// Initializes a new instance of the <see cref="InputConvertTemperature" /> class. /// </summary> /// <param name="input">input (required).</param> /// <param name="source">source (required).</param> /// <param name="target">target (required).</param> public InputConvertTemperature(decimal input = default(decimal), SourceEnum source = default(SourceEnum), TargetEnum target = default(TargetEnum)) { this.Input = input; this.Source = source; this.Target = target; }
public HttpConverterAttribute(TargetEnum target, string name) { Target = target; Name = name; }