~kubuntu-members/kapman/4.11

« back to all changes in this revision

Viewing changes to bonus.cpp

  • Committer: Thomas Gallinari
  • Date: 2008-05-14 00:01:06 UTC
  • Revision ID: git-v1:19a04402bc090a33353513938b536f0d0d062a2f
Improving bonus management : bonus item is no longer created on each bonus display, it is now created once per game and its image is changed from a single svg (bonus.svg)

svn path=/trunk/playground/games/kapman/; revision=807567

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
 
2
 * Copyright 2007-2008 Thomas Gallinari <tg8187@yahoo.fr>
2
3
 * Copyright 2007-2008 Gaël Courcelle <gael.courcelle@gmail.com>
3
4
 * Copyright 2007-2008 Alexia Allanic <alexia_allanic@yahoo.fr>
4
5
 * Copyright 2007-2008 Johann Hingue <yoan1703@hotmail.fr>
20
21
#include "bonus.h"
21
22
#include "kapman.h"
22
23
 
23
 
Bonus::Bonus(qreal p_x, qreal p_y, Maze* p_maze, const QString & p_imageUrl, int p_points) : Element(p_x, p_y, p_maze) {
 
24
Bonus::Bonus(qreal p_x, qreal p_y, Maze* p_maze, int p_points) : Element(p_x, p_y, p_maze) {
24
25
        m_points = p_points;
25
 
        Element::setImageUrl(p_imageUrl);
26
26
        m_type = Element::BONUS;
27
27
}
28
28
 
34
34
        p_kapman->winPoints(this);
35
35
}
36
36
 
37
 
void Bonus::update(QString & p_imageUrl, int p_points) {
38
 
        Element::setImageUrl(p_imageUrl);
 
37
void Bonus::setPoints(const int p_points) {
39
38
        m_points = p_points;
40
39
}
41
40
 
42