private static void Battery_BatterySpent(object sender, GameObjectEventArgs e) { Battery battery = (Battery)sender; logger(sender, "Battery_BatterySpent", e.EventType.ToString()); ToBeRemovedObjects.Add(battery); }
public void OnEntityWalkIn(GameObjectEventArgs e, GameTime gametime) { if (AsSE) { Audio.SoundEffectEngine.PlaySoundEffects(SE); } }
private void Scene_GameObjectUnregistered(object sender, GameObjectEventArgs e) { if (this.camObj == e.Object) { this.SetCurrentCamera(null); } }
public void OnDraw(GameObjectEventArgs e, SpriteBatch spritebatch, GameTime gametime) { Variant[e.ParrentEntity.Variant].Draw(spritebatch, new Rectangle( e.OnScreenLocation.X + (int)(e.World.Camera.Zoom * (this.SpriteLocation.X + e.ParrentEntity.OnTileLocation.X)), e.OnScreenLocation.Y + (int)(e.World.Camera.Zoom * (this.SpriteLocation.Y + +e.ParrentEntity.OnTileLocation.Y)), this.DrawBox.Width * e.World.Camera.Zoom, this.DrawBox.Height * e.World.Camera.Zoom), Color.White, gametime); }
public void Battery_BatterySpent(object sender, GameObjectEventArgs e) { if (e.EventType == GameObjectEventArgsType.SHIP_COLLIEDED_WITH_BATTERY) { Battery battery = (Battery)sender; EnergyUp(battery.Energy); } }
private static void OnGameObjectRemoved(GameObjectEventArgs args) { if (GameObjectRemoved != null) { GameObjectRemoved(current, args); } args.Object.OnDeactivate(); }
private static void OnGameObjectAdded(GameObjectEventArgs args) { args.Object.OnActivate(); if (GameObjectAdded != null) { GameObjectAdded(current, args); } }
public void OnCollisionWithGoal(object source, GameObjectEventArgs args) { SnowBallStatusHolder snowBallStatusManager = args.GameObject.GetComponent <ISnowBallStatusHolder>().GetSnowBallStatusHolder(); int ballPointValue = snowBallStatusManager.SnowBallPointValue; int goalID = snowBallStatusManager.LastContactedGoalID; AddScorePoints(ballPointValue, goalID); }
private void objectManager_GameObjectRemoved(object sender, GameObjectEventArgs e) { this.RemoveFromManagers(e.Object); if (this.IsCurrent) { OnGameObjectRemoved(e); } }
private void objectManager_GameObjectAdded(object sender, GameObjectEventArgs e) { this.AddToManagers(e.Object); if (this.IsCurrent) { OnGameObjectAdded(e); } }
private static void Ship_ShipDamaged(object sender, GameObjectEventArgs e) { logger(sender, "Ship_ShipDamaged", e.EventType.ToString()); if (Score > 0) { Score--; } logger(null, "Score", Score.ToString()); }
private void removeFromLists(object sender, GameObjectEventArgs e) { GItemList.Remove(e.Guid); GUnitList.Remove(e.Guid); GPlayerList.Remove(e.Guid); GNodeList.Remove(e.Guid); GDynamicList.Remove(e.Guid); GCorpsesList.Remove(e.Guid); ObjectList.Remove(e.Guid); GuidList.Remove(e.Guid); }
private static void OnGameObjectRemoved(GameObjectEventArgs args) { if (GameObjectRemoved != null) { GameObjectRemoved(current, args); } if (args.Object.Active || args.Object.Disposed) { args.Object.OnDeactivate(); } }
private static void Bullet_BulletSpent(object sender, GameObjectEventArgs e) { Bullet bullet = (Bullet)sender; logger(sender, "Bullet_BulletSpent", e.EventType.ToString()); if (e.EventType == GameObjectEventArgsType.BULLET_COLLIEDED_WITH_ASTEROID) { Score += 5; } logger(null, "Score", Score.ToString()); ToBeRemovedObjects.Add(bullet); }
//public GMain Form //{ // get // { // return form; // } //} #region List stuff private void addToLists(object sender, GameObjectEventArgs e) { GObject ObjectToAdd = PopulateObject(e.Guid); if (ObjectToAdd != null) { try { if (ObjectToAdd.Type.Equals((int)eObjectType.G_ITEM)) { GItemList.Add(ObjectToAdd.ObjectGUID, new GItem(this, ObjectToAdd.ObjectPointer)); } if (ObjectToAdd.Type.Equals((int)eObjectType.G_UNIT)) { GUnitList.Add(ObjectToAdd.ObjectGUID, new GUnit(this, ObjectToAdd.ObjectPointer)); } if (ObjectToAdd.Type.Equals((int)eObjectType.G_PLAYER)) { GPlayerList.Add(ObjectToAdd.ObjectGUID, new GPlayer(this, ObjectToAdd.ObjectPointer)); } if (ObjectToAdd.Type.Equals((int)eObjectType.G_NODE)) { GNodeList.Add(ObjectToAdd.ObjectGUID, new GNode(this, ObjectToAdd.ObjectPointer)); } if (ObjectToAdd.Type.Equals((int)eObjectType.G_DYNAMICOBJECT)) { GDynamicList.Add(ObjectToAdd.ObjectGUID, new GDynamic(this, ObjectToAdd.ObjectPointer)); } if (ObjectToAdd.Type.Equals((int)eObjectType.G_CORSPE)) { GCorpsesList.Add(ObjectToAdd.ObjectGUID, new GCorpses(this, ObjectToAdd.ObjectPointer)); } ObjectList.Add(ObjectToAdd.ObjectGUID, new GObject(this, ObjectToAdd.ObjectPointer)); GuidList.Add(e.Guid); } catch { }; } }
public override void Tick(GameObjectEventArgs e, KeyboardState KeyBoard, MouseState Mouse, GameTime gameTime) { if (KeyBoard.IsKeyDown(Config.Controls.MoveRun)) { Speed = 10; } else { Speed = 5; } if (e.ParrentEntity.IAToDo.Count == 0) { e.ParrentEntity.Variant = IdleVariant; if (KeyBoard.IsKeyDown(Config.Controls.MoveUp)) { e.ParrentEntity.IAToDo.Add(new Helper.Action(Helper.ActionType.Move, Helper.Direction.Up, Speed)); e.ParrentEntity.Variant = MoveUpVariante; } else if (KeyBoard.IsKeyDown(Config.Controls.MoveDown)) { e.ParrentEntity.IAToDo.Add(new Helper.Action(Helper.ActionType.Move, Helper.Direction.Down, Speed)); e.ParrentEntity.Variant = MoveDownVariante; } else if (KeyBoard.IsKeyDown(Config.Controls.MoveLeft)) { e.ParrentEntity.IAToDo.Add(new Helper.Action(Helper.ActionType.Move, Helper.Direction.Left, Speed)); e.ParrentEntity.Variant = MoveLeftVariante; } else if (KeyBoard.IsKeyDown(Config.Controls.MoveRight)) { e.ParrentEntity.IAToDo.Add(new Helper.Action(Helper.ActionType.Move, Helper.Direction.Right, Speed)); e.ParrentEntity.Variant = MoveRightVariante; } } }
private void owner_OnDestroy(object sender, GameObjectEventArgs e) { Console.WriteLine("Owner destroyed."); }
public override void OnUpdate(GameObjectEventArgs e, KeyboardState keyboard, MouseState mouse, GameTime gametime) { IA.Tick(e, keyboard, mouse, gametime); IA.ExecuteAction(e, gametime); }
public override void OnTick(GameObjectEventArgs e, GameTime gametime) { }
protected virtual void OnAfterWallHit(GameObjectEventArgs e) { AfterWallHit?.Invoke(this, e); }
private void spit_OnDestroyed(object sender, GameObjectEventArgs e) { spits.Remove(sender as BossSpit); }
public override void Tick(GameObjectEventArgs e, KeyboardState KeyBoard, MouseState Mouse, GameTime gameTime) { base.Tick(e, KeyBoard, Mouse, gameTime); }
private void spit_OnDestroyed(object sender, GameObjectEventArgs e) { spit.OnDestroyed -= spit_OnDestroyed; spit = null; }
protected virtual void OnBatterySpent(GameObjectEventArgs e) { BatterySpent?.Invoke(this, e); }
public void OnDraw(GameObjectEventArgs e, SpriteBatch spritebatch, GameTime gametime) { Variant[e.ParrentTile.Variant].Draw(spritebatch, new Microsoft.Xna.Framework.Rectangle(new Microsoft.Xna.Framework.Point(e.OnScreenLocation.X - e.World.Camera.Zoom / 2, e.OnScreenLocation.Y - e.World.Camera.Zoom / 2), new Microsoft.Xna.Framework.Point(e.World.Camera.Zoom * 2, e.World.Camera.Zoom * 2)), Microsoft.Xna.Framework.Color.White, gametime); }
public virtual void OnTick(GameObjectEventArgs e, GameTime gametime) { }
public void OnUpdate(GameObjectEventArgs e, KeyboardState keyboard, MouseState mouse, GameTime gametime) { }
protected virtual void OnBulletSpent(GameObjectEventArgs e) { BulletSpent?.Invoke(this, e); }