Esempio n. 1
0
    public override object Clone()
    {
        Scene s = (Scene)base.Clone();

        if (activeAreas != null)
        {
            s.activeAreas = new List <ActiveArea>();
            foreach (ActiveArea aa in activeAreas)
            {
                s.activeAreas.Add((ActiveArea)aa.Clone());
            }
        }
        //s.allowPlayerLayer = allowPlayerLayer;
        if (atrezzoReferences != null)
        {
            s.atrezzoReferences = new List <ElementReference>();
            foreach (ElementReference er in atrezzoReferences)
            {
                s.atrezzoReferences.Add((ElementReference)er.Clone());
            }
        }
        if (barriers != null)
        {
            s.barriers = new List <Barrier>();
            foreach (Barrier b in barriers)
            {
                s.barriers.Add((Barrier)b.Clone());
            }
        }
        if (characterReferences != null)
        {
            s.characterReferences = new List <ElementReference>();
            foreach (ElementReference er in characterReferences)
            {
                s.characterReferences.Add((ElementReference)er.Clone());
            }
        }
        s.defaultX = defaultX;
        s.defaultY = defaultY;
        if (exits != null)
        {
            s.exits = new List <Exit>();
            foreach (Exit e in exits)
            {
                s.exits.Add((Exit)e.Clone());
            }
        }
        if (itemReferences != null)
        {
            s.itemReferences = new List <ElementReference>();
            foreach (ElementReference er in itemReferences)
            {
                s.itemReferences.Add((ElementReference)er.Clone());
            }
        }
        s.playerLayer = playerLayer;
        s.playerScale = playerScale;
        s.trajectory  = (trajectory != null ? (Trajectory)trajectory.Clone() : null);
        return(s);
    }