public int addNewChess(int xx, int yy, int dir, int ownner) { LiuheChess nlc = new LiuheChess(xx, yy, dir, ownner, IdentityNumberNow); chesses.Add(nlc); ChessBoardStateInfo cbsi = checkChessBoardState(); if (cbsi.state != ChessBoardState.HEALTH) { LiuheLogger.Log(cbsi); chesses.Remove(nlc); return(-1); } List <int> dirs = Rules.Rules.getUsableDirection(this); if (!dirs.Contains(dir)) { chesses.Remove(nlc); return(-2); } places.Add(new PlaceMemory(ownner, IdentityNumberNow, dir)); if (places.Count > 2) { places.RemoveAt(0); } IdentityNumberNow++; return(IdentityNumberNow - 1); }
public bool isPosEqual(LiuheChess that) { if (this.x == that.x && this.y == that.y) { return(true); } return(false); }
public int makeNewChess(int xx, int yy, int dir, int ownner) { LiuheChess nlc = new LiuheChess(xx, yy, dir, ownner, IdentityNumberNow); chesses.Add(nlc); IdentityNumberNow++; return(IdentityNumberNow - 1); }
public int addNewChessUnSafe(int xx, int yy, int dir, int ownner) { LiuheChess nlc = new LiuheChess(xx, yy, dir, ownner, IdentityNumberNow); chesses.Add(nlc); places.Add(new PlaceMemory(ownner, IdentityNumberNow, dir)); if (places.Count > 2) { places.RemoveAt(0); } IdentityNumberNow++; return(IdentityNumberNow - 1); }
public LiuheChess getCopy() { LiuheChess lc = new LiuheChess(this.x, this.y, this.dir, this.ownner, this.identityNumber); lc.health = this.health; lc.absorb = this.absorb; lc.attack = this.attack; foreach (BufferEffect be in this.buffers) { lc.buffers.Add(be.getCopy()); } return(lc); }
public bool isIDEqual(LiuheChess that) { return(that.identityNumber == this.identityNumber); }