code
stringlengths
1
2.06M
language
stringclasses
1 value
#ifndef POPUP_MAIN_DIALOG_H #define POPUP_MAIN_DIALOG_H #include "MyTabCtrl.h" #include "PopupClientInfo.h" #include "PopupMessageInfo.h" class CpopupDialog; // PopupMainDialog dialog class PopupMainDialog : public CDialog { DECLARE_DYNAMIC(PopupMainDialog) public: PopupMainDialog(CWnd* pParent =...
C++
#if !defined(AFX_MYTABCTRL_H__F3E8650F_019C_479F_9E0F_60FE1181F49F__INCLUDED_) #define AFX_MYTABCTRL_H__F3E8650F_019C_479F_9E0F_60FE1181F49F__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // MyTabCtrl.h : header file // class CSenderDialog; class PopupHistoryDialog; class PopupProper...
C++
//this file is part of ePopup // //This program is free software; you can redistribute it and/or //modify it under the terms of the GNU General Public License //as published by the Free Software Foundation; either //version 2 of the License, or (at your option) any later version. // //This program is distributed...
C++
#ifndef C_SENDER_DIALOG_H #define C_SENDER_DIALOG_H #pragma once #include "afxwin.h" #include "afxcmn.h" #include "PopupMessageInfo.h" #include "PopupClientInfo.h" #include "resource.h" class CpopupApp; // CSenderDialog dialog class CSenderDialog : public CDialog { DECLARE_DYNAMIC(CSenderDialog) ...
C++
#ifndef RESOURCE_ENTRY_H #define RESOURCE_ENTRY_H #include "stdafx.h" #include <CString> #include <vector> //=============================================================== // Resource entry representation (images and sounds) //=============================================================== struct ResourceEntry { s...
C++
//this file is part of ePopup // //This program is free software; you can redistribute it and/or //modify it under the terms of the GNU General Public License //as published by the Free Software Foundation; either //version 2 of the License, or (at your option) any later version. // //This program is distributed...
C++
//this file is part of ePopup // //This program is free software; you can redistribute it and/or //modify it under the terms of the GNU General Public License //as published by the Free Software Foundation; either //version 2 of the License, or (at your option) any later version. // //This program is distributed...
C++
//this file is part of ePopup // //This program is free software; you can redistribute it and/or //modify it under the terms of the GNU General Public License //as published by the Free Software Foundation; either //version 2 of the License, or (at your option) any later version. // //This program is distributed in the...
C++
#pragma once ///////////////////////////////////////////////////////////////////////////// // CTrayMenuBtn window class CTrayMenuBtn : public CWnd { public: CTrayMenuBtn(); virtual ~CTrayMenuBtn(); bool m_bBold; bool m_bMouseOver; bool m_bNoHover; bool m_bUseIcon; bool m_bParentCapture; UINT ...
C++
#pragma once #include "DialogMinTrayBtn.h" //#include "PopupSystrayDlg.h" #include "ResizableDialog.h" #define IDT_SINGLE_CLICK 100 class CTrayDialog : public CDialogMinTrayBtn<CResizableDialog> { protected: typedef CDialogMinTrayBtn<CResizableDialog> CTrayDialogBase; public: CTrayDialog(UINT uIDD, CWnd* pParent =...
C++
//this file is part of ePopup // //This program is free software; you can redistribute it and/or //modify it under the terms of the GNU General Public License //as published by the Free Software Foundation; either //version 2 of the License, or (at your option) any later version. // //This program is distributed...
C++
#pragma once #ifdef _DEBUG #define CATCH_DFLT_ALL(fname) #else #define CATCH_DFLT_ALL(fname) \ catch(...){ \ if (thePrefs.GetVerbose()) \ DebugLogError(LOG_STATUSBAR, _T("Unknown exception in ") fname); \ ASSERT(0); \ } #endif // This type of "last chance" exception handling is to be used at lea...
C++
#pragma once class CEnBitmap : public CBitmap { public: CEnBitmap(); virtual ~CEnBitmap(); BOOL LoadImage(LPCTSTR pszImagePath, COLORREF crBack = 0); BOOL LoadImage(UINT uIDRes, LPCTSTR pszResourceType, HMODULE hInst = NULL, COLORREF crBack = 0); BOOL LoadImage(LPCTSTR lpszResourceName, LPCTSTR pszR...
C++
//this file is part of ePopup // //This program is free software; you can redistribute it and/or //modify it under the terms of the GNU General Public License //as published by the Free Software Foundation; either //version 2 of the License, or (at your option) any later version. // //This program is distributed...
C++
// ------------------------------------------------------------ // CDialogMinTrayBtn template class // MFC CDialog with minimize to systemtray button (0.04) // Supports WinXP styles (thanks to David Yuheng Zhao for CVisualStylesXP - yuheng_zhao@yahoo.com) // ----------------------------------------------------------...
C++
#ifndef LOGGER_HPP #define LOGGER_HPP #include <sstream> //=============================================================== // Logging utility //=============================================================== struct Logger : public std::stringstream { std::string m_logFilePath; bool m_enabled; public: Logger(cons...
C++
#pragma once #include "afxcmn.h" #include "Popup.h" #include "PopupDlg.h" #include "PopupMessageInfo.h" #include <vector> // PopupHistoryDialog dialog class PopupHistoryDialog : public CDialog { DECLARE_DYNAMIC(PopupHistoryDialog) public: PopupHistoryDialog(CWnd* pParent = NULL); // standard constr...
C++
#pragma once ///////////////////////////////////////////////////////////////////////////////////////// ///PopupAutoModeThread class PopupAutoModeThread : public CWinThread { public: DECLARE_DYNCREATE(PopupAutoModeThread) protected: PopupAutoModeThread() {} public: virtual BOOL InitInstance(); virtual...
C++
// CTaskbarNotifier Header file // By John O'Byrne - 15 July 2002 // Modified by kei-kun #pragma once #define TN_TEXT_NORMAL 0x0000 #define TN_TEXT_BOLD 0x0001 #define TN_TEXT_ITALIC 0x0002 #define TN_TEXT_UNDERLINE 0x0004 //START - enkeyDEV(kei-kun) -TaskbarNotifier- enum TbnMsg { TBN_NONOTIFY, ...
C++
//this file is part of ePopup // //This program is free software; you can redistribute it and/or //modify it under the terms of the GNU General Public License //as published by the Free Software Foundation; either //version 2 of the License, or (at your option) any later version. // //This program is distributed...
C++
#include <PopupDefaultLogger.hpp> #include <PopupSqlite3Database.hpp> #include <string> using namespace Popup; using namespace std; static PopupDefaultLogger logger; static void dump(const PopupDatabaseUser * user) { logger.appendLog(POPUP_LOG_INFO, "id=%u name=%s nickname=%s avatar=%s", user->getID(), u...
C++
int main() { }
C++
#include <PopupDefaultLogger.hpp> #include <PopupQSqliteDatabase.hpp> #include <string> using namespace Popup; using namespace std; int main(int argc, char *argv[]) { PopupDefaultLogger logger; if (argc <= 1) { logger.appendLog(POPUP_LOG_ERROR, "Usage: %s <file.db>\n", argv[0]); } else { PopupQSqliteDa...
C++
#include <PopupQSqliteDatabase.hpp> #include <QFile> #include <QSqlQuery> #include <QSqlRecord> #include <QVariant> using namespace Popup; using namespace std; struct MyDatabaseUser : PopupDatabaseUser { unsigned long id; string login; string iconpath; string nickname; unsigned long getID() const { retur...
C++
#pragma once #include <stdlib.h> #include <string.h> #define DIGITS "0.123456789" #define WHITESPACE_CHARS " \n\r\t" class ScriptScanner { public: ScriptScanner(char* str); ~ScriptScanner(void); float NextFuncTime(); char* NextFunc(); float NextFuncArg(); void hasExec(); bool ReadOneLine(...
C++
// stdafx.cpp : source file that includes just the standard includes // FrcCppTest.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this file
C++
#pragma once #include <iostream> #include <fstream> #include <streambuf> #include <string> #include <sstream> #include <Windows.h> #include "ScriptScanner.h" typedef void (*FUNC)(float param); class ScriptInterpreter { public: ScriptInterpreter(void); ~ScriptInterpreter(void); void OpenScript(c...
C++
#include "ScriptInterpreter.h" ScriptInterpreter::ScriptInterpreter(void) { } ScriptInterpreter::~ScriptInterpreter(void) { } float getelap() { return (float)GetTickCount64() / (float)1000; } void ScriptInterpreter::OpenScript(char* file) { std::fstream f(file); if(!f.is_open()) { p...
C++
#include "ScriptScanner.h" bool strcont(char c, char* str) { for(int i = 0; str[i] != 0; i++) { if(str[i] == c) return 1; } return 0; } ScriptScanner::ScriptScanner(char* str) { this->str = str; } ScriptScanner::~ScriptScanner(void) { } bool ScriptScanner::ReadOneLine() { // A li...
C++
//include "stdafx.h" //#include "ScriptInterpreter.h" #include <winsock2.h> #include <WS2tcpip.h> typedef struct DashboardDatatype { float voltage; }; #include <cstdio> int printf_wrap(const char* format, ...) { va_list args; va_start(args, format); int retVal = vprintf(format, args); v...
C++
#ifndef OI_H #define OI_H #include "WPILib.h" #include "Robotmap.h" class OI { private: Joystick* joystickDriveLeft; Joystick* joystickDriveRight; Joystick* joystickGameMech; // ************************************** // **************** Drive *************** // **********************************...
C++
#ifndef COMMAND_BASE_H #define COMMAND_BASE_H #include "Commands/Command.h" #include "Subsystems/ClimberSubsystem.h" #include "Subsystems/DriveSubsystem.h" #include "Subsystems/FrisbeeLauncher.h" #include "Subsystems/FrisbeeLoader.h" #include "Subsystems/GyroSubsystem.h" #include "OI.h" /** * The base fo...
C++
#include "logging.h" #include "Robotmap.h" #include <cstdio> #include <stdarg.h> void log(LogType level, char* format, ...) { if (level >= MINIMUM_LOG_LEVEL) { va_list args; va_start(args, format); vprintf(format, args); printf("\n"); va_end(args); } }
C++
#ifndef SCRIPT_SCANNER_H #define SCRIPT_SCANNER_H class ScriptScanner { public: ScriptScanner(char* str); ~ScriptScanner(void); float NextFuncTime(); char* NextFunc(); float NextFuncArg(); void hasExec(); bool ReadOneLine(); private: char* str; float _nextFuncTime; char* _nextFunc; f...
C++
#ifndef SCRIPT_INTERPRETER_H #define SCRIPT_INTERPRETER_H #include "ScriptScanner.h" class ScriptInterpreter { public: typedef void (*ScriptInterpreterCallbackFunc)(const char* func, float param, void* ref); ScriptInterpreter(void); ~ScriptInterpreter(void); int OpenScript(const char* fileName); ...
C++
#include "ScriptInterpreter.h" #include <iostream> #include <fstream> #include <streambuf> #include <string> #include <sstream> #include "stdlib.h" #include "Timer.h" #include "ScriptScanner.h" #include "../logging.h" #define GETELAP Timer::GetFPGATimestamp ScriptInterpreter::ScriptInterpreter(vo...
C++
#include "ScriptScanner.h" #include <stdlib.h> #include <string.h> #define DIGITS "-0.123456789" #define WHITESPACE_CHARS " \n\r\t" bool strcont(char c, char* str) { for(int i = 0; str[i] != 0; i++) { if(str[i] == c) return 1; } return 0; } ScriptScanner::ScriptScanner(char* str) { ...
C++
#include "WPILib.h" #include "Commands/Command.h" #include "CommandBase.h" #include "Commands/Autonomous/AutonomousCommand.h" #include "Commands/Drive/TankDriveCommand.h" class CommandBasedRobot: public IterativeRobot { private: Command *autonomousCommand; Command *tankControl; Compressor* c; virtu...
C++
#ifndef GYROSUBSYSTEM_H #define GYROSUBSYSTEM_H #include "Commands/Subsystem.h" #include "WPILib.h" /** * * * @author Matthew */ class GyroSubsystem: public Subsystem { private: Gyro* gyroYaw; public: GyroSubsystem(); void InitDefaultCommand(); float GetYawAngle(); void ResetYaw(); }; ...
C++
#include "FrisbeeLauncher.h" FrisbeeLauncher::FrisbeeLauncher() : Subsystem("FrisbeeLauncher") { firstStage = new CANJaguar(MOTOR_LAUNCHER_STAGE_1, CANJaguar::kVoltage); secondStage = new CANJaguar(MOTOR_LAUNCHER_STAGE_2, CANJaguar::kVoltage); this->firstStage->SetSafetyEnabled(false); this->firstStage-...
C++
#include "DriveSubsystem.h" DriveSubsystem::DriveSubsystem() : Subsystem("DriveSubsystem") { shiftSolenoid = new Solenoid(SOLENOID_SHIFTER); motorLeft = new CANJaguar(MOTOR_LEFT, CANJaguar::kPercentVbus); motorRight = new CANJaguar(MOTOR_RIGHT, CANJaguar::kPercentVbus); //_isClosedLoop = false; dri...
C++
#ifndef DRIVESUBSYSTEM_H #define DRIVESUBSYSTEM_H #include "WPILib.h" #include "Commands/Subsystem.h" #include "../Robotmap.h" /** * * * @author Matthew Kennedy of FRC1294 */ class DriveSubsystem: public Subsystem { private: // It's desirable that everything possible under private except // for m...
C++
#include "ClimberSubsystem.h" #include "../Robotmap.h" ClimberSubsystem::ClimberSubsystem() : Subsystem("ClimberSubsystem") { //this->climbJagRight = new CANJaguar(MOTOR_CLIMBER_RIGHT, CANJaguar::kPercentVbus); //this->climbJagLeft = new CANJaguar(MOTOR_CLIMBER_LEFT, CANJaguar::kPercentVbus); this->climbJa...
C++
#ifndef FRISBEELAUNCHER_H #define FRISBEELAUNCHER_H #include "WPIlib.h" #include "Commands/Subsystem.h" #include "../Robotmap.h" /** * * * @author Matthew */ class FrisbeeLauncher: public Subsystem { private: CANJaguar* firstStage; CANJaguar* secondStage; bool _isRunning; public: FrisbeeLaun...
C++
#ifndef CLIMBERSUBSYSTEM_H #define CLIMBERSUBSYSTEM_H #include "Commands/Subsystem.h" #include "WPILib.h" /** * * * @author Matthew */ class ClimberSubsystem: public Subsystem { private: Jaguar *climbJagLeft; Jaguar *climbJagRight; Solenoid* solenoidTip; Solenoid* solenoidArm; public: Climbe...
C++
#ifndef FRISBEELOADER_H #define FRISBEELOADER_H #include "Commands/Subsystem.h" #include "WPILib.h" /** * * * @author Matthew */ class FrisbeeLoader: public Subsystem { private: Solenoid* pusherSolenoid; DigitalInput* feedSwitch; CANJaguar* feedMotor; public: FrisbeeLoader(); void InitDefau...
C++
#include "GyroSubsystem.h" #include "../Robotmap.h" GyroSubsystem::GyroSubsystem() : Subsystem("GyroSubsystem") { this->gyroYaw = new Gyro(new AnalogChannel(GYRO_YAW_PIN)); } void GyroSubsystem::InitDefaultCommand() { } float GyroSubsystem::GetYawAngle() { return gyroYaw->GetAngle(); } void G...
C++
#include "FrisbeeLoader.h" #include "../Robotmap.h" FrisbeeLoader::FrisbeeLoader() : Subsystem("FrisbeeLoader") { pusherSolenoid = new Solenoid(SOLENOID_FEEDER); feedSwitch = new DigitalInput(FEED_SWITCH); feedMotor = new CANJaguar(MOTOR_FEEDER, CANJaguar::kVoltage); } void FrisbeeLoader::InitDefaultCo...
C++
#include "AutonomousCommand.h" AutonomousCommand::AutonomousCommand(const char* autoScriptFile) { // Only require the launcher, because that is the only thing that we don't // set via another command. fireShot = NULL; gyroRotate = NULL; //driveCmd = NULL; Requires(launcher); si = new Script...
C++
#ifndef AUTONOMOUSCOMMAND_H #define AUTONOMOUSCOMMAND_H #include "../../ScriptParser/ScriptInterpreter.h" #include "../../CommandBase.h" #include "../Launcher/FireShotCommand.h" #include "../Drive/ClosedLoop/GyroRotateCommand.h" /** * * * @author matthew */ class AutonomousCommand: public CommandBa...
C++
#include "ClimbCommand.h" ClimbCommand::ClimbCommand() { Requires(drive); Requires(climber); } // Called just before this Command runs the first time void ClimbCommand::Initialize() { climber->SetArmPosition(true); climber->SetRobotTip(true); } // Called repeatedly when this Command is scheduled to...
C++
#ifndef CLIMBCOMMAND_H #define CLIMBCOMMAND_H #include "../../CommandBase.h" /** * * * @author Matthew */ class ClimbCommand: public CommandBase { public: ClimbCommand(); virtual void Initialize(); virtual void Execute(); virtual bool IsFinished(); virtual void End(); virtual void Interrupt...
C++
#ifndef LOADFRISBEECOMMAND_H #define LOADFRISBEECOMMAND_H #include "Commands/CommandGroup.h" /** * * * @author Matthew */ class LoadFrisbeeCommand: public CommandGroup { public: LoadFrisbeeCommand(); }; #endif
C++
#ifndef FEEDUNTILPRESSSTATECOMMAND_H #define FEEDUNTILPRESSSTATECOMMAND_H #include "../../CommandBase.h" /** * * * @author Matthew */ class FeedUntilPressStateCommand: public CommandBase { private: bool _waitState; public: FeedUntilPressStateCommand(bool waitState, double timeout); virtual void ...
C++
#include "LoadFrisbeeCommand.h" #include "FeedUntilPressStateCommand.h" LoadFrisbeeCommand::LoadFrisbeeCommand() { AddSequential(new FeedUntilPressStateCommand(false, 1.5)); AddSequential(new FeedUntilPressStateCommand(true, 1.5)); }
C++
#include "UnjamLoaderCommand.h" UnjamLoaderCommand::UnjamLoaderCommand() { Requires(loader); SetTimeout(0.6); } // Called just before this Command runs the first time void UnjamLoaderCommand::Initialize() { loader->SetFeederMotor(-1.0); } // Called repeatedly when this Command is scheduled to run v...
C++
#include "FireShotCommand.h" #include "FeedUntilPressStateCommand.h" #include "LoadFrisbeeCommand.h" class FireShotEngageCommand: public CommandBase { private: bool _on; public: FireShotEngageCommand(double timeout, bool on) { this->SetTimeout(timeout); this->_on = on; Requires(loader); } /...
C++
#ifndef UNJAMLOADERCOMMAND_H #define UNJAMLOADERCOMMAND_H #include "../../CommandBase.h" /** * * * @author Matthew */ class UnjamLoaderCommand: public CommandBase { public: UnjamLoaderCommand(); virtual void Initialize(); virtual void Execute(); virtual bool IsFinished(); virtual void End();...
C++
#include "FeedUntilPressStateCommand.h" FeedUntilPressStateCommand::FeedUntilPressStateCommand(bool waitState, double timeout) { this->_waitState = waitState; this->SetTimeout(timeout); Requires(loader); } void FeedUntilPressStateCommand::Initialize() { loader->SetFeederMotor(1.0); } void FeedUn...
C++
#ifndef STARTLAUNCHERCOMMAND_H #define STARTLAUNCHERCOMMAND_H #include "../../../CommandBase.h" /** * * * @author Matthew */ class StartLauncherCommand: public CommandBase { public: StartLauncherCommand(); virtual void Initialize(); virtual void Execute(); virtual bool IsFinished(); virtual ...
C++
#include "StopLauncherCommand.h" StopLauncherCommand::StopLauncherCommand() { Requires(launcher); } // Called just before this Command runs the first time void StopLauncherCommand::Initialize() { launcher->SetLauncherSpeed(0); } // Called repeatedly when this Command is scheduled to run void StopLaun...
C++
#ifndef STOPLAUNCHERCOMMAND_H #define STOPLAUNCHERCOMMAND_H #include "../../../CommandBase.h" /** * * * @author Matthew */ class StopLauncherCommand: public CommandBase { public: StopLauncherCommand(); virtual void Initialize(); virtual void Execute(); virtual bool IsFinished(); virtual void...
C++
#include "StartLauncherCommand.h" StartLauncherCommand::StartLauncherCommand() { Requires(launcher); } // Called just before this Command runs the first time void StartLauncherCommand::Initialize() { launcher->SetLauncherSpeed(LAUNCHER_SPEED); } // Called repeatedly when this Command is scheduled to r...
C++
#ifndef FIRESHOTCOMMAND_H #define FIRESHOTCOMMAND_H #include "Commands/CommandGroup.h" #include "../../CommandBase.h" /** * * * @author Matthew */ class FireShotCommand: public CommandGroup { public: FireShotCommand(); }; #endif
C++
#include "SetCoastBrakeCommand.h" SetCoastBrakeCommand::SetCoastBrakeCommand(CANJaguar::NeutralMode mode) { this->m_mode = mode; isdone = false; } // Called just before this Command runs the first time void SetCoastBrakeCommand::Initialize() { drive->SetCoastBrakeMode(this->m_mode); } void SetCoastB...
C++
#ifndef TANKDRIVECOMMAND_H #define TANKDRIVECOMMAND_H #include "../../CommandBase.h" /** * * * @author Matthew */ class TankDriveCommand: public CommandBase { public: TankDriveCommand(); virtual void Execute(); virtual void Initialize(); virtual bool IsFinished(); virtual void End(); virtu...
C++
#include "TankDriveCommand.h" TankDriveCommand::TankDriveCommand() { Requires(drive); } void TankDriveCommand::Initialize() { } // Called repeatedly when this Command is scheduled to run void TankDriveCommand::Execute() { float l = oi->GetStickLeftY(); float r = oi->GetStickRightY(); drive->...
C++
#ifndef SETCOASTBRAKECOMMAND_H #define SETCOASTBRAKECOMMAND_H #include "../../CommandBase.h" /** * * * @author Matthew */ class SetCoastBrakeCommand: public CommandBase { private: CANJaguar::NeutralMode m_mode; bool isdone; public: SetCoastBrakeCommand(CANJaguar::NeutralMode m_mode); virtual ...
C++
#include "ShiftHighCommand.h" ShiftHighCommand::ShiftHighCommand() { // Use requires() here to declare subsystem dependencies // eg. requires(chassis); } // Called just before this Command runs the first time void ShiftHighCommand::Initialize() { drive->ShiftHigh(); } bool ShiftHighCommand::IsFinish...
C++
#ifndef SHIFTLOWCOMMAND_H #define SHIFTLOWCOMMAND_H #include "../../CommandBase.h" /** * * * @author Matthew */ class ShiftLowCommand: public CommandBase { public: ShiftLowCommand(); virtual void Initialize(); virtual bool IsFinished(); virtual void Execute(); virtual void End(); virtual...
C++
#include "ShiftLowCommand.h" ShiftLowCommand::ShiftLowCommand() { // Use requires() here to declare subsystem dependencies // eg. requires(chassis); } void ShiftLowCommand::Initialize() { drive->ShiftLow(); } bool ShiftLowCommand::IsFinished() { return true; } void ShiftLowCommand::Execute() {...
C++
#ifndef SHIFTHIGHCOMMAND_H #define SHIFTHIGHCOMMAND_H #include "../../CommandBase.h" /** * * * @author Matthew */ class ShiftHighCommand: public CommandBase { public: ShiftHighCommand(); virtual void Initialize(); virtual bool IsFinished(); virtual void Execute(); virtual void End(); vi...
C++
#ifndef GYROROTATECOMMAND_H #define GYROROTATECOMMAND_H #include "../../../CommandBase.h" #include "WPILib.h" /** * * * @author Matthew */ class GyroRotateCommand: public CommandBase, public PIDOutput, public PIDSource { private: PIDController* pid; float headingGoal; public: GyroRotateCommand...
C++
#include "GyroRotateCommand.h" #include "../../../logging.h" GyroRotateCommand::GyroRotateCommand() { //Requires(drive); // We require the drivetrain } void GyroRotateCommand::SetParams(double headingDiff, double timeout) { this->gyro->ResetYaw(); this->SetTimeout(timeout); this->headingGoal = headi...
C++
#include "CommandBase.h" CommandBase::CommandBase(const char *name) : Command(name) { } CommandBase::CommandBase() : Command() { } // Initialize a single static instance of all of your subsystems to NULL FrisbeeLauncher* CommandBase::launcher = NULL; FrisbeeLoader* CommandBase::loader = NULL; DriveS...
C++
#include "OI.h" #include "Commands/Climber/ClimbCommand.h" #include "Commands/Drive/SetCoastBrakeCommand.h" #include "Commands/Drive/ShiftHighCommand.h" #include "Commands/Drive/ShiftLowCommand.h" #include "Commands/Drive/TankDriveCommand.h" #include "Commands/Launcher/LauncherMotors/StartLauncherCommand.h" #i...
C++
#ifndef RANDOM_H #define RANDOM_H #include <stdint.h> #define NUM_MAX 624 /* class Random { public: void getSeed(uint32_t); // virtual void getState(uint32_t *); // virtual uint32_t saveState(uint32_t *, uint32_t *); virtual uint32_t rand(); protected: uint32_t SEED; }; */ class Mersenne_Twister //: publi...
C++
#include <fstream> #include <iostream> #include <sstream> #include <cstdlib> #include "bsp-generator.h" #include "map.h" Map::Map(Mersenne_Twister *mt, std::string filename) { RNG = mt; loadMap(filename); } Map::~Map() { MAP.clear(); } /* bool Map::isBlocked(Object *viewer, Object *viewed) { int dx, dy, absx, ab...
C++
#include <iostream> #include <cstdlib> #include <cstring> #include <curses.h> #include "window.h" Curses_Window::Curses_Window(Map *map) { MAP = map; QUIT = false; // Initialize ncurses windows initscr(); keypad(stdscr, true); nonl(); cbreak(); noecho(); // Create the windows // GAME = newwin(50, 50, 1...
C++
#ifndef MAP_H #define MAP_H #include <string> #include <vector> #include "double-linked-list.h" #include "object.h" #include "random.h" class Map { public: Map(Mersenne_Twister *, /*Double_Linked_List *,*/ std::string); ~Map(); // bool isBlocked(Object *, Object *); bool isBlocked(int, int); bool isEmpty(int, in...
C++
#ifndef DOUBLE_LINKED_LIST #define DOUBLE_LINKED_LIST #include "object.h" class Node { public: Node(Object *, Node *, Node *); ~Node(); // Object *OBJECT; // Node *PREVIOUS; // Node *NEXT; Node *next(); Node *previous(); Object *object(); void setNext(Node *); private: Node *NEXT; Node *PREVIOUS; Object *OB...
C++
#include <iostream> #include <cstdlib> #include "bsp-generator.h" Room::Room(int xx1, int xx2, int yy1, int yy2) { x1 = xx1; x2 = xx2; y1 = yy1; y2 = yy2; // std::cout << x1 << " " << x2 << " " << y1 << " " << y2 << std::endl; } Tree_Node::Tree_Node(Tree_Node *myparent, int x1, int x2, int y1, int y2) { room =...
C++
#ifndef WINDOW_H #define WINDOW_H #include <string> #include "object.h" #include "map.h" /* class Window { public: // Window(); // ~Window(); virtual void display(Creature *); // virtual void print(std::string); virtual void processInput(Creature *); protected: Map *MAP; }; */ class Curses_Window //: public Windo...
C++
#include "double-linked-list.h" Node::Node(Object *object, Node *previous, Node *next) { OBJECT = object; PREVIOUS = previous; NEXT = next; } Node::~Node() { if (PREVIOUS != NULL) PREVIOUS->NEXT = NEXT; if (NEXT != NULL) NEXT->PREVIOUS = PREVIOUS; // delete OBJECT; } Node *Node::next() { return NEXT; } N...
C++
#ifndef ASTAR_PATHFINDER_H #define ASTAR_PATHFINDER_H #include "double-linked-list.h" #include "map.h" class Astar_Pathfinder { public: Astar_Pathfinder(Map *, int, int, int, int); Double_Linked_List *getPath(); private: Map *MAP; Double_Linked_List *CAMEFROM; // the map of navigated nodes Double_Linked_List *...
C++
#ifndef OBJECT_H #define OBJECT_H #include <string> class Object { public: // Object(); // ~Object(); virtual bool isCreature();// {return false;} virtual bool isItem();// {return false;} virtual bool isTerrain();// {return false;} std::string name(); char symbol(); int x(); int y(); int z(); protected: ...
C++
#ifndef BSP_GENERATOR_H #define BSP_GENERATOR_H #include <vector> #include "random.h" struct Room { Room(int, int, int, int); int x1; int x2; int y1; int y2; }; struct Tree_Node { Tree_Node(Tree_Node *, int, int, int, int); ~Tree_Node(); bool isLeaf(); bool vertical; bool hasldoor; bool hasrdoor; bool ha...
C++
#include <iostream> #include <curses.h> #include <ctime> #include "map.h" #include "object.h" #include "double-linked-list.h" #include "random.h" #include "window.h" using namespace std; #define STARTX 5 #define STARTY 11 #define STARTZ 0 /* void display(Creature *p, Map *m) { m->refresh(); m->set(p->x(),p->y(),p->...
C++
#include "object.h" /* Object::Object() { 5+1; } Object::~Object() { 5+2; } */ bool Object::isCreature() { return false; } bool Object::isItem() { return false; } bool Object::isTerrain() { return false; } std::string Object::name() { return NAME; } char Object::symbol() { return SYM; } int Object::x() { ...
C++
#include "random.h" /* void Random::getSeed(uint32_t seed) { SEED = seed; } */ Mersenne_Twister::Mersenne_Twister(uint32_t seed) { W = 32; N = 624; M = 397; R = 31; A = 0x9908b0df; U = 1;; S = 7; B = 0x9d2c5680; T = 15; C = 0xefc60000; L = 18; INDEX = 0; SEED = seed; initializeGenerator(); } // Initia...
C++
#include <iostream> #include "astar-pathfinder.h" Astar_Pathfinder::Astar_Pathfinder(Map *map, int x1, int y1, int x2, int y2) { MAP = map; X1 = x1; X2 = x2; Y1 = y1; Y2 = y2; CAMEFROM = new Double_Linked_List(); CLOSED = new Double_Linked_List(); OPEN = new Double_Linked_List(); if (!generatePath()) CAM...
C++
/* //device/apps/Quake/quake/src/QW/client/main.c ** ** Copyright 2007, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/...
C++
/* Copyright (C) 1996-1997 Id Software, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distribut...
C++
/* Copyright (C) 1996-1997 Id Software, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in th...
C++
/* Copyright (C) 1996-1997 Id Software, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distribut...
C++
/* Copyright (C) 1996-1997 Id Software, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in th...
C++
#include <unistd.h> #include <signal.h> #include <stdlib.h> #include <limits.h> #include <sys/time.h> #include <sys/types.h> #include <unistd.h> #include <fcntl.h> #include <stdarg.h> #include <stdio.h> #include <sys/ipc.h> #include <sys/shm.h> #include <sys/stat.h> #include <string.h> #include <ctype.h> #include <sys/...
C++
/* Copyright (C) 1996-1997 Id Software, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distribut...
C++
/* Copyright (C) 1996-1997 Id Software, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in th...
C++
/* Copyright (C) 1996-1997 Id Software, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in th...
C++