public ObjectCoor(int x, int y, char gist, TypeObect type) { this.x = x; this.y = y; this.gist = gist; this.type = type; }
public void Move(string MoveOption, TypeObect type) { const int step = 1; switch (MoveOption)//todo pn enum { case "Up": { moveOrInteraction(0, step, type); //todo pn хардкод, а если мы его решим прокачать и он начнет носиться по карте? break; } case "Left": { moveOrInteraction(-step, 0, type); break; } case "Down": { moveOrInteraction(0, -step, type); break; } case "Right": { moveOrInteraction(step, 0, type); break; } } }
public Unit(int x, int y, char gist, TypeObect type, int attack, int maxHP) { Core = new ObjectCoor(x, y, gist, type); MaxHP = maxHP; this.HP = maxHP; Attack = attack; Live = true;//todo pn т.е. у тебя в игре на карте трупы будут валяться?)(будет отчистка по этому критерию ) }
public override void moveOrInteraction(int biasX, int biasY, TypeObect type, int damage = 0) { if (type == TypeObect.Space) { Core.SetPosition(Core.X + biasX, Core.Y + biasY); } else { MoveLogic++; } }
public override void moveOrInteraction(int biasX, int biasY, TypeObect type, int damage = 0) { switch (type)//todo pn type должен быть enum в этом случае { case TypeObect.Space: { Core.SetPosition(Core.X + biasX, Core.Y + biasY); break; } case TypeObect.Enemy: { Live = false; break; } case TypeObect.Bonus: { Core.SetPosition(Core.X + biasX, Core.Y + biasY); HP++; break; } } }
public Hero(int x, int y, char gist, TypeObect type, int atk, int HP) : base(x, y, gist, type, atk, HP) { }
abstract public void moveOrInteraction(int biasX, int biasY, TypeObect type, int damage = 0);//смещение по X,Y, встреченный объект