git repos / blockattack-game

source/code/CppSdl/CppSdlTile.cpp

browsing at commit = c9dd376fadd91edfc72e057cb90dc998c95b82ba

raw · blame · history

/* 
 * File:   CppSdlTile.cpp
 * Author: poul
 * 
 * Created on 7. december 2010, 19:55
 */

#include <vector>

#include "CppSdlTile.hpp"

namespace CppSdl {
CppSdlTile::CppSdlTile() {
    _collideMode = OFF;
    _frames.clear();
}

CppSdlTile::CppSdlTile(const CppSdlTile& orig) {
    _collideMode = orig->_collideMode;
    _frames = orig->_frames;
}

CppSdlTile::~CppSdlTile() {
}

void CppSdlTile::setCollideMode(CollideMode _collideMode) {
    this->_collideMode = _collideMode;
}

CollideMode CppSdlTile::getCollideMode() const {
    return _collideMode;
}

void CppSdlTile::addFrame(CppSdlFrame frame) {
    _frames.push_back(frame);
}

void CppSdlTile::addFrame(CppSdlImageHolder image, long milliseconds) {
    CppSdlFrame f;
    f.SetImage(image);
    f.SetMilliseconds(milliseconds);
    addFrame(f);
}

void CppSdlTile::clearFrames() {
    _frames.clear();
}


} //namespace