00001 00005 /* 00006 This file is part of Advanced Strategic Command; http://www.asc-hq.de 00007 Copyright (C) 1994-2003 Martin Bickel and Marc Schellenberger 00008 00009 This program is free software; you can redistribute it and/or modify 00010 it under the terms of the GNU General Public License as published by 00011 the Free Software Foundation; either version 2 of the License, or 00012 (at your option) any later version. 00013 00014 This program is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU General Public License for more details. 00018 00019 You should have received a copy of the GNU General Public License 00020 along with this program; see the file COPYING. If not, write to the 00021 Free Software Foundation, Inc., 59 Temple Place, Suite 330, 00022 Boston, MA 02111-1307 USA 00023 */ 00024 00025 #ifndef clipboardH 00026 #define clipboardH 00027 00028 #include "libs/loki/Singleton.h" 00029 #include "basestrm.h" 00030 #include "vehicletype.h" 00031 #include "buildingtype.h" 00032 #include "typen.h" 00033 00034 class ClipBoardBase { 00035 tmemorystreambuf buf; 00036 enum Type { ClipVehicle, ClipBuilding }; 00037 int objectNum; 00038 00039 friend struct Loki::CreateUsingNew<ClipBoardBase>; 00040 ClipBoardBase(); 00041 ~ClipBoardBase() {}; 00042 public: 00043 void clear(); 00044 void addUnit ( Vehicle* unit ); 00045 void addBuilding ( Building* bld ); 00046 Vehicle* pasteUnit(); 00047 Vehicle* pasteUnit( tnstream& stream); 00048 void place ( const MapCoordinate& pos ); 00049 00050 void write( tnstream& stream ); 00051 void read( tnstream& stream ); 00052 }; 00053 00054 typedef Loki::SingletonHolder< ClipBoardBase > ClipBoard; 00055 00056 extern const char* clipboardFileExtension; 00057 00058 00059 #endif 00060
1.4.2