public FeatureController(FeatureQueryComponent featureQueryComponent, IndicatorComponent indicatorComponent, SquadComponent squadComponent, FeatureComponent featureComponent) : base() { this._indicatorComponent = indicatorComponent; this._featureQueryComponent = featureQueryComponent; this._featureComponent = featureComponent; this._squadComponent = squadComponent; }
private AssetId GetViewId(IndicatorComponent indicatorComponent) { var data = indicatorComponent.value; if (data is DamageIndicatorData) { return(AssetId.DamageView); } return(AssetId.DamageView); }
public override void Process(Entity entity) { PositionComponent positionComponent = entity.GetComponent <PositionComponent>(); IndicatorComponent indicatorComponent = entity.GetComponent <IndicatorComponent>(); Vector2 size = cardAttributeFont.MeasureString((indicatorComponent.Change > 0 ? "+" : "") + indicatorComponent.Change.ToString()); spriteBatch.DrawString(cardAttributeFont, (indicatorComponent.Change > 0 ? "+" : "") + indicatorComponent.Change.ToString(), positionComponent.Position - size / 2f, (indicatorComponent.Change > 0 ? Color.Green : (indicatorComponent.Change == 0 ? Color.Yellow : Color.Red)) * indicatorComponent.Opacity); positionComponent.Position += new Vector2(0, -delta * 4f); indicatorComponent.Opacity += (0f - indicatorComponent.Opacity) * delta; if (indicatorComponent.Opacity <= 0.025f) { entity.Delete(); } }