<commit_before>#ifndef _background_mugen_h
#define _background_mugen_h

#include <string>
#include <vector>
#include <map>
#include <math.h>
#include "mugen_animation.h"
#include "mugen_util.h"
#include "gui/rectarea.h"
#include "ast/all.h"

#include "return_exception.h"

class Bitmap;

namespace Mugen{
    
struct Sin {
    Sin():
    amp(0),period(0),offset(0),angle(0){}
    ~Sin(){}
    inline void act(){
        angle += 0.00005;
    }
    inline const double get() const {
        return amp * sin(angle*period + offset);
    }
    double amp;
    double period;
    double offset;
    double angle;
};

/*! Base Element for backgrounds only uses a sprite as background */
class BackgroundElement : public Element{
    public:
	BackgroundElement();
	virtual ~BackgroundElement();
	
	virtual void act()=0;
	virtual void render(int x, int y, const Bitmap &)=0;
        virtual void setLink(BackgroundElement *element);
	
	virtual inline void setStart(const Mugen::Point &point){
	    this->start = point;
	}
	
	virtual inline Mugen::Point getStart() const{
	    return start;
	}
	
	virtual inline void setDelta(double x, double y){
	    this->deltaX = x;
	    this->deltaY = y;
	}
	
	virtual inline double getDeltaX() const{
	    return this->deltaX;
	}
	
	virtual inline double getDeltaY() const{
	    return this->deltaY;
	}
	
	virtual inline void setTrans(const TransType &trans){
	    this->effects.trans = trans;
	}
	
	virtual inline void setAlpha(int low, int high){
	    this->effects.alphalow = low;
	    this->effects.alphahigh = high;
	}
	
	virtual inline const TransType & getTrans() const {
	    return this->effects.trans;
	}
	
	virtual inline void setMask(bool mask){
	    this->effects.mask = mask;
	}
	
	virtual inline bool getMask() const {
	    return this->effects.mask;
	}

        virtual inline const Mugen::Effects & getEffects() const{
            return this->effects;
        }
	
	virtual inline void setTile(const Mugen::Point &point){
	    this->tile = point;
	}
	
	virtual inline Mugen::Point getTile() const {
	    return this->tile;
	}
	
	virtual inline void setTileSpacing(const Mugen::Point &point){
	    this->tileSpacing = point;
	}
	
	virtual inline Mugen::Point getTileSpacing() const {
	    return this->tileSpacing;
	}
	
	virtual inline void setWindow(int x1, int y1, int x2, int y2){
	    this->window = RectArea(x1,y1,x2-x1,y2-y1);
	}
	
	virtual inline RectArea getWindow() const {
	    return this->window;
	}
	
	virtual inline void setWindowDelta(double x, double y){
	    this->windowDeltaX = x;
	    this->windowDeltaY = y;
	}
	
	virtual inline double getWindowDeltaX() const{
	    return this->windowDeltaX;
	}
	
	virtual inline double getWindowDeltaY() const{
	    return this->windowDeltaY;
	}
	
	virtual inline void setPositionLink(bool link){
	    this->positionLink = link;
	}
	
	virtual inline bool getPositionLink() const {
	    return this->positionLink;
	}
	
	virtual inline void setVelocity(double x, double y){
	    this->velocityX = x;
	    this->velocityY = y;
	}
	
	virtual inline double getVelocityX() const{
	    return this->velocityX;
	}
	
	virtual inline double getVelocityY() const{
	    return this->velocityY;
	}
	
	virtual inline void setSinX(const Sin &sin){
	    this->sinX = sin;
	}
	
	virtual inline Sin & getSinX() {
	    return this->sinX;
	}
	
	virtual inline void setSinY(const Sin &sin){
	    this->sinY = sin;
	}
	
	virtual inline Sin & getSinY() {
	    return this->sinY;
	}

    private:
        //! get linked element
        BackgroundElement *getLinkedElement();
	//! The starting coordinate relative to 0,0 which is center of screen
	Mugen::Point start;
	//! Delta values used for movement defaults to 1
	double deltaX;
	double deltaY;
	//! Transparency defaults to None
	Mugen::Effects effects;
	//! Does this element tile 0 = no tile 1 = infinite above 1 = tile that many times
	Mugen::Point tile;
	//! Tile spacing
	Mugen::Point tileSpacing;
	//! Window for clipping
	RectArea window;
	//! Window delta
	double windowDeltaX;
	double windowDeltaY;
	//! linked?
	bool positionLink;
	//! Velocity of this element
	double velocityX;
	double velocityY;
	//! Sin components
	Sin sinX;
	Sin sinY;
        //! Camera - Current Camera location
        Mugen::Point camera;
        //! Linked element
        BackgroundElement *linkedElement;
};

/*! Normal element */
class NormalElement : public BackgroundElement {
    public:
	NormalElement();
	virtual ~NormalElement();
	virtual void act();
	virtual void render(int x, int y, const Bitmap &);
	virtual inline void setSprite(MugenSprite *sprite){
	    this->sprite = sprite;
	}
    private:
	//! Sprite Based
	MugenSprite *sprite;
};
<commit_msg>remove camera field<commit_after>#ifndef _background_mugen_h
#define _background_mugen_h

#include <string>
#include <vector>
#include <map>
#include <math.h>
#include "mugen_animation.h"
#include "mugen_util.h"
#include "gui/rectarea.h"
#include "ast/all.h"

#include "return_exception.h"

class Bitmap;

namespace Mugen{
    
struct Sin {
    Sin():
    amp(0),period(0),offset(0),angle(0){}
    ~Sin(){}
    inline void act(){
        angle += 0.00005;
    }
    inline const double get() const {
        return amp * sin(angle*period + offset);
    }
    double amp;
    double period;
    double offset;
    double angle;
};

/*! Base Element for backgrounds only uses a sprite as background */
class BackgroundElement : public Element{
    public:
	BackgroundElement();
	virtual ~BackgroundElement();
	
