fixed: all ready for input-testing
This commit is contained in:
@ -1,35 +1,35 @@
|
||||
/*
|
||||
* CS 246 Final Project
|
||||
* File: display.h
|
||||
* Purpose: handles map functionality
|
||||
*/
|
||||
|
||||
#ifndef __DISPLAY_H__
|
||||
#define __DISPLAY_H__
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include <vector>
|
||||
#include "position.h"
|
||||
#include "constants.h"
|
||||
#include "cursor.h"
|
||||
|
||||
class display final {
|
||||
private:
|
||||
std::vector<std::string> contents;
|
||||
cursor &curse;
|
||||
class display {
|
||||
protected:
|
||||
// use an array of ints to keep track of what's on the screen
|
||||
// This will have a bit of buffer for the last line
|
||||
// just in case it overflows
|
||||
std::vector<int> contents;
|
||||
public:
|
||||
display();
|
||||
display(cursor &new_curse, int argc, char **argv);
|
||||
|
||||
void clear();
|
||||
// use this instead of overloading for clarity
|
||||
void print(std::ostream &out) const;
|
||||
void print_line(const std::string &line, const int linenum);
|
||||
virtual ~display() = default;
|
||||
|
||||
void render() const ;
|
||||
// Only call this to refresh the entire output
|
||||
virtual void render() = 0;
|
||||
|
||||
// will override any character that was there
|
||||
void print_position(const position &pos, const char ch);
|
||||
// Clears the contents buffer
|
||||
virtual void clear() = 0;
|
||||
|
||||
virtual void print_char(const position &pos, const char ch,
|
||||
const int attr =
|
||||
A_NORMAL | COLOR_PAIR(COLOR_WHITE)) = 0;
|
||||
virtual void print_str(const position &pos, const std::string &str,
|
||||
const int attr =
|
||||
A_NORMAL | COLOR_PAIR(COLOR_WHITE)) = 0;
|
||||
// default arguments are to be set in the base class's declaration
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user