Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class BO<TConfig> where TConfig : BOConfigBase
- {
- protected TConfig Config { get; set; }
- internal List<BC> _BCs { get; set; }
- public abstract void Init();
- public void Process() => _BCs.ForEach(bc => bc.Process());
- }
- public class BOOne : BO<BOConfigOne>
- {
- public BOOne(BOConfigOne config)
- {
- Config = config;
- }
- public override void Init()
- {
- _BCs = new List<BC>()
- {
- BCA.Init(Config),
- BCB.Init(Config),
- BCC.Init(Config),
- BCOneA.Init(Config)
- };
- }
- }
- public abstract class BC
- {
- protected BOConfigBase Config { get; set; }
- public abstract void Process();
- }
- public class BCA : BC
- {
- private BCA()
- {
- }
- public static BCA Init(BOConfigBase config)
- {
- BCA ret = new BCA { Config = config };
- return ret;
- }
- public override void Process()
- {
- Config.Counter += 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement