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);
    }
Exemple #2
0
    public static ComponentBase GetComponentFromJson(ComponentType type, string json)
    {
        var tp = ComponentBase.GetClassType(type);

        return((ComponentBase)JsonConvert.DeserializeObject(json, tp));
    }
Exemple #3
0
    public ComponentBase ToComponentBase()
    {
        var type = ComponentBase.GetClassType(Type);

        return((ComponentBase)JsonConvert.DeserializeObject(Component, type));
    }