Beispiel #1
0
        /// <summary>
        /// metodo para acceder al level.
        /// </summary>
        /// <param name="level"> objeto level al que se accede. </param>
        public override void Visit(Level level)
        {
            if (level.ScreenList.Count >= 1)
            {
                this.LastScreen = level.ScreenList[level.ScreenList.Count - 1];
            }

            try
            {
                string name      = this.tag.AttributeList["Name"].Value;
                int    positionY = Int32.Parse(this.tag.AttributeList["PositionY"].Value);
                int    positionX = Int32.Parse(this.tag.AttributeList["PositionX"].Value);
                int    length    = Int32.Parse(this.tag.AttributeList["Length"].Value);
                int    width     = Int32.Parse(this.tag.AttributeList["Width"].Value);
                string imagePath = this.tag.AttributeList["ImagePath"].Value;

                IXML blankSpace = new BlankSpace(name, positionY, positionX, length, width, this.LastScreen, imagePath);
                this.LastScreen.Add(blankSpace);
            }
            catch (Exception)
            {
                string message = "there was an error while fetching data from the XML file";
                throw new NotFoundOnXMLException(message);
            }
        }
Beispiel #2
0
 /// <summary>
 /// constructor de la clase Word.
 /// </summary>
 /// <param name="name">nombre.</param>
 /// <param name="positionY">posicion Y.</param>
 /// <param name="positionX">posicion X.</param>
 /// <param name="length">largo.</param>
 /// <param name="width">ancho.</param>
 /// <param name="screen">pantalla a la que pertenece.</param>
 /// <param name="imagePath">imagen que posee.</param>
 /// <param name="source">fuente.</param>
 /// <param name="destination">destino.</param>
 public Word(string name, int positionY, int positionX, int length, int width, Screen screen, string imagePath, DragAndDropSource source, BlankSpace destination)
     : base(name, positionY, positionX, length, width, screen, imagePath, source, destination)
 {
 }
Beispiel #3
0
 /// <summary>
 /// constructor de DragAndDropItem.
 /// </summary>
 /// <param name="name">nombre.</param>
 /// <param name="positionY">posicion Y.</param>
 /// <param name="positionX">posicion X.</param>
 /// <param name="length">largo.</param>
 /// <param name="width">ancho.</param>
 /// <param name="screen">Screen a la que pertenece el elemento.</param>
 /// <param name="imagePath">imagen que posee el elemento.</param>
 /// <param name="source">fuente del elemento.</param>
 /// <param name="destination">destino del elemento.</param>
 public DragAndDropItem(string name, int positionY, int positionX, int length, int width, Screen screen, string imagePath, DragAndDropSource source, BlankSpace destination)
     : base(name, positionY, positionX, length, width, screen, imagePath)
 {
     this.Destination = destination;
     this.Source      = source;
 }
Beispiel #4
0
 /// <summary>
 /// metodo que dibuja un BlankSpace en Unity.
 /// </summary>
 /// <param name="blankSpace"> BlankSpace a dibujar. </param>
 public void RenderBlankSpace(BlankSpace blankSpace)
 {
     blankSpace.DestinationCellImageId = this.adapter.CreateImage((int)blankSpace.PositionX, (int)blankSpace.PositionY, (int)blankSpace.Width, (int)blankSpace.Length);
     this.adapter.SetImage(blankSpace.DestinationCellImageId, blankSpace.ImagePath);
 }