示例#1
0
 public static void AssertTextureExists(string name, string source)
 {
     if (!GeneralTextureManager.ContainsTexture(name))
     {
         ThrowExistanceException(name, source, "is not loaded");
     }
 }
示例#2
0
        public static Tile GetRightTile(string textureName, Vector2D position,
                                        bool isHollow)
        {
            if (GeneralTextureManager.ContainsTexture(textureName))
            {
                return(new Tile(isHollow, textureName, position));
            }
            else if (CollectionHelper.DictionaryContains <AnimationGroup>(AnimationGroupManager.AnimationGroups, textureName))
            {
                return(new AnimatedTile(isHollow, textureName, new Vector2D(position.X, position.Y)));
            }

            throw new KeyNotFoundException("Symbol '" + textureName + "' is neither " +
                                           "a texture or an animation. source:RightTileCreator.GetRightTile()");
        }