Exemplo n.º 1
0
    public void Copy(FixedTilePattern source)
    {
        this.topMargin      = source.roffset;
        this.leftMargin     = source.coffset;
        this.bottomMargin   = source.rendoffset;
        this.rightMargin    = source.cendoffset;
        this.verticalStep   = source.spacing;
        this.horizontalStep = source.repeat;

        // don't copy tiles since they were not computed yet
    }
Exemplo n.º 2
0
    public void Copy(FixedTilePattern source)
    {
        this.roffset    = source.roffset;
        this.coffset    = source.coffset;
        this.rendoffset = source.rendoffset;
        this.cendoffset = source.cendoffset;
        this.spacing    = source.spacing;
        this.repeat     = source.repeat;

        // dont copy tiles since they were not computed yet
    }
Exemplo n.º 3
0
    public void Copy(LevelData source)
    {
        this.nbRows           = source.nbRows;
        this.nbColumns        = source.nbColumns;
        this.topLeftColor     = source.topLeftColor;
        this.topRightColor    = source.topRightColor;
        this.bottomRightColor = source.bottomRightColor;
        this.bottomLeftColor  = source.bottomLeftColor;

        // shallow copy !!!!
        // WARNING must be edited when making changes to the level data structure
        foreach (string move in source.moves)
        {
            this.moves.Add(move);
        }

        foreach (FixedTilePattern pattern in source.fixedTiles)
        {
            FixedTilePattern newPattern = gameObject.AddComponent <FixedTilePattern>();
            // FixedTilePattern newPattern = new FixedTilePattern();
            this.fixedTiles.Add(newPattern);
            newPattern.Copy(pattern);
        }
    }