150764Smarkm/* $NetBSD: ttyscrn.h,v 1.5 2021/12/05 09:22:45 rillig Exp $ */ 2233294Sstas 3233294Sstas/*- 4233294Sstas * Copyright (c) 2003 The NetBSD Foundation, Inc. 550764Smarkm * All rights reserved. 6233294Sstas * 7233294Sstas * This code is derived from software contributed to The NetBSD Foundation 8233294Sstas * by Christos Zoulas. 950764Smarkm * 10233294Sstas * Redistribution and use in source and binary forms, with or without 11233294Sstas * modification, are permitted provided that the following conditions 1250764Smarkm * are met: 13233294Sstas * 1. Redistributions of source code must retain the above copyright 14233294Sstas * notice, this list of conditions and the following disclaimer. 15233294Sstas * 2. Redistributions in binary form must reproduce the above copyright 1650764Smarkm * notice, this list of conditions and the following disclaimer in the 17233294Sstas * documentation and/or other materials provided with the distribution. 18233294Sstas * 19233294Sstas * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 2050764Smarkm * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21233294Sstas * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22233294Sstas * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23233294Sstas * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24233294Sstas * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25233294Sstas * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26233294Sstas * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27233294Sstas * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28233294Sstas * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29233294Sstas * POSSIBILITY OF SUCH DAMAGE. 30233294Sstas */ 31233294Sstas 3250764Smarkm/* 3350764Smarkm * Curses based screen for dots 34233294Sstas */ 3550764Smarkm 3650764Smarkm#ifndef _H_TTYSCRN 3750764Smarkm#define _H_TTYSCRN 3850764Smarkm 3950764Smarkm#include "gamescreen.h" 40233294Sstas 41233294Sstasclass TTYSCRN : public GAMESCREEN { 42233294Sstas public: 43233294Sstas // Constructor that can fail 44233294Sstas static TTYSCRN* create(int acs, size_t *y, size_t *x); 45233294Sstas ~TTYSCRN(); 46233294Sstas 4750764Smarkm // Screen virtuals 4850764Smarkm void clean(void); 4950764Smarkm void moveto(size_t y, size_t x); 50233294Sstas void addsym(const int sym); 5150764Smarkm void addedge(const int sym); 5250764Smarkm void redraw(void); 53233294Sstas void bell(void); 54233294Sstas int getinput(void); 55233294Sstas void score(size_t s, const PLAYER& p); 56233294Sstas void games(size_t s, const PLAYER& p); 57233294Sstas void total(size_t s, const PLAYER& p); 58233294Sstas void ties(const PLAYER& p); 59233294Sstas 60233294Sstas private: 61233294Sstas enum { 62233294Sstas offsx = 2, // board x offset from top left corner 63233294Sstas offsy = 2, // board y offset from top left corner 64233294Sstas offsscore = 0, // score y offset from top of the board 65233294Sstas offstotal = 3, // total y offset from top of the board 66233294Sstas offsgames = 6, // games y offset from top of the board 67233294Sstas offsties = 8 // ties y offset from top of the board 68233294Sstas }; 69233294Sstas size_t _sx, _sy; // board size 7050764Smarkm size_t _tx, _ty; // tty size 7150764Smarkm int _acs; // do we want acs? 7250764Smarkm}; 7350764Smarkm 7450764Smarkm#endif 7550764Smarkm