public Spaceship(ISpaceshipEngine engine, IArmour armour, IWeapon weapon, string model) { this.Engine = engine; this.Armour = armour; this.Weapon = weapon; this.Model = model; }
/// <summary> /// Initializes a new instance of the <see cref="ArmorViewModel"/> class. /// </summary> /// <param name="armour">The armour.</param> /// <exception cref="ArgumentNullException">IArmour is null</exception> public ArmorViewModel(IArmour armour) { if (armour == null) { throw new ArgumentNullException("IArmour is null"); } Armour = armour; }
protected Monster(string name, int acc, int str, IWeapon wep, IArmour arm) { CreatureName = name; CreatureBaseAccuracy = acc; CreatureBaseStrength = str; CreatureDefaultWeapon = wep; CreatureDefaultArmour = arm; }
public EquipmentSummaryViewModel(IEquipment equipment) { Equipment = equipment; _Weapon = Equipment as IWeapon; _MisseleWeapon = Equipment as IMisseleWeapon; _CloseCombatWeapon = Equipment as ICloseCombatWeapon; _Armor = Equipment as IArmour; }
/// <summary> /// Formats the save modifier. /// E.g. Light Armour gives a save of 6+, but is stored as a 1 /// Thus (7-1) = 6+ /// A Shield gives a save of +1, but is stored as a 1 /// Thus represent as +1 /// </summary> /// <param name="armour">The armour.</param> /// <returns></returns> internal static string FormatSaveModifier(IArmour armour) { if (armour.Save != 0) { return(FormatSaveValue(armour.Save)); } return("None"); }
private void Start() { rbd = GetComponent <Rigidbody>(); stats = GetComponent <Stats>(); movementDirection = setCameraDirection(cameraView); animatorFacade = new AnimatorFacade(GetComponentInChildren <ICharacterAnimator>(), this); initMovements(); movement = movements[MovementEnum.Ground]; healthComponent = new HealthComponent(this); armour = new Armour(this); attackManager = new AttackManager(animatorFacade, this); }
private void Start() { _rbd = GetComponent <Rigidbody>(); _stats = GetComponent <Stats>(); _movementDirection = SetCameraDirection(cameraView); _animatorFacade = new AnimatorFacade(GetComponentInChildren <ICharacterAnimator>(), this); InitMovements(); // creating all movements _movement = _movements[MovementEnum.Ground]; // setting the current movement as Ground One _healthComponent = new HealthComponent(this); _armour = new Armour(this); _attackManager = new AttackManager(_animatorFacade, this); }
private int CalculateArmourSave() { int calculatedArmorSave = ARMOUR_SAVE_NONE; foreach (IEquipment item in _Warrior.Equipment) { IArmour armour = item as IArmour; if (armour != null) { AddModifierComment(armour.Name); calculatedArmorSave += armour.Save; } } return(calculatedArmorSave); }
/// <summary> /// Puts on a piece of armour. Can possibily be interrupted with a /// confirmation to remove a peice if that delegate is !null. /// </summary> /// <param name="aArmour">The peice of armour to put on</param> /// <returns></returns> public void PutOn(IArmour aArmour, bool confirm = true) { if (WornArmour.ContainsKey(aArmour.ArmourLocation)) { if (TakeOff(WornArmour[aArmour.ArmourLocation], confirm)) WornArmour.Add(aArmour.ArmourLocation, aArmour); } else WornArmour.Add(aArmour.ArmourLocation, aArmour); // fire off events. if (OnFinishedDressingManeuver != null) OnFinishedDressingManeuver(this, new EquipmentEventArgs<DressingActionType, IArmour>( DressingActionType.PutOn, aArmour)); }
public IPlayer CreatePlayer(IRegistration playerParameters) { string name, spaceshipModel, engineModel, armourModel, weaponModel; name = playerParameters.ParametersForPlayer["name"]; spaceshipModel = playerParameters.ParametersForPlayer["ship"]; engineModel = playerParameters.ParametersForPlayer["engine"]; armourModel = playerParameters.ParametersForPlayer["armour"]; weaponModel = playerParameters.ParametersForPlayer["weapon"]; ISpaceshipEngine engine = engineFactory.CreateEngine(engineModel); IArmour armour = armourFactory.CreateArmour(armourModel); IWeapon weapon = weaponFactory.CreateWeapon(weaponModel.ToLower()); weapon.Bullet = bulletFactory.CreateBullet(); ISpaceShip spaceship = spaceshipFactory.CreateSpaceship(spaceshipModel, engine, armour, weapon); IPlayer player = playerFactory.CreatePlayer(name, spaceship); return(player); }
public DrossMashupSpaceship(ISpaceshipEngine engine, IArmour armour, IWeapon weapon, string model) : base(engine, armour, weapon, model) { }
public ISpaceShip CreateSpaceship(string model, ISpaceshipEngine engine, IArmour armour, IWeapon weapon) { var command = this.autofacContext.ResolveNamed <ISpaceShipService>(model.ToLower()); return(command.CreateSpaceship(model, engine, armour, weapon)); }
public SpaceshipMock(ISpaceshipEngine engine, IArmour armour, IWeapon weapon, string model) : base(engine, armour, weapon, model) { }
/// <summary> /// Take off a piece of worn armour. /// </summary> /// <param name="?"></param> public bool TakeOff(IArmour aArmour, bool confirm = true) { if (WornArmour.ContainsKey(aArmour.ArmourLocation)) { if (RemoveArmourConfirm != null && confirm) { if (RemoveArmourConfirm( string.Format("Remove {0}?", aArmour.Name))) { } } else WornArmour.Remove(aArmour.ArmourLocation); // fire off events. if (OnFinishedDressingManeuver != null) OnFinishedDressingManeuver(this, new EquipmentEventArgs<DressingActionType, IArmour>( DressingActionType.TakeOff, aArmour)); return true; } if (OnFinishedDressingManeuver != null) OnFinishedDressingManeuver(this, new EquipmentEventArgs<DressingActionType, IArmour>( DressingActionType.Neither, aArmour)); return false; }
public ISpaceShip CreateSpaceship(string model, ISpaceshipEngine engine, IArmour armour, IWeapon weapon) { return(new FuturisticSpaceship(engine, armour, weapon, model)); }