void Awake() { _weaponsFactory = gameObject.GetComponentInChildren <IWeaponsFactory>(); if (_weaponsFactory == null) { _weaponsFactory = gameObject.GetComponentInParent <IWeaponsFactory>(); if (_weaponsFactory == null) { throw new Exception("Weapons factory not found!"); } } }
public PrintCommand(IWeaponsFactory weaponsFactory, IList <string> args, IWriter writer) { this.weaponsFactory = weaponsFactory; this.args = new List <string>(args); this.writer = writer; }
public AddCommand(IWeaponsFactory weaponsFactory, IList <string> args) { this.weaponsFactory = weaponsFactory; this.args = new List <string>(args); }