File: RainStreak.h

package info (click to toggle)
tmatrix 1.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 244 kB
  • sloc: cpp: 1,214; ansic: 338; csh: 52; sh: 25; makefile: 8
file content (40 lines) | stat: -rw-r--r-- 990 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 * Copyright (C) 2018-2021 Miloš Stojanović
 *
 * SPDX-License-Identifier: GPL-2.0-only
 */

#ifndef RAIN_STREAK_H
#define RAIN_STREAK_H

#include <deque>
#include "Active.h"
#include "HasTerminal.h"
#include "MatrixChar.h"

class Rain;

class RainStreak final : public Active, public HasTerminal {
	const Rain *rain;
	const unsigned x;
	unsigned y {0};
	const unsigned Length;
	bool FullyEnteredScreen {false};
	bool ReachedScreenMiddle {false};
	bool LeftScreenMiddle {false};
	bool OutOfScreen {false};
	std::deque<MatrixChar> MChars;
public:
	RainStreak(const Rain *R, unsigned col, unsigned len) :
		rain{R}, x{col}, Length{len} {}

	bool HasFullyEnteredScreen() const { return FullyEnteredScreen; }
	bool HasReachedScreenMiddle() const { return ReachedScreenMiddle; }
	bool HasLeftScreenMiddle() const { return LeftScreenMiddle; }
	bool IsOutOfScreen() const { return OutOfScreen; }
	void Update() final;
	void UpdateShadeColors();
	void RemoveGlowFromPreviousHead();
};

#endif