public FFilter() { InvokeMethod = new InvokeMethod(typeof(FilterController), new Dictionary <TypeExecute, string>() { { TypeExecute.InsertOrUpdate, "Save" }, { TypeExecute.Remove, "RemoveId" }, { TypeExecute.FindId, "FindId" }, { TypeExecute.Search, "Search" }, { TypeExecute.SearchAll, "ListFilter" } }, typeof(Filter)); ObjectControl = new List <Filter>(); InitializeComponent(); QueryId.ObjetoApp = new InvokeMethod(typeof(QueryController), TypeExecute.SearchAll, "ListQuery", typeof(Query)); QueryId.DisplayMember = "Code"; QueryId.ValueMember = "Id"; QueryId.FormType = typeof(FQuery); TypeComponent.SetEnumItems <TypeFilterComponent>(TypeFilterComponent.TextBox); DefaultTypeFilter.SetEnumItems <TypeFilter>(TypeFilter.Equal); InactiveFilters.ObjetoApp = new InvokeMethod(typeof(InactiveFiltersController), TypeExecute.Search, "InactiveFiltersSearch", typeof(InactiveFilters)); InactiveFilters.ScreenSecondary = true; InactiveFilters.IsDependecyUkey = true; InactiveFilters.FormType = typeof(FInactiveFilters); ImageSource = Properties.Resources.icon_filter; }
public FPermission() { Module = "Painel de Controle"; ObjectControl = new List <Permission>(); InvokeMethod = new InvokeMethod(typeof(PermissionController), new Dictionary <TypeExecute, string>() { { TypeExecute.InsertOrUpdate, "Save" }, { TypeExecute.Remove, "RemoveId" }, { TypeExecute.FindId, "FindId" }, { TypeExecute.Search, "Search" }, { TypeExecute.SearchAll, "ListPermission" } }, typeof(Permission)); InitializeComponent(); TypeComponent.SetEnumItems <TypeComponent>(Core.Domain.EnumBase.TypeComponent.Screen); }
public static ComponentList GetAllComponents(this HtmlDocument html, TypeComponent component) { ComponentList components = new ComponentList(); switch (component) { case TypeComponent.InputText: components.InputTexts = html.ParseInputText(); return(components); case TypeComponent.InputCheckbox: components.InputCheckBoxes = html.ParseCheckbox(); return(components); case TypeComponent.InputHidden: components.InputHidden = html.ParseInputHiddenText(); return(components); case TypeComponent.ComboBox: components.ComboBoxes = html.ParseCombo(); return(components); case TypeComponent.DataGrid: components.Grids = html.ParseGrid(); return(components); case TypeComponent.LinkButton: components.LinkButtons = html.ParseLink(); return(components); case TypeComponent.Image: components.Images = html.ParseImage(); return(components); default: return(null); } }
public void UpdateSystem() { //création des cercles if (!isInit) { Camera cam = Camera.main; Vector3 transfo = cam.ScreenToWorldPoint(new Vector3(Screen.width, Screen.height, 0)); float width = transfo.x; float height = transfo.y; foreach (Config.ShapeConfig config in manager.Config.allShapesToSpawn) { manager.CreateShape(compteur, config); manager.UpdateShapePosition(compteur, config.initialPos); SpeedComponent spdComponent = new SpeedComponent(); spdComponent.id = compteur; spdComponent.speed = config.initialSpeed; TypeComponent typeComponent = new TypeComponent(); typeComponent.isStatic = false; if (compteur <= manager.Config.allShapesToSpawn.Count / 4) { typeComponent.isStatic = true; spdComponent.speed = new Vector2(0f, 0f); } world.SpeedComponents.Add(spdComponent); world.TypeComponents.Add(typeComponent); SizeComponent sizeComponent = new SizeComponent(); sizeComponent.id = compteur; sizeComponent.size = config.size; world.SizeComponents.Add(sizeComponent); InitialSizeComponent initSizeComponent = new InitialSizeComponent(); initSizeComponent.id = compteur; initSizeComponent.size = config.size; world.InitialSizeComponents.Add(initSizeComponent); PositionComponent posComponent = new PositionComponent(); posComponent.id = compteur; posComponent.pos = config.initialPos; /* prendre en compte le cas où : * cercle dépasse en haut * cercle dépasse en bas * cercle dépasse à droite * cercle dépasse à gauche * */ if (posComponent.pos.y + (config.size / 2f) > height) //en haut { posComponent.pos.y = height - (config.size / 2f); } if (posComponent.pos.y - (config.size / 2f) < -height) //en bas { posComponent.pos.y = -height + (config.size / 2f); } if (posComponent.pos.x + (config.size / 2f) > width) //à droite { posComponent.pos.x = width - (config.size / 2f); } if (posComponent.pos.x - (config.size / 2f) < -width) //à gauche { posComponent.pos.x = -width + (config.size / 2f); } world.PositionComponents.Add(posComponent); ColorComponent colComponent = new ColorComponent(); colComponent.id = compteur; if (typeComponent.isStatic == true) { colComponent.color = UnityEngine.Color.red; manager.UpdateShapeColor(compteur, UnityEngine.Color.red); } else if (sizeComponent.size < manager.Config.minSize) { colComponent.color = UnityEngine.Color.green; manager.UpdateShapeColor(compteur, UnityEngine.Color.green); } else { colComponent.color = UnityEngine.Color.blue; manager.UpdateShapeColor(compteur, UnityEngine.Color.blue); } world.ColorComponents.Add(colComponent); PastPositionsComponent ppc = new PastPositionsComponent(); PastSpeedsComponent pspc = new PastSpeedsComponent(); PastSizesComponent psic = new PastSizesComponent(); PastColorsComponent pcc = new PastColorsComponent(); ppc.id = compteur; pspc.id = compteur; psic.id = compteur; pcc.id = compteur; ppc.timestamps = new Queue <float>(); pspc.timestamps = new Queue <float>(); psic.timestamps = new Queue <float>();; pcc.timestamps = new Queue <float>(); ppc.pos = new Queue <Vector2>(); pspc.speeds = new Queue <Vector2>(); psic.sizes = new Queue <float>(); pcc.colors = new Queue <UnityEngine.Color>(); world.PastPositionsComponents.Add(ppc); world.PastSpeedsComponents.Add(pspc); world.PastSizesComponents.Add(psic); world.PastColorsComponents.Add(pcc); compteur++; } isInit = true; //Debug.Log("Compteur " + compteur); } }
public static ComponentList GetAllComponents(this HtmlNode html, TypeComponent component) { HtmlAgilityPack.HtmlDocument doc = new HtmlDocument(); doc.LoadHtml(html.OuterHtml); return(GetAllComponents(doc, component)); }
protected override void OnUpdate() { var commandBuffer = new EntityCommandBuffer(Allocator.TempJob); var chunks = sectorGroup.CreateArchetypeChunkArray(Allocator.TempJob); var entityType = GetArchetypeChunkEntityType(); var startCellType = GetArchetypeChunkComponentType <WorleyNoise.CellData>(true); var pointArrayType = GetArchetypeChunkBufferType <WorleyNoise.PointData>(true); var sectorCellType = GetArchetypeChunkBufferType <CellSystem.SectorCell>(true); var adjacentCellType = GetArchetypeChunkBufferType <CellSystem.AdjacentCell>(true); for (int c = 0; c < chunks.Length; c++) { var chunk = chunks[c]; var entities = chunk.GetNativeArray(entityType); var startCells = chunk.GetNativeArray(startCellType); var pointArrays = chunk.GetBufferAccessor(pointArrayType); var sectorCellArrays = chunk.GetBufferAccessor(sectorCellType); var adjacentCellArrays = chunk.GetBufferAccessor(adjacentCellType); for (int e = 0; e < entities.Length; e++) { Entity sectorEntity = entities[e]; WorleyNoise.CellData startCell = startCells[e]; DynamicBuffer <WorleyNoise.PointData> points = pointArrays[e]; DynamicBuffer <CellSystem.SectorCell> sectorCells = sectorCellArrays[e]; DynamicBuffer <CellSystem.AdjacentCell> adjacentCells = adjacentCellArrays[e]; WorleyNoise.CellData masterCell = cellSystem.GetCellData(sectorCells[0].index); float grouping = cellSystem.GetCellGrouping(startCell.index); bool pathable = SectorIsPathable(points, grouping); int height = (int)cellSystem.GetCellHeight(masterCell.index); TypeComponent type = new TypeComponent(); if (!pathable) { if (AllAdjacentAreHigher(adjacentCells, topologyUtil.CellHeightGroup(masterCell.index))) { type.Value = SectorTypes.GULLY; } else { type.Value = SectorTypes.MOUNTAIN; } } else if (topologyUtil.CellHeightGroup(masterCell.index) < 2 && sectorCells.Length > 2) { type.Value = SectorTypes.LAKE; commandBuffer.AddComponent <Tags.CreateWaterEntity>(sectorEntity, new Tags.CreateWaterEntity()); } commandBuffer.AddComponent <TypeComponent>(sectorEntity, type); commandBuffer.RemoveComponent <WorleyNoise.CellData>(sectorEntity); commandBuffer.AddComponent <MasterCell>(sectorEntity, new MasterCell { Value = masterCell }); } } commandBuffer.Playback(entityManager); commandBuffer.Dispose(); chunks.Dispose(); }
public HttpRequestFluent TryGetComponents(TypeComponent TypeComponent) { request.TypeComponent = TypeComponent; return(this); }
public override void OnAddedToEntity() { #region Load up texture atlas... //Load up character texture atlas var idleTexture = Entity.Scene.Content.Load <Texture2D>(Content.Textures.HeroIdle); var runTexture = Entity.Scene.Content.Load <Texture2D>(Content.Textures.HeroRun); var attackTexture = Entity.Scene.Content.Load <Texture2D>(Content.Textures.HeroAttack); var jumpTexture = Entity.Scene.Content.Load <Texture2D>(Content.Textures.HeroJump); var fallTexture = Entity.Scene.Content.Load <Texture2D>(Content.Textures.HeroFall); var idleSprite = Sprite.SpritesFromAtlas(idleTexture, 50, 37); var runSprite = Sprite.SpritesFromAtlas(runTexture, 50, 37); var attackSprite = Sprite.SpritesFromAtlas(attackTexture, 50, 37); var jumpSprite = Sprite.SpritesFromAtlas(jumpTexture, 50, 37); var fallSprite = Sprite.SpritesFromAtlas(fallTexture, 50, 37); #endregion Load up texture atlas... #region add componentents... //Movement component var map = Entity.Scene as SandBoxScene; Mover = Entity.AddComponent(new TiledMapMover(map.TiledMap.GetLayer <TmxLayer>("main"))); //animator component Animator = Entity.AddComponent <SpriteAnimator>(); //Set up collider Collider = Entity.AddComponent <BoxCollider>(); Collider.Width = 16; Collider.Height = 30; Collider.SetLocalOffset(new Vector2(0, 3)); Flags.SetFlagExclusive(ref Collider.CollidesWithLayers, 1); Flags.SetFlagExclusive(ref Collider.PhysicsLayer, 1); //CollisionListener CollisionListener = Entity.AddComponent <CollisionListener>(); //SetType Type = Entity.AddComponent <TypeComponent>(); Type.SetType(EntityType.PLAYER); //Set up StateMachine StateMachine = Entity.AddComponent(new StateMachine()); StateMachine.AddState(STATES.PLAYER_FREE, new PlayerPlatformerStateFree(this)); StateMachine.AddState(STATES.PLAYER_ATTACK, new PlayerStateAttack(this)); StateMachine.CurrentState = STATES.PLAYER_FREE; //Set up Camera var camera = new FollowCamera(Entity); camera.MapLockEnabled = true; Entity.AddComponent(camera); var renderer = new DefaultRenderer(camera: camera.Camera); Entity.Scene.AddRenderer(renderer); //camera.Camera.Position = Entity.Transform.Position; camera.MapSize = new Vector2(1280, 0); camera.FollowLerp = .3f; #endregion add componentents... #region Animations... Animator.AddAnimation("IdleSheathed", 3.5f, new[] { idleSprite[0], idleSprite[1], idleSprite[2], idleSprite[3] }); Animator.AddAnimation("IdleUnSheathed", 3.5f, new[] { idleSprite[4], idleSprite[5], idleSprite[6], idleSprite[7] }); Animator.AddAnimation("RunSheathed", 7.5f, new[] { runSprite[0], runSprite[1], runSprite[2], runSprite[3], runSprite[4], runSprite[5] }); Animator.AddAnimation("RunUnSheathed", 7.5f, new[] { runSprite[6], runSprite[7], runSprite[8], runSprite[9], runSprite[10], runSprite[11] }); Animator.AddAnimation("Attack0", 12, new[] { attackSprite[0], attackSprite[1], attackSprite[2], attackSprite[3], attackSprite[4], attackSprite[5], }); Animator.AddAnimation("Attack1", 12, new[] { attackSprite[6], attackSprite[7], attackSprite[8], attackSprite[9], attackSprite[10] }); Animator.AddAnimation("Attack2", 12, new[] { attackSprite[11], attackSprite[12], attackSprite[13], attackSprite[14], attackSprite[15], attackSprite[16] }); Animator.AddAnimation("Jump", 15, new[] { //jumpSprite[0], //jumpSprite[1], jumpSprite[2], jumpSprite[3] }); Animator.AddAnimation("Fall", 8, new[] { fallSprite[0], fallSprite[1] }); #endregion Animations... //Set up Input SetupInput(); base.OnAddedToEntity(); }
public Component(string name, TypeComponent typeComponent) { this.Name = name; this.TypeComponent = typeComponent; }