public CustomMouseCursor(FrameworkElement parent, ArcBot player) { _parent = parent; _player = player; parent.MouseMove += Parent_MouseMove; parent.MouseEnter += Parent_MouseEnter; parent.MouseLeave += Parent_MouseLeave; _children = new VisualCollection(this); var ellipse = CreateEllipse(30); _brush = ellipse.Item2; _children.Add(ellipse.Item1); this.Width = 30; this.Height = 30; this.HorizontalAlignment = HorizontalAlignment.Left; this.VerticalAlignment = VerticalAlignment.Top; this.IsHitTestVisible = false; this.Cursor = Cursors.None; _parent.Cursor = Cursors.None; // Transform _scale = new ScaleTransform(1, 1); _translate = new TranslateTransform(0, 0); TransformGroup transform = new TransformGroup(); transform.Children.Add(_scale); transform.Children.Add(_translate); this.RenderTransform = transform; }
public RamWeapon(RamWeaponDNA dna, ArcBot bot, Viewport3D viewport) { _bot = bot; _viewport = viewport; this.DNA = dna; }
public FitnessRule_TooStill(ArcBot bot, double stationarySpeed, double maxAllowedStationaryTime) { this.Bot = bot; _stationarySpeed = stationarySpeed; _maxAllowedStationaryTime = maxAllowedStationaryTime; }
public FitnessRule_TooFar(ArcBot bot, Point3D center, double maxSafeDistance, double maxUnsafeDistance) { this.Bot = bot; _center = center; _maxSafeDistance = maxSafeDistance; _maxUnsafeDistance = maxUnsafeDistance; }
private FitnessTracker GetRules(ArcBot bot = null) { //TODO: Base this on a tempate that was passed into the constructor List<Tuple<IFitnessRule, double>> rules = new List<Tuple<IFitnessRule, double>>(); rules.Add(new Tuple<IFitnessRule, double>(new FitnessRule_TooFar(bot, new Point3D(0, 0, 0), HOMINGRADIUS, HOMINGRADIUS * 2d), 1d)); rules.Add(new Tuple<IFitnessRule, double>(new FitnessRule_TooStill(bot, .1, 1), 1d)); rules.Add(new Tuple<IFitnessRule, double>(new FitnessRule_TooTwitchy(bot, -.8), 1d)); return new FitnessTracker(bot, rules.ToArray()); }
private FitnessTracker GetRules(ArcBot bot = null) { //TODO: Base this on a tempate that was passed into the constructor List <Tuple <IFitnessRule, double> > rules = new List <Tuple <IFitnessRule, double> >(); rules.Add(new Tuple <IFitnessRule, double>(new FitnessRule_TooFar(bot, new Point3D(0, 0, 0), HOMINGRADIUS, HOMINGRADIUS * 2d), 1d)); rules.Add(new Tuple <IFitnessRule, double>(new FitnessRule_TooStill(bot, .1, 1), 1d)); rules.Add(new Tuple <IFitnessRule, double>(new FitnessRule_TooTwitchy(bot, -.8), 1d)); return(new FitnessTracker(bot, rules.ToArray())); }
private readonly double _ruleCount; // storing this as a double to speed up the score get #endregion #region Constructor public FitnessTracker(ArcBot bot, Tuple <IFitnessRule, double>[] rules) { if (bot != null) { if (rules.Any(o => o.Item1.Bot.Token != bot.Token)) { throw new ArgumentException("All rules must be for the same bot"); } } this.Bot = bot; _rules = rules; _ruleCount = _rules.Length; }
public void ShowInventories(Shop shop, ArcBot bot) { _shop = shop; _bot = bot; _animationRotates.Clear(); if (bot.Weapon == null) { this.AttachedWeaponID = null; } else { this.AttachedWeaponID = bot.Weapon.DNA.UniqueID; bot.AttachWeapon(null, ItemToFrom.Nowhere, ItemToFrom.Inventory); } //TODO: When the user can create weapons in the shop, this will need to be recalculated, and all item cameras need to be adjusted double maxWeaponRadius = UtilityCore.Iterate(shop.Inventory.Weapons, bot.Inventory.Weapons).Max(o => o.Radius); LoadInventory(lstShopInventory, shop.Inventory, _animationRotates, maxWeaponRadius); LoadInventory(lstBotInventory, bot.Inventory, _animationRotates, maxWeaponRadius); }
public FitnessRule_TooTwitchy(ArcBot bot, double minDot) { this.Bot = bot; _minDot = minDot; }
private readonly double _ruleCount; // storing this as a double to speed up the score get #endregion #region Constructor public FitnessTracker(ArcBot bot, Tuple<IFitnessRule, double>[] rules) { if (bot != null) { if (rules.Any(o => o.Item1.Bot.Token != bot.Token)) { throw new ArgumentException("All rules must be for the same bot"); } } this.Bot = bot; _rules = rules; _ruleCount = _rules.Length; }