public static SpritePalette.PaletteType SpriteToPaletteType(Sprite.SpriteType SpriteType) { if (SpriteType == Sprite.SpriteType.Color16) { return(SpritePalette.PaletteType.Color16); } else if (SpriteType == Sprite.SpriteType.Color256) { return(SpritePalette.PaletteType.Color256); } else { throw new Exception("Unknown type"); } }
/// <summary> /// Tile constructor /// Makes a gamebox based on 3 ints /// </summary> /// <param name="tileType"></param> /// <param name="randNumber"></param> /// <param name="Size"></param> public Tile(Sprite.SpriteType tileType, int randNumber, int size) { // Sets the default background image TileImage = Properties.Resources.empty; // Generates a dictionary that will be used later on // the gameboard generation _HasNeighbours = new Dictionary <Neighbours, Tile>(); switch (tileType) { case Sprite.SpriteType.Hero: // create hero sprite SpriteObject = new Hero(this); break; case Sprite.SpriteType.Enemy: // create enemy sprite SpriteObject = new Enemy(this, size); break; case Sprite.SpriteType.Wall: // create unmovable water sprite SpriteObject = new Box(false); break; case Sprite.SpriteType.Box: // create moveable box sprite SpriteObject = new Box(true); break; case Sprite.SpriteType.Empty: // Sets gameobject to null SpriteObject = null; break; } }
public List <NPC> FindNPCsByTag(Sprite.SpriteType tag) { return(_SpriteListActive.FindAll(x => x._Tag == tag)); }