/// <summary> /// Game data will added to a TImage type during the game process. /// </summary> /// <param name="img"> to duplicate the data of an image </param> public TImage(TImage img) { if (img != null) { sprite = img.sprite; imageTheme = img.imageTheme; } }
/// <summary> /// Get image data for the image theme /// </summary> /// <param name="Theme"></param> /// The theme of the image /// <param name="data"> the list of image themes </param> public CTheme(string Theme, List <TImage> data) { specifiedTheme = Theme; if (data != null) { images = new List <TImage>(); for (int i = 0; i < data.Count; i++) { TImage timg = new TImage(data[i]); images.Add(timg); } } }
/// <summary> /// Select the images of the specified theme and add them to the list of images needed for this round of game /// </summary> /// <returns>The list of images </returns> public List <TImage> getimages() { specifiedTheme = specifiedTheme.Trim(); images = new List <TImage>(); for (int i = 0; i < sprites.Length; i++) { if (sprites[i] != null) { TImage tmp = new TImage(); tmp.imageTheme = specifiedTheme.Trim(); tmp.sprite = sprites[i]; images.Add(tmp); } } return(images); }