예제 #1
0
파일: bigbang.cpp 프로젝트: M4573R/pc-code
 void bellman_ford() {
     Clr(dis);
     Clr(vis);
     for (int i = 1; i < n; i++)
         for (int j = 0; j < m; ++j) {
             Edge &e = edges[j];
             if(dis[e.u] + e.w < dis[e.v])
                 dis[e.v] = dis[e.u] + e.w;
         }
     for (int j = 0; j < m; ++j) {
         Edge &e = edges[j];
         if (!vis[e.u] && dis[e.u] + e.w < dis[e.v])
             dfs(e.u);
     }
 }
예제 #2
0
 static T *
 Get (T *ptr)
 {
   if (Test (ptr))
     {
       return *(T **)Clr (ptr);
     }
   else
     {
       return ptr;
     }
 }
예제 #3
0
파일: bits.cpp 프로젝트: amrsobhy/qminer
void TBSet::Gen(const int& _Bits) {
    if (B4T!=NULL) {
        delete[] B4T;
    }
    Bits=_Bits;
    B4T=new TB4Def::TB4[B4s=(Bits-1)/TB4Def::B4Def.B4Bits+1];
    LastB4Mask=TB4Def::B4Def.MxB4;
    for (int BitN=Bits; BitN<B4s*TB4Def::B4Def.B4Bits; BitN++) {
        LastB4Mask&= ~TB4Def::B4Def.B4P2T[BitN%TB4Def::B4Def.B4Bits];
    }
    Clr();
}
예제 #4
0
const char* TJsonObj::Parse(const char* JsonStr) {
  TChA KeyStr, ValStr;
  Clr();
  const char *c = JsonStr;
  bool Nested = false;
  while (*c && *c!='{') { c++; } // find first '{'
  if (*c) { c++; }
  while (*c && *c!='}') {
    while (*c && *c!='"') { c++; }
    c = GetStr(c, KeyStr); // key -- string
    while (*c && TCh::IsWs(*c)) { c++; }
    EAssertR(*c==':', TStr::Fmt("JSON error: Expect ':' at character %d", int(c-JsonStr)));
    c++;
    while (*c && TCh::IsWs(*c)) { c++; }
    // value
    ValStr.Clr();
    if (*c == '"') { c = GetStr(c, ValStr); } // string
    else if (TCh::IsNum(*c) || (*c=='-' &&  TCh::IsNum(*(c+1)))) {  // number
      while (*c && *c!=',' && *c!='}' && *c!=']' && ! TCh::IsWs(*c)) { ValStr.Push(*c); c++; } }
    else if (*c=='t' || *c=='f' || *c=='n') { // true, false, null
      while (*c && *c!=',' && *c!='}' && *c!=']') { ValStr.Push(*c); c++; } }
    else if (*c=='{') { // nested object
      EAssertR(! KeyObjH.IsKey(KeyStr), TStr::Fmt("JSON error: object with key '%s' already exists", KeyStr.CStr()));
      TJsonObj& Obj = KeyObjH.AddDat(KeyStr);
      c = Obj.Parse(c) + 1;  
      Nested = true;
    }
    else if (*c=='[') { // array
      EAssertR(! KeyArrayH.IsKey(KeyStr), TStr::Fmt("JSON error: array with key '%s' already exists", KeyStr.CStr()));
      TVec<TJsonObj>& Array = KeyArrayH.AddDat(KeyStr);
      c++;
      while (*c && *c!=']') {
        while (*c && TCh::IsWs(*c)) { c++; }
        Array.Add();
        if (*c=='{') { c = Array.Last().Parse(c) + 1; } // nested object
        else { c = Array.Last().ParseArrayVal(c); }
        if (*c && *c==',') { c++; }
      }
      c++; Nested = true;
    }
    else { EFailR(TStr::Fmt("JSON error: Unknown character '%c' at position %d in %s", *c, int(c-JsonStr), JsonStr).CStr()); }
    if (! Nested) {
      EAssertR(! KeyValH.IsKey(KeyStr), TStr::Fmt("JSON error: value with key '%s' already exists", KeyStr.CStr()));
      KeyValH.AddDat(KeyStr, ValStr); }
    while (*c && TCh::IsWs(*c)) { c++; }
    if (*c && *c==',') { c++; }
    while (*c && TCh::IsWs(*c)) { c++; }
  }
  return c;
}
예제 #5
0
파일: check.cpp 프로젝트: lbv/ffa-pc
int main()
{
	int T;
	scanf("%d", &T);
	assert(1 <= T && T <= MAXT);

	for (int t = 1; t <= T; ++t) {
		printf("Testing case %d ..\n", t);
		scanf("%d%d", &N, &M);
		assert(2 <= N && N <= MAXN);
		assert(0 <= M);

		Neg(idx);
		Clr(g);

		for (int i = 0; i < N; ++i) {
			scanf(" %c", &nodes[i]);
			assert(nodes[i] >= 'A' && nodes[i] <= 'Z');
			idx[nodes[i] - 'A'] = i;
		}

		while (M--) {
			char a, b;
			scanf(" %c %c", &a, &b);
			assert(a >= 'A' && a <= 'Z');
			assert(b >= 'A' && b <= 'Z');

			int u = idx[a - 'A'];
			int v = idx[b - 'A'];

			assert(u >= 0 && v >= 0);

			assert(! g[u][v]);
			assert(! g[v][u]);

			g[u][v] = g[v][u] = true;
		}
	}

	puts("OK");

	return 0;
}
예제 #6
0
파일: gen.cpp 프로젝트: M4573R/pc-code
void gen(bool crit = false)
{
#if NL
    puts("");
#endif

    int n = crit ? MAXN : rand() % MAXN + 1;
    printf("%d", n);

    for (int i = 0; i < n; ++i) {
        int busy = rand() % MAXBUSY + 1;
        printf(" %d", busy);
    }
    putchar('\n');

    int minr = n-1;
    int maxr = n*(n-1)/2;
    int r = rand() % (maxr - minr + 1) + minr;

    printf("%d\n", r);

    Clr(g);
    while (r--) {
        int u, v;
        do {
            u = rand() % n;
            v = rand() % n;
        } while (u == v || g[u][v]);
        g[u][v] = true;

        printf("%d %d\n", u+1, v+1);
    }

    int q = crit ? MAXN : rand() % MAXN + 1;
    printf("%d\n", q);

    while (q--) {
        int u = rand() % n;
        printf("%d\n", u + 1);
    }

    --T;
}
예제 #7
0
파일: gen.cpp 프로젝트: M4573R/pc-code
void test_case()
{
	Clr(used);

	for (int i = 0; i < 13; ++i) {
		if (i > 0) putchar(' ');

		int r, s;
		do {
			r = rand() % 13;
			s = rand() % 4;
		} while (used[r][s]);
		used[r][s] = true;

		printf("%c%c", ranks[r], suits[s]);
	}
	puts("");

	--T;
}
예제 #8
0
파일: post.c 프로젝트: apprisi/illumos-gate
int
unpost_form(FORM *f)
{
	if (!f)
		return (E_BAD_ARGUMENT);

	if (!Status(f, POSTED))
		return (E_NOT_POSTED);

	if (Status(f, DRIVER))
		return (E_BAD_STATE);

	term_field(f);
	term_form(f);
	(void) werase(Sub(f));
	(void) delwin(W(f));
	W(f) = (WINDOW *) 0;
	Clr(f, POSTED);
	return (E_OK);
}
예제 #9
0
파일: gen.cpp 프로젝트: M4573R/pc-code
void test_case(bool crit = false)
{
#if NL
	puts("");
#endif

	int n = crit ? MAXN : rand() % (MAXN + 1);
	printf("%d\n", n);

	Clr(used);
	while (n--) {
		int w;
		do {
			w = rand() % (MAXI + 1);
		} while (used[w]);
		used[w] = true;
		printf("%d\n", w);
	}

	--T;
}
예제 #10
0
const char* TJsonObj::ParseArrayVal(const char* JsonStr) {
  const char *c = JsonStr;
  bool Nested = false;
  TChA ValStr;
  Clr();
  while (*c && TCh::IsWs(*c)) { c++; }
  if (*c == '"') { c = GetStr(c, ValStr); } // string
  else if (TCh::IsNum(*c) || (*c=='-' &&  TCh::IsNum(*(c+1)))) {  // number
    while (*c && *c!=',' && *c!='}' && *c!=']' && ! TCh::IsWs(*c)) { ValStr.Push(*c); c++; } }
  else if (*c=='t' || *c=='f' || *c=='n') { // true, false, null
    while (*c && *c!=',' && *c!='}' && *c!=']') { ValStr.Push(*c); c++; } }
  else if (*c=='{') { // nested object
    EAssertR(! KeyArrayH.IsKey("key"), "JSON error: object with key 'key' already exists");
    TJsonObj& Obj = KeyObjH.AddDat("key");
    c = Obj.Parse(c) + 1;  Nested = true;
  }
  else if (*c=='[') { // array
    EAssertR(! KeyArrayH.IsKey("key"), "JSON error: array with key 'key' already exists");
    TVec<TJsonObj>& Array = KeyArrayH.AddDat("key");
      c++;
      while (*c && *c!=']') {
        while (*c && TCh::IsWs(*c)) { c++; }
        Array.Add();
        if (*c=='{') { c = Array.Last().Parse(c) + 1; } // nested object
        else { c = Array.Last().ParseArrayVal(c); }
        if (*c && *c==',') { c++; }
      }
      c++; Nested = true;
  }
  if (! Nested) {
    EAssertR(! KeyArrayH.IsKey("key"), "JSON error: object with key 'key' already exists");
    KeyValH.AddDat("key", ValStr); 
  }
  while (*c && TCh::IsWs(*c)) { c++; }
  return c;
}
예제 #11
0
파일: dp.cpp 프로젝트: M4573R/pc-code
// call with the length of the input string (N) and the number of symbols (S)
void cyk_init(int N, int S)
{
	Clr(_cyk_dp);
	Clr(_cyk_aux);
	CYK_N = N, CYK_S = S;
}
예제 #12
0
////////////////////////////////////////
/// DEFAULT PROGRESS CONTOL STACK //////
////////////////////////////////////////
void StyleProgress::CreateDefaultStack()
{
	// define the rects
	GetClientRect(m_ProgRect); CRect EffRect(m_ProgRect); CRect TopRect(m_ProgRect); 

	// some adustments
	EffRect.DeflateRect(1, 1); 
	TopRect.DeflateRect(1, 1); 

	//=============== Background Layers ===================//
	Stack ProgressBack(m_ProgRect, m_BackColor);

	ProgressBack.SetShape(ROUNDRECT, 1);
	ProgressBack.SetOuterBorder(1, RGB(0xB2, 0xB2, 0xB2));
	ProgressBack.SetMiddleBorder(1, Clr(100,White));
	
	ProgressBack.FillBar(EffRect, LEFT_EDGE, 8, Clr(40,Black), Clr(0,Black));
	ProgressBack.FillBar(EffRect, RIGHT_EDGE, 8, Clr(0,Black), Clr(40,Black));

	float btprof[3] = { 0.0f, 0.20f, 1.0f };
	ProgressBack.FillBar(EffRect, TOP_EDGE, 6, Clr(200,White), Clr(241,White), Clr(40,White), btprof);
	float bbprof[3] = { 0.0f, 0.80f, 1.0f };
	ProgressBack.FillBar(EffRect, BOTTOM_EDGE, 6, Clr(0,White), Clr(100,White), Clr(80,White), bbprof);

	//=========== Foreground Layers ======================//

	Stack ProgressFront(TopRect);
	ProgressFront.FillSolid(TopRect, m_ForeColor);

	// top and bottom

	float tprof[3] = { 0.0f, 0.15f, 1.0f };

	ProgressFront.FillBar(TopRect, TOP_EDGE, 6, Clr(180,White), Clr(200,White), Clr(128,White), tprof);
	ProgressFront.FillBar(TopRect, BOTTOM_EDGE, 6, Clr(0,White), Clr(100,White));

	float lprof[3] = { 0.0f, 0.15f, 1.0f };
	float rprof[3] = { 0.0f, 0.85f, 1.0f };

	ProgressFront.FillBar(TopRect, LEFT_EDGE, 20, Clr(20,Black), Clr(40,Black), Clr(0,Black), lprof);
	ProgressFront.FillBar(TopRect, RIGHT_EDGE, 20, Clr(0,Black), Clr(40,Black), Clr(20,Black), rprof);

	// add it to the style
	AddStack(ProgressBack);
	AddStepStack(ProgressFront);
}
예제 #13
0
파일: PID.cpp 프로젝트: ruby6117/ccode
PID::PID()
  : cb(0), rateHz(1), pleaseStop(false), currRate(0)
{
  Clr(period);
}
예제 #14
0
int
main(int argc, char *argv[])
{
	char command[20];        // the command either internal or external.
	parameters_t parameters; // all other parameters.
	char outpath[1024];      // the path of output redirection.
	char inpath[1024];       // the path of input redirection.
	int flags[2];            // mark if there is any I/O redirection.

	// Check if there is a batch file.
	if (argc == 2)
	{
		commands = fopen(argv[1], "r");
		if (commands == NULL)
		{
			printf("Can't open the file \"%s\"!\n", argv[1]);
			commands = stdin;
		}
	}
	else
		commands = stdin;

	// Set the environment variable SHELL.
	SetMyshell();

	for (Prompt(); fscanf(commands, "%s", command) != EOF; Prompt()) // Initially get the command.
	{
		// Get all other parameters.
		GetParameters(command, &parameters, flags, inpath, outpath);

		// Check if there is a stdout redirection.
		switch (flags[0]) {
		case 1:
			freopen(outpath, "w", stdout);
			break;
		case 2:
			freopen(outpath, "a", stdout);
			break;
		}
		// Check if there is a stdin redirection.
		if (flags[1])
			freopen(inpath, "r", stdin);

		// Run different command correspondingly.
		if (!strcmp(command, "cd"))
			Cd(&parameters);
		else if (!strcmp(command, "clr"))
			Clr();
		else if (!strcmp(command, "cmp"))
			Cmp(&parameters);
		else if (!strcmp(command, "dir"))
			Dir(&parameters);
		else if (!strcmp(command, "echo"))
			Echo(&parameters);
		else if (!strcmp(command, "environ"))
			Environ();
		else if (!strcmp(command, "fgrep"))
			Fgrep(&parameters);
		else if (!strcmp(command, "help"))
			Help();
		else if (!strcmp(command, "pause"))
			Pause();
		else if (!strcmp(command, "pwd"))
			Pwd();
		else if (!strcmp(command, "quit"))
			Quit();
		else if (!strcmp(command, "wc"))
			Wc(&parameters);
		else
			RunExternal(command, &parameters, flags, inpath, outpath);

		// If there was an I/O redirection, restore the stdin/stdout.
		if (flags[0])
			freopen("/dev/tty", "w", stdout);
		if (flags[1])
			freopen("/dev/tty", "r", stdin);
	}

	return 0;
}
예제 #15
0
void CTTToeView::initializeControls(void)
{	
	buttonStyle = new ButtonStyle();
	objectsToDelete.push_back(buttonStyle);

	buttonStyle->finalColor = Clr(215,62,0);
	buttonStyle->finalColorFrame = Clr(52,48,46);
	buttonStyle->startColor = Clr(62,56,52);
	buttonStyle->startColorFrame = Clr(180,180,180);
	buttonStyle->finalStatus = 16;
	buttonStyle->highlightStatus = 3;
	buttonStyle->textColor = Clr(150,150,150);

	buttonStyle2 = new ButtonStyle();
	objectsToDelete.push_back(buttonStyle2);

	buttonStyle2->finalColor = Clr(215,62,0);
	buttonStyle2->finalColorFrame = Clr(52,48,46);
	buttonStyle2->startColor = Clr(62,56,52);
	buttonStyle2->startColorFrame = Clr(180,180,180);
	buttonStyle2->finalStatus = 16;
	buttonStyle2->highlightStatus = 3;
	buttonStyle2->textColor = Clr(225,82,20);

	buttonStyle3 = new ButtonStyle();
	objectsToDelete.push_back(buttonStyle3);

	buttonStyle3->finalColor = Clr(215,62,0);
	buttonStyle3->finalColorFrame = Clr(52,48,46);
	buttonStyle3->startColor = Clr(42,37,34);
	buttonStyle3->startColorFrame = Clr(180,180,180);
	buttonStyle3->finalStatus = 16;
	buttonStyle3->highlightStatus = 3;
	buttonStyle3->textColor = Clr(225,82,20);

	openButtonStyle = new ButtonStyle();
	objectsToDelete.push_back(openButtonStyle);

	openButtonStyle->finalColor = Clr(120,120,120);
	openButtonStyle->finalColorFrame = Clr(100,100,100);
	openButtonStyle->startColor = Clr(42,37,34);
	openButtonStyle->startColorFrame = Clr(40,45,32);
	openButtonStyle->finalStatus = 50;
	openButtonStyle->highlightStatus = 22;
	openButtonStyle->textColor = Clr(215,62,0);

    string s("Empty");


	string l("<");
	string r(">");

	string easyStr("-");
	string hardStr("+");
	
	swingButtonStyle = new SwingButtonStyle();
	objectsToDelete.push_back(swingButtonStyle);

	swingButtonStyle->buttonStyle = buttonStyle;
	swingButtonStyle->labelBGColor = Clr(62,56,52);
	swingButtonStyle->labelBGTransparent = false;
	swingButtonStyle->labelColor = Clr(200,200,200);

	menuNavButtonStyle = new SwingButtonStyle();
	objectsToDelete.push_back(menuNavButtonStyle);

	menuNavButtonStyle->buttonStyle = buttonStyle3;
	menuNavButtonStyle->labelBGColor = Clr(62,56,52);
	menuNavButtonStyle->labelBGTransparent = false;
	menuNavButtonStyle->labelColor = Clr(200,200,200);
	menuNavButtonStyle->labelExists = false;

	//46/16/30
	swb_FieldSize = new SwingButton(FSIZE_DECREASE,FSIZE_INCREASE,Point(20,50),60,178,20,"",l,r,swingButtonStyle);
	objectsToDelete.push_back(swb_FieldSize);
	swb_SubCellSize = new SwingButton(SUBCELLSIZE_DECREASE,SUBCELLSIZE_INCREASE,Point(20,50),60,178,20,"",l,r,swingButtonStyle);
	objectsToDelete.push_back(swb_SubCellSize);
	swb_SubCellNumber = new SwingButton(NUM_OF_SUBCELLS_DECREASE,NUM_OF_SUBCELLS_INCREASE,Point(20,50),60,178,20,"",l,r,swingButtonStyle);
	objectsToDelete.push_back(swb_SubCellNumber);
	swb_GameLevel = new SwingButton(DECREASE_GAME_LEVEL,INCREASE_GAME_LEVEL,Point(20,50),60,178,20,"",easyStr,hardStr,swingButtonStyle);
	objectsToDelete.push_back(swb_GameLevel);
	swb_CellDistance = new SwingButton(DIST_CELL_DECREASE,DIST_CELL_INCREASE,Point(20,50),60,178,20,"",l,r,swingButtonStyle);
    objectsToDelete.push_back(swb_CellDistance);
	swb_RootCellNum = new SwingButton(DECREASE_BASE_SEL_NUM,INCREASE_BASE_SEL_NUM,Point(20,50),60,178,20,"",easyStr,hardStr,swingButtonStyle);
    objectsToDelete.push_back(swb_RootCellNum);
	swb_SearchDepth = new SwingButton(DECREASE_DEPTH,INCREASE_DEPTH,Point(20,50),60,178,20,"",easyStr,hardStr,swingButtonStyle);
    objectsToDelete.push_back(swb_SearchDepth);
	swb_CellNum = new SwingButton(DECREASE_SEL_NUM,INCREASE_SEL_NUM,Point(20,50),60,178,20,"",easyStr,hardStr,swingButtonStyle);
    objectsToDelete.push_back(swb_CellNum);

    bt_Color = new Button(CHANGE_COLOR,Point(0,0),40,178,"Colour",buttonStyle);
    objectsToDelete.push_back(bt_Color);
	bt_Growing = new Button(CHANGE_GROWING,Point(0,0),40,178,"",buttonStyle);
	objectsToDelete.push_back(bt_Growing);
	bt_StylePreset = new Button(CHANGE_STYLE,Point(0,0),40,178,string("Change Style!"),buttonStyle2);
	objectsToDelete.push_back(bt_StylePreset);
    bt_DoubleBuffering = new Button(CHANGE_DOUBLE_BUFFERING,Point(0,0),40,178,string(""),buttonStyle);
	objectsToDelete.push_back(bt_DoubleBuffering);
	bt_FieldFrame = new Button(SHOW_HIDE_FIELD_FRAME,Point(0,0),40,178,string(""),buttonStyle);
	objectsToDelete.push_back(bt_FieldFrame);
	bt_FieldLines = new Button(SHOW_HIDE_SEP_LINES,Point(0,0),40,178,string(""),buttonStyle);
	objectsToDelete.push_back(bt_FieldLines);
	bt_ShowTrack = new Button(SHOW_TRACK,Point(0,0),40,178,string(""),buttonStyle);
	objectsToDelete.push_back(bt_ShowTrack);
	
	menuStyle = new MenuStyle();
	objectsToDelete.push_back(menuStyle);

	menuStyle->bGColor = Clr(62,56,52);
	menuStyle->labelColor = Clr(210,210,210);
	menuStyle->labelBGTransparent = false;
	menuStyle->labelBGColor = Clr(42,37,34);
	menuStyle->labelHeight = 50;
	menuStyle->openButtonStyle = openButtonStyle;
	menuStyle->navigationButtonStyle = menuNavButtonStyle;
	menuStyle->elementsMarginLeft = 1;
	menuStyle->elementsMarginTop = 20;
	menuStyle->panelWidthUnderNavButton = 15;
	menuStyle->marginBetweenElements = 3;
	menuStyle->closeA = 10;
	menuStyle->closeVo = 0;
	menuStyle->openVo = 6;
	menuStyle->openA = - 1;
	menuStyle->maxStickSpeed = 6;
	menuStyle->reflectionCoef = 0.50;
}
예제 #16
0
WindowSFML::WindowSFML()
{
	//constructor
	
	textInit();
	
	err.setPrefix("widap::WindowSFML: ");
	
	drawClr=Clr(0, 0, 0);
	drawAlpha=1;
	data=0;
	
	if (firstInstance)
	{
		/*if
		(
			!font.loadFromFile("/usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-R.ttf") &&
			!font.loadFromFile("/usr/share/fonts/truetype/freefont/FreeMono.ttf") &&
			!font.loadFromFile("/usr/share/fonts/TTF/DejaVuSans.ttf")
		)
		{
			err << "font failed to load" << err;
		}*/
		
		int i;
		
		for (i=0; i<127; ++i)
		{
			key2char[i]=1;
		}
		
		for (i=sf::Keyboard::A; i<=sf::Keyboard::Z; ++i) //letters
			key2char[i]=i-sf::Keyboard::A+int('A');
			
		for (i=sf::Keyboard::Num0; i<=sf::Keyboard::Num9; ++i) //number row
			key2char[i]=i-sf::Keyboard::Num0+int('0');
			
		for (i=sf::Keyboard::Numpad0; i<=sf::Keyboard::Numpad9; ++i) //number pad
			key2char[i]=i-sf::Keyboard::Numpad0+int('0');
			
		key2char[int(sf::Keyboard::Space)]=' ';
		key2char[int(sf::Keyboard::Period)]='.';
		key2char[int(sf::Keyboard::Comma)]=',';
		key2char[int(sf::Keyboard::BackSlash)]='\\';
		key2char[int(sf::Keyboard::Slash)]='/';
		key2char[int(sf::Keyboard::LBracket)]='[';
		key2char[int(sf::Keyboard::RBracket)]=']';
		key2char[int(sf::Keyboard::Quote)]='\'';
		key2char[int(sf::Keyboard::SemiColon)]=';';
		key2char[int(sf::Keyboard::Delete)]=127;
		key2char[int(sf::Keyboard::BackSpace)]='\b';
		key2char[int(sf::Keyboard::Return)]='\n';
		key2char[int(sf::Keyboard::Tab)]='\t';
		key2char[int(sf::Keyboard::Equal)]='=';
		key2char[int(sf::Keyboard::Dash)]='-';
		key2char[int(sf::Keyboard::Left)]='a'; //I use lower key2char[int(wasd for arrow keys)]
		key2char[int(sf::Keyboard::Right)]='d';
		key2char[int(sf::Keyboard::Up)]='w';
		key2char[int(sf::Keyboard::Down)]='s';
		
		firstInstance=0;
	}
}
예제 #17
0
void CTTToeView::initializeDrawSet()
{
	//--background--------------------------

	PenSet* bgPenSet = new PenSet();
	objectsToDelete.push_back(bgPenSet);

	bgPenSet->addPen(PenObject(0,1,GlobalSettings::backgroundClr.getRGB()));
	DS.setPenSet(DSI_BACKGROUND_SETS, *bgPenSet);

	BrushSet* bgBrushSet = new BrushSet();
	objectsToDelete.push_back(bgBrushSet);

	bgBrushSet->addBrush(BrushObject(GlobalSettings::backgroundClr.getRGB()));
	DS.setBrushSet(DSI_BACKGROUND_SETS, *bgBrushSet);
	//--field background----------------------
	PenSet* fieldBgPenSet = new PenSet();
	objectsToDelete.push_back(fieldBgPenSet);

	fieldBgPenSet->addPen(PenObject(0,1,RGB(20,20,20)));
	DS.setPenSet(DSI_FIELD_BACKGROUND_SETS, *fieldBgPenSet);

	BrushSet* fieldBgBrushSet = new BrushSet();
	objectsToDelete.push_back(fieldBgBrushSet);

	fieldBgBrushSet->addBrush(BrushObject(RGB(20,20,20)));
	DS.setBrushSet(DSI_FIELD_BACKGROUND_SETS, *fieldBgBrushSet);
	//--field frame---------------------------

	PenSet* fieldFramePenSet = new PenSet();
	objectsToDelete.push_back(fieldFramePenSet);

	fieldFramePenSet->addPen(PenObject(0,1,RGB(1,1,2)));
	DS.setPenSet(DSI_FIELD_FRAME_SETS, *fieldFramePenSet);

	BrushSet* fieldFrameBrushSet = new BrushSet();
	objectsToDelete.push_back(fieldFrameBrushSet);

	fieldFrameBrushSet->addBrush(BrushObject(RGB(1,1,2)));
	DS.setBrushSet(DSI_FIELD_FRAME_SETS, *fieldFrameBrushSet);

	//--field background2----------------------
	PenSet* fieldBgPenSet2 = new PenSet();
	objectsToDelete.push_back(fieldBgPenSet2);

	fieldBgPenSet2->addPen(PenObject(0,1,RGB(220,220,220)));
	DS.setPenSet(DSI_FIELD_BACKGROUND_SETS_2, *fieldBgPenSet2);

	BrushSet* fieldBgBrushSet2 = new BrushSet();
	objectsToDelete.push_back(fieldBgBrushSet2);

	fieldBgBrushSet2->addBrush(BrushObject(RGB(220,220,220)));
	DS.setBrushSet(DSI_FIELD_BACKGROUND_SETS_2, *fieldBgBrushSet2);
	//--field frame2---------------------------

	PenSet* fieldFramePenSet2 = new PenSet();
	objectsToDelete.push_back(fieldFramePenSet2);

	fieldFramePenSet2->addPen(PenObject(0,1,RGB(60,60,60)));
	DS.setPenSet(DSI_FIELD_FRAME_SETS_2, *fieldFramePenSet2);

	BrushSet* fieldFrameBrushSet2 = new BrushSet();
	objectsToDelete.push_back(fieldFrameBrushSet2);

	fieldFrameBrushSet2->addBrush(BrushObject(RGB(60,60,60)));
	DS.setBrushSet(DSI_FIELD_FRAME_SETS_2, *fieldFrameBrushSet2);


	//------------------------------------------------

	//--User------------------------------------------
	PenSet* userPenSet = new PenSet();
	objectsToDelete.push_back(userPenSet);

	userPenSet->fill2(Clr(70,35,35), Clr(225,115,115), Clr(185,100,100), Clr(55,20,20), settings.posnum/2 + 1, settings.posnum);

	DS.setPenSet(DSI_CELL_USER_SETS, *userPenSet);

	BrushSet* userBrushSet = new BrushSet();
	objectsToDelete.push_back(userBrushSet);

	userBrushSet->fill(Clr(150,10,10),Clr(255,115,115),settings.posnum);

	DS.setBrushSet(DSI_CELL_USER_SETS, *userBrushSet);

	//--ai---------------------------------------------

	PenSet* aiPenSet = new PenSet();
	objectsToDelete.push_back(aiPenSet);

	aiPenSet->fill2(Clr(35,35,70), Clr(115,115,225), Clr(100,100,185), Clr(20,20,55), settings.posnum/2 + 1, settings.posnum);

	DS.setPenSet(DSI_CELL_AI_SETS, *aiPenSet);

	BrushSet* aiBrushSet = new BrushSet();
	objectsToDelete.push_back(aiBrushSet);

	aiBrushSet->fill(Clr(10,10,150),Clr(115,115,255),settings.posnum);

	DS.setBrushSet(DSI_CELL_AI_SETS, *aiBrushSet);

	//--empty------------------------------------------

	BrushSet* emptyBrushSet = new BrushSet();
	objectsToDelete.push_back(emptyBrushSet);

	emptyBrushSet->fill(Clr(100,100,100),Clr(215,215,215),settings.posnum);

	DS.setBrushSet(DSI_CELL_EMPTY_SETS, *emptyBrushSet);

	PenSet* emptyPenSet = new PenSet();
	objectsToDelete.push_back(emptyPenSet);

	emptyPenSet->fill2(Clr(50,50,50), Clr(220,220,220), Clr(180,180,180), Clr(40,40,40), settings.posnum/2 + 1, settings.posnum);

	DS.setPenSet(DSI_CELL_EMPTY_SETS, *emptyPenSet);

	//--User2------------------------------------------
	PenSet* userPenSet2 = new PenSet();
	objectsToDelete.push_back(userPenSet2);

	userPenSet2->fill2(Clr(190,30,30), Clr(90,20,20), Clr(105,35,35), Clr(255,180,180), settings.posnum/2 + 1, settings.posnum);

	DS.setPenSet(DSI_CELL_USER_SETS_2, *userPenSet2);

	BrushSet* userBrushSet2 = new BrushSet();
	objectsToDelete.push_back(userBrushSet2);

	userBrushSet2->fill(Clr(235,40,40),Clr(130,15,15),settings.posnum);

	DS.setBrushSet(DSI_CELL_USER_SETS_2, *userBrushSet2);

	//--ai2---------------------------------------------

	PenSet* aiPenSet2 = new PenSet();
	objectsToDelete.push_back(aiPenSet2);

	aiPenSet2->fill2(Clr(30,30,190), Clr(20,20,90), Clr(35,35,105), Clr(180,180,255), settings.posnum/2 + 1, settings.posnum);

	DS.setPenSet(DSI_CELL_AI_SETS_2, *aiPenSet2);

	BrushSet* aiBrushSet2 = new BrushSet();
	objectsToDelete.push_back(aiBrushSet2);

	aiBrushSet2->fill(Clr(40,40,235),Clr(15,15,130),settings.posnum);

	DS.setBrushSet(DSI_CELL_AI_SETS_2, *aiBrushSet2);

	//--empty2------------------------------------------

	BrushSet* emptyBrushSet2 = new BrushSet();
	objectsToDelete.push_back(emptyBrushSet2);

	emptyBrushSet2->fill(Clr(165,165,165),Clr(80,80,80),settings.posnum);

	DS.setBrushSet(DSI_CELL_EMPTY_SETS_2, *emptyBrushSet2);

	PenSet* emptyPenSet2 = new PenSet();
	objectsToDelete.push_back(emptyPenSet2);

	emptyPenSet2->fill2(Clr(175,175,175), Clr(60,60,60), Clr(75,75,75), Clr(215,215,215), settings.posnum/2 + 1, settings.posnum);
	
	DS.setPenSet(DSI_CELL_EMPTY_SETS_2, *emptyPenSet2);
}