public ReferenceExpressionEater(IEater eater, ExpressionKindHelper kindHelper, EatExpressionHelper eatExpressionHelper, ITypeEater typeEater) : base(eater) { _kindHelper = kindHelper; _eatExpressionHelper = eatExpressionHelper; _typeEater = typeEater; }
protected override void Start() { FoodTargets = new List <Transform>(); PredatorTargets = new List <Transform>(); base.Start(); PredatorDetected = false; FoodDetected = false; Detection = GetComponent <UnitDetection>(); Eater = GetComponent <IEater>(); Eatable = GetComponent <IEatable>(); Exhausted = GetComponent <Exhaustion>(); SubGoal s1 = new SubGoal(State.NotHungry, 1, false); // Add it to the goals goals.Add(s1, 0); SubGoal s2 = new SubGoal(State.NotExhausted, 1, false); // Add it to the goals goals.Add(s2, 0); SubGoal s3 = new SubGoal(State.NotEaten, 1, false); // Add it to the goals goals.Add(s3, 2); Detection.OnTargetsUpdated += FilterEatableTargets; Detection.OnTargetsUpdated += FilterEaterTargets; }
/// <summary> /// The animal eats. /// </summary> /// <param name="eater">The intended animal.</param> /// <param name="food">The animal's food.</param> public void Eat(IEater eater, Food food) { // Increase animal's weight as a result of eating food. eater.Weight += food.Weight * (eater.WeightGainPercentage / 100); this.ShowAffection(); }
static void Main(string[] args) { IWorker[] workers = new IWorker[3] { new Manager(), new Worker(), new Robot() }; foreach (var worker in workers) { worker.Work(); } IEater[] eaters = new IEater[2] { new Manager(), new Worker() }; foreach (var eater in eaters) { eater.Eat(); } ISalary[] salaries = new ISalary[2] { new Manager(), new Worker() }; foreach (var salary in salaries) { salary.GetSalary(); } Console.ReadLine(); }
public ParentReferenceEater([NotNull] IEater eater) { if (eater == null) throw new ArgumentNullException("eater"); _eater = eater; }
/// <summary> /// Eats the food. /// </summary> /// <param name="eater"> The eater eating the food.</param> /// <param name="food"> The food being ate,</param> public void Eat(IEater eater, Food food) { // Eats the food. // Happy they ate food. this.ShowAffection(); }
public Fish(IMap map, IGrowable growable, IMovable movable, IEater eater, IEatable eatable, IGender gender, DeathEvent deathEvent, IEventRecorder eventRecorder) : base(map, growable, movable, eater, gender, deathEvent, eventRecorder) { Hp = 10; _eatable = eatable; _eatable.EatableOwner = this; }
private void Start() { Eater = GetComponent <IEater>(); Eatable = GetComponent <IEatable>(); Exhaustion = GetComponent <Exhaustion>(); WanderOrigin = new Vector3(0, 0, 1); aiActive = true; }
protected StatementEater([NotNull] IEater eater) { if (eater == null) { throw new ArgumentNullException("eater"); } Eater = eater; }
protected VariableDeclarationEater([NotNull] IEater eater) { if (eater == null) { throw new ArgumentNullException("eater"); } Eater = eater; }
protected QueryClauseEater([NotNull] IEater eater) { if (eater == null) { throw new ArgumentNullException("eater"); } Eater = eater; }
public ParentReferenceEater([NotNull] IEater eater) { if (eater == null) { throw new ArgumentNullException("eater"); } _eater = eater; }
/// <summary> /// The animal eats. /// </summary> /// <param name="eater">The intended animal.</param> /// <param name="food">The animal's food.</param> public void Eat(IEater eater, Food food) { this.BuryBone(food); this.DigUpAndEatBone(); // Increase animal's weight as a result of eating food. eater.Weight += food.Weight * (eater.WeightGainPercentage / 100); this.Bark(); }
/// <summary> /// Eats the specified food. /// </summary> /// <param name="eater">The eater that will consume the food.</param> /// <param name="food">The food to eat.</param> public void Eat(IEater eater, Food food) { this.BuryBone(food); this.DigUpAndEatBone(); // Increase the animal's weight by the weight of the food eaten. eater.Weight += food.Weight; this.Bark(); }
/// <summary> /// Eats the food. /// </summary> /// <param name="eater"> The item that is an eater.</param> /// <param name="food"> The food item being ate.</param> public void Eat(IEater eater, Food food) { // Bury's the food. this.BuryBone(food); // Eats the food. this.DigUpAndEatBone(); // Barks in satisfaction. this.Bark(); }
public void Eat(IEater eater, Food food) { // Eater buries bone. this.BuryBone(food); // Eater digs up the bone. this.DigUpAndEatBone(); // Eater eats the bone. eater.Eat(food); // Eater barks in satisfaction. this.Bark(); }
protected Animal(IMap map, IGrowable growable, IMovable movable, IEater eater, IGender gender, DeathEvent deathEvent, IEventRecorder eventRecorder) : base(map, growable, deathEvent, eventRecorder) { IsPregnant = false; _gender = gender; _gender.GenderOwner = this; _eater = eater; _eater.EaterOwner = this; _movable = movable; _movable.MovableOwner = this; }
public InvocationExpressionEater(IEater eater, EatExpressionHelper expressionHelper, ExpressionKindHelper expressionKindHelper, IParentReferenceEater parentReferenceEater, IArgumentsEater argumentsEater, IMockOfInvocationEater mockOfInvocationEater) : base(eater) { _expressionHelper = expressionHelper; _expressionKindHelper = expressionKindHelper; _parentReferenceEater = parentReferenceEater; _argumentsEater = argumentsEater; _mockOfInvocationEater = mockOfInvocationEater; }
/// <summary> /// Feeds the specified eater. /// </summary> /// <param name="eater">The eater to be fed.</param> /// <param name="animalSnackMachine">The animal snack machine from which to buy food.</param> public void FeedAnimal(IEater eater, VendingMachine animalSnackMachine) { // Find food price. decimal price = animalSnackMachine.DetermineFoodPrice(eater.Weight); // Get money from wallet. decimal payment = this.wallet.RemoveMoney(price); // Buy food. Food food = animalSnackMachine.BuyFood(payment); // Feed animal. eater.Eat(food); }
/// <summary> /// Feeds a baby eater. /// </summary> /// <param name="newborn">The eater to feed.</param> private void FeedNewborn(IEater newborn) { // Determine milk weight. double milkWeight = this.Weight * 0.005; // Generate milk. Food milk = new Food(milkWeight); // Feed baby. newborn.Eat(milk); // Reduce parent's weight. this.Weight -= milkWeight; }
private void OnCollisionEnter2D(Collision2D collision) { IEater eater = collision.gameObject.GetComponent <IEater>(); if (eater == null) { //TODO score substruct, smash animation scoreController.Score -= score; Destroy(gameObject); } else { eater.Eat(this); scoreController.Score += score; } }
/// <summary> /// Feeds the specified eater. /// </summary> /// <param name="eater">The eater to be fed.</param> /// <param name="animalSnackMachine">The animal snack machine from which to buy food.</param> public void FeedAnimal(IEater eater, VendingMachine animalSnackMachine) { // Find food price. decimal price = animalSnackMachine.DetermineFoodPrice(eater.Weight); if (this.wallet.MoneyBalance < price) { // Withdraw 10 times the price of the food. this.WithdrawMoney(price * 10); } // Get money from wallet. decimal payment = this.wallet.RemoveMoney(price); // Buy food. Food food = animalSnackMachine.BuyFood(payment); // Feed animal. eater.Eat(food); }
/// <summary> /// Feeds the specified eater. /// </summary> /// <param name="eater">The eater to be fed.</param> /// <param name="animalSnackMachine">The animal snack machine from which to buy food.</param> public void FeedAnimal(IEater eater) { VendingMachine animalSnackMachine = this.GetVendingMachine(); // Find food price. decimal price = animalSnackMachine.DetermineFoodPrice(eater.Weight); // Check if guest has enough money on hand and withdraw from account if necessary. if (this.wallet.MoneyBalance < price) { this.WithdrawMoney(price * 10); } // Get money from wallet. decimal payment = this.wallet.RemoveMoney(price); // Buy food. Food food = animalSnackMachine.BuyFood(payment); // Feed animal. eater.Eat(food); }
public UncheckedStatementEater(IEater eater) : base(eater) { }
public UnsafeCodeFixedStatementEater(IEater eater) : base(eater) { }
public UnsafeCodeUnsafeStatementEater(IEater eater) : base(eater) { }
public DefaultExpressionEater(IEater eater, ITypeEater typeEater) : base(eater) { _typeEater = typeEater; }
public VariableInitializerEater(IEater eater) { _eater = eater; }
public SwitchLabelStatementEater(IEater eater) : base(eater) { }
public Eating(IEater eater, GameObject objectToEat) { _eater = eater; _objectToEat = objectToEat; }
public ArrayCreationExpressionEater(IEater eater, IVariableInitializerEater variableInitializerEater) : base(eater) { _variableInitializerEater = variableInitializerEater; }
public ArgumentsEater(IEater eater) { _eater = eater; }
static void Main(string[] args) { if (args.Length < 4) { Console.Error.WriteLine("dxf2bmp input.dxf output.bmp cx cy "); Environment.Exit(1); } using (StreamReader rr = new StreamReader(args[0], Encoding.Default)) { IEater eater = null; List <IEater> al = new List <IEater>(); while (true) { String row0 = rr.ReadLine(); String row1 = rr.ReadLine(); int ty; if (row1 == null || !int.TryParse(row0.Trim(), out ty)) { break; } if (ty == 0) { if (false) { } else if (row1 == "LINE") { al.Add(eater = new Line()); } else if (row1 == "CIRCLE") { al.Add(eater = new Circle()); } else { eater = null; } } else if (eater != null) { eater.Eat(ty, row1); } } BBox bbox = new BBox(); { foreach (var q in al.Where(p => p is Line).Cast <Line>()) { bbox.Eat(q); } foreach (var q in al.Where(p => p is Circle).Cast <Circle>()) { bbox.Eat(q); } } bbox.InflateRate(0.02f, 0.02f); using (Bitmap pic = new Bitmap(int.Parse(args[2]), int.Parse(args[3]))) { using (Graphics cv = Graphics.FromImage(pic)) { cv.TranslateTransform(0, pic.Height); cv.ScaleTransform(1, -1); cv.SmoothingMode = SmoothingMode.HighQuality; CBox cb = new CBox(pic.Width, pic.Height, bbox); cv.Clear(Color.White); foreach (IEater eat in al) { if (eat is Line) { Line t = (Line)eat; cv.DrawLine( new Pen(t.color), (float)cb.X(t.x0), (float)cb.Y(t.y0), (float)cb.X(t.x1), (float)cb.Y(t.y1) ); } else if (eat is Circle) { Circle t = (Circle)eat; cv.DrawEllipse( Pens.Black, RectangleF.FromLTRB( (float)cb.X(t.x - t.r), (float)cb.Y(t.y - t.r), (float)cb.X(t.x + t.r), (float)cb.Y(t.y + t.r) ) ); } } #if false cv.FillRectangle( new LinearGradientBrush(new Point(0, 0), new Point(pic.Width, pic.Height), Color.Black, Color.Gray), new RectangleF(PointF.Empty, pic.Size) ); cv.DrawString( "A DXF thumbnail", new Font(FontFamily.GenericSerif, 8), Brushes.WhiteSmoke, new RectangleF(PointF.Empty, pic.Size) ); #endif } pic.Save(args[1], System.Drawing.Imaging.ImageFormat.Bmp); } } }
public MoqStubOptionsEater(IEater eater, IMoqStubOptionTargetEater moqStubOptionTargetEater) { _eater = eater; _moqStubOptionTargetEater = moqStubOptionTargetEater; }
public DeclarationStatementEater(IEater eater) : base(eater) { }
public UnitTestEater(IEater eater) { _eater = eater; }