Skip to content

Instantly share code, notes, and snippets.

@tetsuzuki tetsuzuki/struct.cpp
Created Feb 12, 2014

Embed
What would you like to do?
#include "struct.h"
Pos Pos::operator + (Pos& pos){
Pos ret;
ret.dan = dan + pos.dan;
ret.suji = suji + pos.suji;
return ret;
}
Pos& Pos::operator += (Pos& pos){
dan += pos.dan;
suji += pos.suji;
return *this;
}
Pos Pos::operator - (Pos& pos){
Pos ret;
ret.dan = dan - pos.dan;
ret.suji = suji - pos.suji;
return ret;
}
Pos& Pos::operator -= (Pos& pos){
dan -= pos.dan;
suji -= pos.suji;
return *this;
}
Pos Pos::operator * (int& x){
Pos ret;
ret.dan = dan * x;
ret.suji = suji * x;
return ret;
}
bool Pos::operator == (Pos &pos){
return (pos.dan == dan && pos.suji == suji);
}
Te::Te()
{
from.dan = 0; from.suji = 0; to.dan = 0; to.suji = 0;
koma = 0;
capture = 0;
promotion = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.