Ejemplo n.º 1
0
        private Obstacle createQuickCopy(Obstacle cachedObstacle)
        {
            ObstacleSprite sprite = cachedObstacle.MySprite.copy();

            // create a new instance of this player
            Obstacle obstacle = new Obstacle(this.lhg, cachedObstacle.MyReferenceName, cachedObstacle.MyDisplayName, sprite);

            return(obstacle);
        }
Ejemplo n.º 2
0
        private Obstacle loadObstacle(XmlNode obstacleNode, StaticSpriteSheet spriteSheet)
        {
            string    referenceName = obstacleNode.Attributes["referenceName"].Value;
            string    displayName   = obstacleNode.Attributes["displayName"].Value;
            Texture2D texture       = spriteSheet.getTexture(referenceName);

            ObstacleSprite sprite   = new ObstacleSprite(lhg, texture);
            Obstacle       obstacle = new Obstacle(lhg, referenceName, displayName, sprite);

            return(obstacle);
        }
Ejemplo n.º 3
0
 public Obstacle(LunchHourGames lhg, String referenceName, String displayName, ObstacleSprite sprite)
     : base(lhg, EntityType.Obstacle, referenceName, displayName)
 {
     this.referenceName = referenceName;
     this.sprite        = sprite;
 }
Ejemplo n.º 4
0
        private CombatLocation loadCombatLocation(CombatBoard board, XmlNode locationNode, ObstacleSprite sprite)
        {
            CombatLocation location = null;

            try
            {
                int row = Convert.ToInt16(locationNode.Attributes["row"].Value);
                int col = Convert.ToInt16(locationNode.Attributes["col"].Value);
                location = new CombatLocation(board, row, col);
            }
            catch (Exception ex)
            {
            }

            return(location);
        }