예제 #1
0
        public void CopyReference(BrickList copiedFrom, Sprite parent)
        {
            int pos = 0;
            ReadHelper.currentBrickList = this;

            foreach (Brick brick in Bricks)
            {
                if (brick is PointToBrick)
                {
                    var pointToBrick = brick as PointToBrick;
                    pointToBrick.CopyReference(copiedFrom.Bricks[pos] as PointToBrick, parent);
                }
                else if (brick is LoopBeginBrick)
                {
                    var loopBeginBrick = brick as LoopBeginBrick;
                    loopBeginBrick.CopyReference(copiedFrom.Bricks[pos] as LoopBeginBrick, parent);
                }
                else if (brick is LoopEndBrick)
                {
                    var loopEndBrick = brick as LoopEndBrick;
                    loopEndBrick.CopyReference(copiedFrom.Bricks[pos] as LoopEndBrick, parent);
                }
                pos++;
            }
        }
예제 #2
0
파일: Script.cs 프로젝트: msachs/TestRepo2
        public Script(XElement xElement, Sprite parent)
        {
            Bricks = new BrickList(parent);
            sprite = parent;

            LoadFromCommonXML(xElement);
            LoadFromXML(xElement);
        }
예제 #3
0
        public DataObject Copy(Sprite parent)
        {
            var newBrickList = new BrickList(parent);
            ReadHelper.currentBrickList = newBrickList;

            foreach (Brick brick in Bricks)
                newBrickList.Bricks.Add(brick.Copy(parent) as Brick);

            return newBrickList;
        }
예제 #4
0
파일: Script.cs 프로젝트: msachs/TestRepo2
 private void LoadFromCommonXML(XElement xRoot)
 {
     if (xRoot.Element("brickList") != null)
         bricks = new BrickList(xRoot.Element("brickList"), sprite);
 }
예제 #5
0
파일: Script.cs 프로젝트: msachs/TestRepo2
 public Script(Sprite parent)
 {
     Bricks = new BrickList(parent);
     sprite = parent;
 }
예제 #6
0
파일: Script.cs 프로젝트: msachs/TestRepo2
 public Script()
 {
     Bricks = new BrickList(null);
 }