Files
spacetris/src/core/interfaces/IGameRules.h
Gregor Klevze 66099809e0 feat: implement textured line clear effects and refine UI alignment
- **Visual Effects**: Upgraded line clear particles to use the game's block texture instead of simple circles, matching the reference web game's aesthetic.
- **Particle Physics**: Tuned particle velocity, gravity, and fade rates for a more dynamic explosion effect.
- **Rendering Integration**: Updated [main.cpp](cci:7://file:///d:/Sites/Work/tetris/src/main.cpp:0:0-0:0) and `GameRenderer` to pass the block texture to the effect system and correctly trigger animations upon line completion.
- **Menu UI**: Fixed [MenuState](cci:1://file:///d:/Sites/Work/tetris/src/states/MenuState.cpp:19:0-19:55) layout calculations to use fixed logical dimensions (1200x1000), ensuring consistent centering and alignment of the logo, buttons, and settings icon across different window sizes.
- **Code Cleanup**: Refactored `PlayingState` to delegate effect triggering to the rendering layer where correct screen coordinates are available.
2025-11-21 21:19:14 +01:00

74 lines
2.2 KiB
C++

#pragma once
/**
* @brief Abstract interface for game rules
*
* Provides a common interface for different Tetris rule implementations,
* enabling different game modes and rule variations.
*/
class IGameRules {
public:
virtual ~IGameRules() = default;
/**
* @brief Calculate score for cleared lines
* @param linesCleared Number of lines cleared simultaneously
* @param level Current game level
* @return Score points to award
*/
virtual int calculateScore(int linesCleared, int level) const = 0;
/**
* @brief Get gravity speed for a given level
* @param level Game level
* @return Time in milliseconds for one gravity drop
*/
virtual double getGravitySpeed(int level) const = 0;
/**
* @brief Check if level should increase
* @param totalLines Total lines cleared so far
* @param currentLevel Current game level
* @return true if level should increase, false otherwise
*/
virtual bool shouldLevelUp(int totalLines, int currentLevel) const = 0;
/**
* @brief Calculate next level based on lines cleared
* @param totalLines Total lines cleared so far
* @param startLevel Starting level
* @return New level
*/
virtual int calculateLevel(int totalLines, int startLevel) const = 0;
/**
* @brief Get soft drop speed multiplier
* @return Multiplier for gravity when soft dropping
*/
virtual double getSoftDropMultiplier() const = 0;
/**
* @brief Get hard drop score per cell
* @return Points awarded per cell for hard drop
*/
virtual int getHardDropScore() const = 0;
/**
* @brief Get soft drop score per cell
* @return Points awarded per cell for soft drop
*/
virtual int getSoftDropScore() const = 0;
/**
* @brief Check if T-spins are enabled in this rule set
* @return true if T-spins are supported, false otherwise
*/
virtual bool supportsTSpins() const = 0;
/**
* @brief Check if hold feature is enabled in this rule set
* @return true if hold is supported, false otherwise
*/
virtual bool supportsHold() const = 0;
};