Beispiel #1
0
    public Particularity CreateParticularity(Creature owner, ParticularityType type)
    {
        switch (type)
        {
        case ParticularityType.Explosion: return(new Explosion(owner, explosionConfig));

        case ParticularityType.Venom: return(new Venom(owner, venomConfig));

        case ParticularityType.Ghost: return(new Ghost(owner, ghostConfig));

        case ParticularityType.Spark: return(new Spark(owner, sparkConfig));

        case ParticularityType.Rouli: return(new Rouli(owner, rouliConfig));

        case ParticularityType.Vacuum: return(new Vacuum(owner, vacuumConfig));
        }

        return(null);
    }
    public List <ParticularityType> AllParticularityTypes()
    {
        List <ParticularityType> types = new List <ParticularityType>();

        foreach (Particularity particularity in particularities)
        {
            ParticularityType type = 0;
            switch (particularity)
            {
            case Explosion e:
                type = ParticularityType.Explosion;
                break;

            case Venom v:
                type = ParticularityType.Venom;
                break;

            case Spark s:
                type = ParticularityType.Spark;
                break;

            case Ghost g:
                type = ParticularityType.Ghost;
                break;

            case Rouli r:
                type = ParticularityType.Rouli;
                break;

            case Vacuum v:
                type = ParticularityType.Vacuum;
                break;
            }

            if (!types.Contains(type))
            {
                types.Add(type);
            }
        }

        return(types);
    }