public SystemController() { Systems = new Dictionary <Type, ISystem> { { typeof(MovementComponent), new MovementSystem() }, { typeof(ShootComponent), new ShootingSystem() }, { typeof(OperativeInfoComponent), new OperativeInfoSystem() }, { typeof(HealthComponent), new HealthSystem() }, { typeof(CharacterActionComponent), new CharacterActionSystem() }, { typeof(GrenadeThrowComponent), new GrenadeThrowSystem() }, { typeof(ExplodableComponent), new ExplodableSystem() }, }; ComponentBase.GetClassType(ComponentType.Movement); }
public static ComponentBase GetComponentFromJson(ComponentType type, string json) { var tp = ComponentBase.GetClassType(type); return((ComponentBase)JsonConvert.DeserializeObject(json, tp)); }
public ComponentBase ToComponentBase() { var type = ComponentBase.GetClassType(Type); return((ComponentBase)JsonConvert.DeserializeObject(Component, type)); }