Example #1
0
        public void Copy(int selectedX, int selectedY)
        {
            ClipbardElement t;

            for (int i = selectedX; i < selectedX + Width; i++)
            {
                for (int j = selectedY; j < selectedY + Height; j++)
                {
                    t      = new ClipbardElement();
                    t.lx   = i - selectedX;
                    t.ly   = j - selectedY;
                    t.Type = _parent._getTile(i, j).Type;
                    if (t.Type == 0)
                    {
                        t.Type = TileType.GRAVEL;
                    }
                    t.IsTile = true;
                    Add(t);

                    t    = new ClipbardElement();
                    t.lx = i - selectedX;
                    t.ly = j - selectedY;
                    if (_parent._getEntity(i, j) != null)
                    {
                        t.Type = _parent._getEntity(i, j).Type;
                    }
                    else
                    {
                        t.Type   = -1;
                        t.IsTile = false;
                    }
                    Add(t);
                }
            }
        }
Example #2
0
 public void Add(ClipbardElement item)
 {
     if (item.IsTile)
     {
         Tiles.Add(item);
     }
     else
     {
         Entities.Add(item);
     }
 }