public DrawElementRequest(ElementAsset asset, int posX, int posY, int screenHeight, int screenWidth)
 {
     this.asset = asset;
     this.posY = posY;
     this.posX = posX;
     this.screenHeight = screenHeight;
     this.screenWidth = screenWidth;
 }
 public DrawElementRequest(ElementAsset asset, int screenHeight, int screenWidth)
     : this(asset, -1, -1, screenWidth, screenWidth)
 {
 }
        /*
         *
         *   We'll use the file system and a bunch of naming convetions and directories
         *   to decide what belongs to an element.
         *
         *   This is a really short term approach.  Ideally using a manifest file per element
         *   or even a directory per element would be better, allowing a more flexible method
         *   of defining elements
         *
         */
        private void LoadElementAssetsFromDisk()
        {
            string filePattern = "(?<entity>default|element)_(?<name>.+)\\.(?<type>jpg|png|gif|bmp|wav|mp3)";
            Regex rx = new Regex(filePattern, RegexOptions.Compiled | RegexOptions.IgnoreCase);

            string elementPath = Directory.GetCurrentDirectory() + "\\Elements";

            foreach (string fileName in Directory.GetFiles(elementPath))
            {
                // Find matches.
                MatchCollection matches = rx.Matches(fileName);

                // Report the number of matches found.
                Console.WriteLine("{0} matches found.", matches.Count);

                // Report on each match.
                foreach (Match match in matches)
                {
                    string entity = match.Groups["entity"].Value;
                    string name = match.Groups["name"].Value;
                    string type = match.Groups["type"].Value;

                    if (entity == "default")
                    {
                        defaults.Add(fileName);
                    }
                    else
                    {
                        ElementAsset asset;
                        if (!elements.ContainsKey(name))
                        {
                            asset = new ElementAsset();
                            elements.Add(name, asset);
                        }
                        else
                        {
                            asset = elements[name];
                        }

                        asset.addFileName(fileName, type);
                    }
                }

                Console.WriteLine(fileName);
            }

            assets.AddRange(elements.Values);

            // inject default sound for every element which is missing a sound
            foreach (ElementAsset asset in assets)
            {
                if (asset.getSoundFileName() == null && defaults.Count > 0)
                {
                    asset.addSoundFileName(defaults[random.Next(defaults.Count)]);
                }
            }
        }