void WriteMinion(Minion m, DoubleStream stream) { int index = m.ID; stream.WriteOneHot(MinionOneHot, index); stream.Write(m.Sleeping ? 0 : 1); stream.Write(m.Atack / MinionMaxAttack); stream.Write(m.Health / MinionMaxHealth); }
public static void WritePlayer(Player p, DoubleStream stream) { double health = Math.Max(0, p.Hero.Health) / (double)p.Hero.StdHealth; stream.Write(health); // TODO: Attack double mana = p.Mana / (double)Player.ManaCap; stream.Write(mana); double maxmana = p.MaxMana / (double)Player.ManaCap; stream.Write(mana); double heropower = p.Hero.Power.UsedThisTurn ? 0 : 1; stream.Write(heropower); double cardsleft = p.DeckCount / (double)p.StartingCards.Length; stream.Write(cardsleft); }
static void WriteEnemyHand(Player enemy, DoubleStream stream) { stream.Write(enemy.HandCount / (double)Hand.MaxHand); }