	virtual void act()=0;
	virtual void render(int x, int y, const Bitmap &)=0;
        virtual void setLink(BackgroundElement *element);
	
	virtual inline void setStart(const Mugen::Point &point){
	    this->start = point;
	}
	
	virtual inline Mugen::Point getStart() const{
	    return start;
	}
	
	virtual inline void setDelta(double x, double y){
	    this->deltaX = x;
	    this->deltaY = y;
	}
	
	virtual inline double getDeltaX() const{
	    return this->deltaX;
	}
	
	virtual inline double getDeltaY() const{
	    return this->deltaY;
	}
	
	virtual inline void setTrans(const TransType &trans){
	    this->effects.trans = trans;
	}
	
	virtual inline void setAlpha(int low, int high){
	    this->effects.alphalow = low;
	    this->effects.alphahigh = high;
	}
	
	virtual inline const TransType & getTrans() const {
	    return this->effects.trans;
	}
	
	virtual inline void setMask(bool mask){
	    this->effects.mask = mask;
	}
	
	virtual inline bool getMask() const {
	    return this->effects.mask;
	}

        virtual inline const Mugen::Effects & getEffects() const{
            return this->effects;
        }
	
	virtual inline void setTile(const Mugen::Point &point){
	    this->tile = point;
	}
	
	virtual inline Mugen::Point getTile() const {
	    return this->tile;
	}
	
	virtual inline void setTileSpacing(const Mugen::Point &point){
	    this->tileSpacing = point;
	}
	
	virtual inline Mugen::Point getTileSpacing() const {
	    return this->tileSpacing;
	}
	
	virtual inline void setWindow(int x1, int y1, int x2, int y2){
	    this->window = RectArea(x1,y1,x2-x1,y2-y1);
	}
	
	virtual inline RectArea getWindow() const {
	    return this->window;
	}
	
	virtual inline void setWindowDelta(double x, double y){
	    this->windowDeltaX = x;
	    this->windowDeltaY = y;
	}
	
	virtual inline double getWindowDeltaX() const{
	    return this->windowDeltaX;
	}
	
	virtual inline double getWindowDeltaY() const{
	    return this->windowDeltaY;
	}
	
	virtual inline void setPositionLink(bool link){
	    this->positionLink = link;
	}
	
	virtual inline bool getPositionLink() const {
	    return this->positionLink;
	}
	
	virtual inline void setVelocity(double x, double y){
	    this->velocityX = x;
	    this->velocityY = y;
	}
	
	virtual inline double getVelocityX() const{
	    return this->velocityX;
	}
	
	virtual inline double getVelocityY() const{
	    return this->velocityY;
	}
	
	virtual inline void setSinX(const Sin &sin){
	    this->sinX = sin;
	}
	
	virtual inline Sin & getSinX() {
	    return this->sinX;
	}
	
	virtual inline void setSinY(const Sin &sin){
	    this->sinY = sin;
	}
	
	virtual inline Sin & getSinY() {
	    return this->sinY;
	}

    private:
        //! get linked element
        BackgroundElement *getLinkedElement();
	//! The starting coordinate relative to 0,0 which is center of screen
	Mugen::Point start;
	//! Delta values used for movement defaults to 1
	double deltaX;
	double deltaY;
	//! Transparency defaults to None
	Mugen::Effects effects;
	//! Does this element tile 0 = no tile 1 = infinite above 1 = tile that many times
	Mugen::Point tile;
	//! Tile spacing
	Mugen::Point tileSpacing;
	//! Window for clipping
	RectArea window;
	//! Window delta
	double windowDeltaX;
	double windowDeltaY;
	//! linked?
	bool positionLink;
	//! Velocity of this element
	double velocityX;
	double velocityY;
	//! Sin components
	Sin sinX;
	Sin sinY;
        //! Linked element
        BackgroundElement *linkedElement;
};

/*! Normal element */
class NormalElement : public BackgroundElement {
    public:
	NormalElement();
	virtual ~NormalElement();
	virtual void act();
	virtual void render(int x, int y, const Bitmap &);
	virtual inline void setSprite(MugenSprite *sprite){
	    this->sprite = sprite;
	}
    private:
	//! Sprite Based
	MugenSprite *sprite;
};

{'fraction_non_alphanumeric': 0.10933132659643087, 'fraction_numerical': 0.006020210707374758, 'mean_word_length': 3.220961887477314, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 77, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3270469', 'n_tokens_mistral': 3146, 'n_tokens_neox': 2832, 'n_words': 890}