private static JavaScriptValue ShouldDeprioritizeSubtree( JavaScriptValue callee, bool isconstructcall, JavaScriptValue[] arguments, ushort argumentcount, IntPtr callbackdata) { if (!arguments.ValidateWithType(1, nameof(ShouldDeprioritizeSubtree), JavaScriptValueType.String)) { return(JavaScriptValue.Undefined); } if (!arguments.ValidateWithType(2, nameof(ShouldDeprioritizeSubtree), JavaScriptValueType.Object)) { return(JavaScriptValue.Undefined); } try { var type = arguments[1].ToString(); var props = ComponentMapper.CreateProps(type, arguments[2]); var result = ShouldDeprioritizeSubtree(type, props); return(JavaScriptValue.FromBoolean(result)); } catch (Exception ex) { Debug.LogError(ex); return(JavaScriptValue.Undefined); } }
/// <summary> /// Adds a bootstrap providers and component mappings. /// </summary> /// <param name="serviceCollection"></param> /// <returns></returns> public static IServiceCollection AddBootstrapProviders(this IServiceCollection serviceCollection) { serviceCollection.AddSingleton <IClassProvider, BootstrapClassProvider>(); serviceCollection.AddSingleton <IStyleProvider, BootstrapStyleProvider>(); serviceCollection.AddSingleton <IJSRunner, JSRunner>(); var componentMapper = new ComponentMapper(); componentMapper.Register <Blazorise.Addon, Bootstrap.Addon>(); //componentMapper.Register<Blazorise.Addons, Bootstrap.Addons>(); componentMapper.Register <Blazorise.BarToggler, Bootstrap.BarToggler>(); componentMapper.Register <Blazorise.CardSubtitle, Bootstrap.CardSubtitle>(); componentMapper.Register <Blazorise.CloseButton, Bootstrap.CloseButton>(); componentMapper.Register <Blazorise.CheckEdit, Bootstrap.CheckEdit>(); //componentMapper.Register<Blazorise.DateEdit, Bootstrap.DateEdit>(); componentMapper.Register <Blazorise.Field, Bootstrap.Field>(); componentMapper.Register <Blazorise.FieldBody, Bootstrap.FieldBody>(); componentMapper.Register <Blazorise.FileEdit, Bootstrap.FileEdit>(); componentMapper.Register <Blazorise.ModalContent, Bootstrap.ModalContent>(); //componentMapper.Register<Blazorise.MemoEdit, Bootstrap.MemoEdit>(); //componentMapper.Register<Blazorise.SelectEdit, Bootstrap.SelectEdit>(); componentMapper.Register <Blazorise.SimpleButton, Bootstrap.SimpleButton>(); //componentMapper.Register<Blazorise.TextEdit, Bootstrap.TextEdit>(); serviceCollection.AddSingleton <IComponentMapper>(componentMapper); return(serviceCollection); }
public override void Initialize(IComponentMapperService mapperService) { _unitMapper = mapperService.GetMapper <Unit>(); _productionUnitMapper = mapperService.GetMapper <ProductionUnit>(); _tilePositionMapper = mapperService.GetMapper <TilePosition>(); _mineableResourceMapper = mapperService.GetMapper <MineableResource>(); }
public override void Initialize(IComponentMapperService mapperService) { _playerMapper = mapperService.GetMapper <Player>(); _spriteMapper = mapperService.GetMapper <AnimatedSprite>(); _transformMapper = mapperService.GetMapper <Transform2>(); _bodyMapper = mapperService.GetMapper <Body>(); }
public override void Initialize(IComponentMapperService mapperService) { _animationMapper = mapperService.GetMapper <Animator>(); _backgroundMapper = mapperService.GetMapper <Background>(); _gameObjectMapper = mapperService.GetMapper <GameObject>(); _renderMapper = mapperService.GetMapper <Renderer>(); }
//private Bag<Bag<IBaseElement>> GetElements() //{ // var elements = new Bag<Bag<IBaseElement>>(); // foreach (int entityId in ActiveEntities) // { // var elementBag = new Bag<IBaseElement>(); // if (_boxMapper.Has(entityId)) // elementBag.Add(_boxMapper.Get(entityId)); // if (_labelMapper.Has(entityId)) // elementBag.Add(_labelMapper.Get(entityId)); // elements[entityId] = elementBag; // } // return elements; //} public override void Initialize(IComponentMapperService componentManager) { _guiStyleMapper = componentManager.GetMapper <GUIStyle>(); _transform2DMapper = componentManager.GetMapper <Transform2D>(); _labelMapper = componentManager.GetMapper <Label>(); _boxMapper = componentManager.GetMapper <Box>(); }
public override void Initialize(IComponentMapperService mapperService) { _tilePositionMapper = mapperService.GetMapper <TilePosition>(); _spriteMapper = mapperService.GetMapper <Sprite>(); _tileBorderMapper = mapperService.GetMapper <TileBorder>(); _tileRenderLayerMapper = mapperService.GetMapper <TileRenderLayer>(); }
public void CreateComponentMapper() { var mapper = new ComponentMapper <object>(0, _ => {}); Assert.Equal(typeof(object), mapper.ComponentType); Assert.Empty(mapper.Components); }
protected override void added(Entity entity) { UserInterface ui = ComponentMapper.get <UserInterface> (entity); ui.init(); ui.load(this._content_manager); }
/// <summary> /// Initializes the animation system. /// </summary> public override void Initialize() { _animationMapper = new ComponentMapper<AnimationComponent>(World); _imageMapper = new ComponentMapper<ImageComponent>(World); base.Initialize(); }
public override void Initialize(IComponentMapperService mapperService) { _transforMapper = mapperService.GetMapper <Transform2>(); _spriteMapper = mapperService.GetMapper <Sprite>(); _textMapper = mapperService.GetMapper <Text>(); _animatedSpriteMapper = mapperService.GetMapper <AnimatedSprite>(); }
public override void Initialize() { this.spriteBatch = EntitySystem.BlackBoard.GetEntry<SpriteBatch>("SpriteBatch"); this.font = EntitySystem.BlackBoard.GetEntry<SpriteFont>("SpriteFont"); healthMapper = new ComponentMapper<Health>(world); transformMapper = new ComponentMapper<Transform>(world); }
protected override void initialize() { _DamageMapper = new ComponentMapper(new Damage(), ecs_instance); _HealthMapper = new ComponentMapper(new Health(), ecs_instance); _AttributeMapper = new ComponentMapper(new Statistics(), ecs_instance); _InteractMapper = new ComponentMapper(new Interactable(), ecs_instance); }
public override void Initialize() { m_transformMapper = new ComponentMapper<Transform>(world); m_tilemapMapper = new ComponentMapper<Tilemap>(world); m_tilemapRenderMapper = new ComponentMapper<TilemapRender>(world); m_toolSys = (CurrentToolSystem)(world.SystemManager.GetSystem<CurrentToolSystem>()[0]); }
public override void Initialize(IComponentMapperService mapperService) { _player = mapperService.GetMapper <PlayerControllerComponent>(); _transform = mapperService.GetMapper <TransformComponent>(); _rigidBody = mapperService.GetMapper <RigidBody>(); Logger.WriteLine(WarningLevel.Urgent, "PlayerControllerSystem Initialize Method Not Implemented Yet"); }
public override void Initialize(IComponentMapperService mapperService) { transformMapper = mapperService.GetMapper <Transform2>(); spriteMapper = mapperService.GetMapper <Sprite>(); textMapper = mapperService.GetMapper <Text>(); mgTextMapper = mapperService.GetMapper <MGStylizedText>(); }
protected override void initialize() { _CharacterMapper = new ComponentMapper(new Character(), ecs_instance); _PositionMapper = new ComponentMapper(new Position(), ecs_instance); _ViewportMapper = new ComponentMapper(new ViewPort(), ecs_instance); _LifeMapper = new ComponentMapper(new Life(), ecs_instance); }
public override void Initialize(IComponentMapperService componentService) { _renderFormMapper = componentService.GetMapper <RenderFormComponent>(); _transform2DMapper = componentService.GetMapper <Transform2D>(); _rendererMapper = componentService.GetMapper <Renderer>(); _animatedSpriteMapper = componentService.GetMapper <AnimatedSprite>(); }
/// <summary> /// Initializes the control system. /// </summary> public override void Initialize() { _positionMapper = new ComponentMapper <PositionComponent>(World); _controlMapper = new ComponentMapper <ControlComponent>(World); base.Initialize(); }
/// <summary> /// Initializes the render system. /// </summary> public override void Initialize() { _imageMapper = new ComponentMapper <ImageComponent>(World); _positionMapper = new ComponentMapper <PositionComponent>(World); base.Initialize(); }
public override void Initialize(IComponentMapperService mapperService) { _transformMapper = mapperService.GetMapper <Transform2>(); _spriteMapper = mapperService.GetMapper <Sprite>(); _hexMapper = mapperService.GetMapper <Hex>(); var size = Math.Max(_grassTexture.Width, _grassTexture.Height) / 2; size -= 1; foreach (var x in Enumerable.Range(-GRID_SIZE, GRID_SIZE * 2 + 1)) { foreach (var y in Enumerable.Range(-GRID_SIZE, GRID_SIZE * 2 + 1)) { foreach (var z in Enumerable.Range(-GRID_SIZE, GRID_SIZE * 2 + 1)) { if (x + y + z == 0) { var hex = Hex.FromCubic(new Vector3(x, y, z), size); var entity = CreateEntity(); entity.Attach(hex); entity.Attach(new Sprite(_grassTexture)); entity.Attach(new Transform2(hex.ToPixel())); } } } } }
public static IServiceCollection AddBulmaProviders(this IServiceCollection serviceCollection) { serviceCollection.AddSingleton <IClassProvider, BulmaClassProvider>(); serviceCollection.AddSingleton <IStyleProvider, BulmaStyleProvider>(); serviceCollection.AddSingleton <IJSRunner, JSRunner>(); var componentMapper = new ComponentMapper(); componentMapper.Register <Blazorise.Addons, Bulma.Addons>(); componentMapper.Register <Blazorise.BarToggler, Bulma.BarToggler>(); componentMapper.Register <Blazorise.Breadcrumb, Bulma.Breadcrumb>(); componentMapper.Register <Blazorise.BreadcrumbLink, Bulma.BreadcrumbLink>(); componentMapper.Register <Blazorise.CardImage, Bulma.CardImage>(); componentMapper.Register <Blazorise.CardSubtitle, Bulma.CardSubtitle>(); componentMapper.Register <Blazorise.CheckEdit, Bulma.CheckEdit>(); componentMapper.Register <Blazorise.DateEdit, Bulma.DateEdit>(); componentMapper.Register <Blazorise.DropdownDivider, Bulma.DropdownDivider>(); componentMapper.Register <Blazorise.DropdownMenu, Bulma.DropdownMenu>(); componentMapper.Register <Blazorise.DropdownToggle, Bulma.DropdownToggle>(); componentMapper.Register <Blazorise.Field, Bulma.Field>(); componentMapper.Register <Blazorise.FieldLabel, Bulma.FieldLabel>(); componentMapper.Register <Blazorise.FieldHelp, Bulma.FieldHelp>(); componentMapper.Register <Blazorise.FieldBody, Bulma.FieldBody>(); componentMapper.Register <Blazorise.Fields, Bulma.Fields>(); componentMapper.Register <Blazorise.FileEdit, Bulma.FileEdit>(); componentMapper.Register <Blazorise.MemoEdit, Bulma.MemoEdit>(); componentMapper.Register <Blazorise.SelectEdit, Bulma.SelectEdit>(); componentMapper.Register <Blazorise.SimpleButton, Bulma.SimpleButton>(); componentMapper.Register <Blazorise.Tabs, Bulma.Tabs>(); componentMapper.Register <Blazorise.TextEdit, Bulma.TextEdit>(); serviceCollection.AddSingleton <IComponentMapper>(componentMapper); return(serviceCollection); }
public override void Initialize() { base.Initialize(); _positionMapper = new ComponentMapper<PositionComponent>(World); _entitySelector = entity => _positionMapper.Has(entity); }
private static float getStat(Entity entity, StatType stat) { Statistics stats = ComponentMapper.get <Statistics> (entity); switch (stat) { case StatType.ENDURANCE: return(stats.Endurance.Value); case StatType.FOCUS: return(stats.Focus.Value); case StatType.MIND: return(stats.Mind.Value); case StatType.MUSCLE: return(stats.Muscle.Value); case StatType.PERCEPTION: return(stats.Perception.Value); case StatType.PERSONALITY: return(stats.Personality.Value); case StatType.QUICKNESS: return(stats.Quickness.Value); default: return(default(Statistic).Value); } }
protected override void initialize() { h_HealthMapper = new ComponentMapper(new Health(), ecs_instance); h_LifeMapper = new ComponentMapper(new Life(), ecs_instance); h_AggroMapper = new ComponentMapper(new Aggrivation(), ecs_instance); h_InteractionMapper = new ComponentMapper(new Interactable(), ecs_instance); }
public override void Initialize(IComponentMapperService mapperService) { playerMapper = mapperService.GetMapper <PlayerState>(); acceleratorMapper = mapperService.GetMapper <Accelerator>(); movableMapper = mapperService.GetMapper <Movable>(); playerInputMapper = mapperService.GetMapper <PlayerInput>(); }
protected override void initialize() { _DamageMapper = new ComponentMapper(new Damage(), ecs_instance); _PositionMapper = new ComponentMapper(new Position(), ecs_instance); _ViewPortMapper = new ComponentMapper(new ViewPort(), ecs_instance); _FloatMapper = new ComponentMapper(new FloatingText(), ecs_instance); }
/// <summary> /// Initializes the control system. /// </summary> public override void Initialize() { _positionMapper = new ComponentMapper<PositionComponent>(World); _controlMapper = new ComponentMapper<ControlComponent>(World); base.Initialize(); }
public override void Initialize(IComponentMapperService mapperService) { _productionUnitMapper = mapperService.GetMapper <ProductionUnit>(); _tilePositionMapper = mapperService.GetMapper <TilePosition>(); _blockableMapper = mapperService.GetMapper <Blockable>(); _productMapper = mapperService.GetMapper <Product>(); _alignableMapper = mapperService.GetMapper <Alignable>(); }
protected override void initialize() { base.initialize(); l_LightMapper = new ComponentMapper(new Light(), ecs_instance); l_PosMapper = new ComponentMapper(new Position(), ecs_instance); l_GameMapMapper = new ComponentMapper(new GameMap(), ecs_instance); }
public override void Initialize(IComponentMapperService mapperService) { _placeableMapper = mapperService.GetMapper <Placeable>(); _tilePositionMapper = mapperService.GetMapper <TilePosition>(); _tileBorderMapper = mapperService.GetMapper <TileBorder>(); _unitMapper = mapperService.GetMapper <Unit>(); _alignableMapper = mapperService.GetMapper <Alignable>(); }
public static VisualElement CreateInstance(string type, IComponentProps props, VisualElement rootContainer) { var component = ComponentMapper.CreateComponent(type); ComponentMapper.ApplyProps(type, component, props); return(component); }
public override void Initialize(IComponentMapperService mapperService) { playerMapper = mapperService.GetMapper <Player>(); enemyMapper = mapperService.GetMapper <Enemy>(); transforMapper = mapperService.GetMapper <Transform2>(); animatedSpriteMapper = mapperService.GetMapper <AnimatedSprite>(); spriteMapper = mapperService.GetMapper <Sprite>(); }
public override void Initialize(IComponentMapperService mapperService) { transformMapper = mapperService.GetMapper <Transform2>(); movableMapper = mapperService.GetMapper <Movable>(); bodyMapper = mapperService.GetMapper <CollisionBody>(); levelMapper = mapperService.GetMapper <Level>(); playerStateMapper = mapperService.GetMapper <PlayerState>(); }
public override void Initialize() { this.device = EntitySystem.BlackBoard.GetEntry<GraphicsDevice>("GraphicsDevice"); this.spriteBatch = EntitySystem.BlackBoard.GetEntry<SpriteBatch>("SpriteBatch"); this.contentManager = EntitySystem.BlackBoard.GetEntry<ContentManager>("ContentManager"); spatialFormMapper = new ComponentMapper<SpatialForm>(world); transformMapper = new ComponentMapper<Transform>(world); }
public override void Initialize(IComponentMapperService mapperService) { playerMapper = mapperService.GetMapper <Player>(); spriteMapper = mapperService.GetMapper <AnimatedSprite>(); transformMapper = mapperService.GetMapper <Transform2>(); bodyMapper = mapperService.GetMapper <Body>(); healthMapper = mapperService.GetMapper <Health>(); }
public MoveAction(float expiration, int priority, Entity entity, Vector2 goal) : base(expiration, priority) { _entity = entity; _goal = goal; ComponentMapper<PositionComponent> positionMapper = new ComponentMapper<PositionComponent>(Director.SharedDirector.EntityWorld); _position = positionMapper.Get(entity); ComponentMapper<VelocityComponent> velocityMapper = new ComponentMapper<VelocityComponent>(Director.SharedDirector.EntityWorld); _velocity = velocityMapper.Get(entity); }
/// <summary>Override to implement code that gets executed when systems are initialized.</summary> public override void LoadContent() { this.spriteBatch = BlackBoard.GetEntry<SpriteBatch>("SpriteBatch"); this.font = BlackBoard.GetEntry<SpriteFont>("SpriteFont"); this.healthMapper = new ComponentMapper<HealthComponent>(this.EntityWorld); this.transformMapper = new ComponentMapper<TransformComponent>(this.EntityWorld); }
public override void Initialize() { expiresMapper = new ComponentMapper<Expires>(world); }
public override void Initialize() { weaponMapper = new ComponentMapper<Weapon>(world); transformMapper = new ComponentMapper<Transform>(world); }
/// <summary>Override to implement code that gets executed when systems are initialized.</summary> public override void LoadContent() { this.weaponMapper = new ComponentMapper<WeaponComponent>(this.EntityWorld); this.transformMapper = new ComponentMapper<TransformComponent>(this.EntityWorld); }
public override void Initialize() { invMapper = new ComponentMapper<Inventory>(world); transformMapper = new ComponentMapper<ITransform>(world); }
public override void Initialize() { this.spriteBatch = EntitySystem.BlackBoard.GetEntry<SpriteBatch>("SpriteBatch"); transformMapper = new ComponentMapper<Transform>(world); oldState = Keyboard.GetState(); }
public override void Initialize() { transformMapper = new ComponentMapper<Transform>(world); oldState = Keyboard.GetState(); }
public void TestDerivedComponents() { EntityWorld entityWorld = new EntityWorld(); TestDerivedComponent derived = new TestDerivedComponent(); Entity entity = entityWorld.CreateEntity(); entity.AddComponent(derived); Assert.IsNull(entity.GetComponent<TestDerivedComponent>(), "Should be null because the component should be added as if it was a base component"); Assert.IsNotNull(entity.GetComponent<TestBaseComponent>()); Assert.IsTrue(entity.GetComponent<TestBaseComponent>().IsDerived()); #pragma warning disable 612,618 ComponentMapper<TestBaseComponent> baseMapper = new ComponentMapper<TestBaseComponent>(entityWorld); ComponentMapper<TestDerivedComponent> derivedMapper = new ComponentMapper<TestDerivedComponent>(entityWorld); #pragma warning restore 612,618 Assert.IsNull(derivedMapper.Get(entity)); Assert.IsNotNull(baseMapper.Get(entity)); Assert.AreEqual(baseMapper.Get(entity), entity.GetComponent<TestBaseComponent>()); }
public override void Initialize() { m_inputMapper = new ComponentMapper<InputDelta>(world); }
public override void Initialize() { particleMapper = new ComponentMapper<Particle>(world); }
/// <summary>Override to implement code that gets executed when systems are initialized.</summary> public override void LoadContent() { this.testHealthMapper = new ComponentMapper<TestHealthComponent>(this.EntityWorld); }
/// <summary>Override to implement code that gets executed when systems are initialized.</summary> public override void LoadContent() { this.expiresMapper = new ComponentMapper<ExpiresComponent>(this.EntityWorld); }
public override void Initialize() { spatialFormMapper = new ComponentMapper<SpatialForm>(world); transformMapper = new ComponentMapper<Transform>(world); }
/// <summary>Override to implement code that gets executed when systems are initialized.</summary> public override void LoadContent() { this.velocityMapper = new ComponentMapper<VelocityComponent>(this.EntityWorld); this.transformMapper = new ComponentMapper<TransformComponent>(this.EntityWorld); }
/// <summary>Override to implement code that gets executed when systems are initialized.</summary> public override void LoadContent() { this.spriteBatch = BlackBoard.GetEntry<SpriteBatch>("SpriteBatch"); this.contentManager = BlackBoard.GetEntry<ContentManager>("ContentManager"); this.spatialFormMapper = new ComponentMapper<SpatialFormComponent>(this.EntityWorld); this.transformMapper = new ComponentMapper<TransformComponent>(this.EntityWorld); }
/// <summary>Override to implement code that gets executed when systems are initialized.</summary> public override void LoadContent() { this.transformMapper = new ComponentMapper<TransformComponent>(this.EntityWorld); this.healthMapper = new ComponentMapper<HealthComponent>(this.EntityWorld); }
public override void Initialize() { transformMapper = new ComponentMapper<Transform>(world); velocityMapper = new ComponentMapper<Velocity>(world); }
public override void Initialize() { healthMapper = new ComponentMapper<Health>(world); }
public override void Initialize() { bodyMapper = new ComponentMapper<Body>(world); }
public override void Initialize() { velocityMapper = new ComponentMapper<IVelocity>(world); dampingMapper = new ComponentMapper<IDamping>(world); slowMapper = new ComponentMapper<Slow>(world); }
public override void Initialize() { this.placementMapper = new ComponentMapper<Placement>(world); this.velocityMapper = new ComponentMapper<Velocity>(world); this.accelerationMapper = new ComponentMapper<Acceleration>(world); }
/// <summary>Override to implement code that gets executed when systems are initialized.</summary> public override void LoadContent() { this.transformMapper = new ComponentMapper<TransformComponent>(this.EntityWorld); this.graphicsDevice = BlackBoard.GetEntry<GraphicsDevice>("GraphicsDevice"); }
public override void Initialize() { spriteMapper = new ComponentMapper<Sprite>(world); transformMapper = new ComponentMapper<ITransform>(world); }