public PlayerController(PlayerSpawnData playerSpawnData, PlayerService playerService , IWeaponService weaponSystem, string localPlayerID) { playerHolder = new GameObject(); this.playerService = playerService; this.weaponService = weaponSystem; this.playerID = playerSpawnData.playerID; this.localPlayerID = localPlayerID; playerHolder.name = playerID; spawnCharacterPos = playerSpawnData.playerPosition; fixedPos = playerSpawnData.playerPosition; playerCharacterControllerList = new Dictionary <int, PlayerCharacterController>(); playerHolder.transform.position = playerSpawnData.playerPosition; if (playerHolder.transform.position.x > 0) { playerHolder.transform.rotation = Quaternion.Euler(new Vector3(0, 180, 0)); } for (int i = 0; i < 3; i++) { if (i == 0) { PlayerCharacterController playerCharacterController = new CharacterAirController( i, this, playerService.ReturnPlayerScriptableObj(PlayerCharacterType.Air) , weaponService, spawnCharacterPos, playerHolder, localPlayerID ); playerCharacterController.SetHealthBarFirst(playerSpawnData.char1Health); playerCharacterControllerList.Add(i, playerCharacterController); } else if (i == 1) { PlayerCharacterController playerCharacterController = new CharacterWaterController( i, this, playerService.ReturnPlayerScriptableObj(PlayerCharacterType.Water) , weaponService, spawnCharacterPos, playerHolder, localPlayerID ); playerCharacterController.SetHealthBarFirst(playerSpawnData.char2Health); playerCharacterControllerList.Add(i, playerCharacterController); } else if (i == 2) { PlayerCharacterController playerCharacterController = new CharacterFireController( i, this, playerService.ReturnPlayerScriptableObj(PlayerCharacterType.Fire) , weaponService, spawnCharacterPos, playerHolder, localPlayerID ); playerCharacterController.SetHealthBarFirst(playerSpawnData.char3Health); playerCharacterControllerList.Add(i, playerCharacterController); } if (playerHolder.transform.position.x > 0) { spawnCharacterPos.x += 2; } else { spawnCharacterPos.x -= 2; } spawnCharacterPos.y += 1.95f; } }
public PlayerService(SignalBus signalBus, ScriptableObjCharacterList playerList, IWeaponService weaponService) { this.signalBus = signalBus; this.playerList = playerList; playerControllerDictionary = new Dictionary <string, PlayerController>(); this.weaponService = weaponService; }
public IHttpActionResult GetWeaponByName(string name) { _weaponService = GetWeaponService(); var weapon = _weaponService.GetWeaponByName(name); // if (weapon == null) return NotFound(); return(Ok(weapon)); }
public EditModel(IWeaponService weaponService, IBonusService bonusService, ISkillService skillService, ICoreLogic coreLogic, IMajorService majorService) : base(majorService) { _weaponService = weaponService; _bonusService = bonusService; _skillService = skillService; _coreLogic = coreLogic; }
public GetWeaponsForCurrentCharacterHandler(IUserService userService, ICharacterService characterService, IWeaponService weaponService, IMapper mapper) { _userService = userService; _characterService = characterService; _weaponService = weaponService; _mapper = mapper; }
public CharacterWaterController(int characterID, PlayerController playerController, ScriptableObjCharacter scriptableObjPlayer, IWeaponService weaponService, Vector2 spawnPos, GameObject parentObj, string localPlayerID) { this.localPlayerID = localPlayerID; this.scriptableObjPlayer = scriptableObjPlayer; this.characterID = characterID; this.weaponService = weaponService; this.playerController = playerController; this.playerCharacterType = scriptableObjPlayer.playerType; GameObject playerObj = GameObject.Instantiate <GameObject>( scriptableObjPlayer.playerView.gameObject ); playerObj.transform.SetParent(parentObj.transform); playerObj.transform.position = spawnPos; playerCharacterView = playerObj.GetComponent <CharacterWaterView>(); playerCharacterView.SetCharacterController(this); }
public WeaponController(IWeaponService weaponService) { _weaponService = weaponService; }
public WeaponService(IWeaponService service) { _service = service; }
public IndexModel(IWeaponService weaponService) { _weaponService = weaponService; }
public static async Task Initialize(FehContext context, IWeaponService weaponService, IAuthService authService, IConfiguration configuration) { context.Database.EnsureCreated(); if (!context.WeaponTypes.Any()) { try { var weaponTypes = JsonConvert.DeserializeObject <List <WeaponType> >(File.ReadAllText("Seed" + Path.DirectorySeparatorChar + GetFileName("WeaponType"))); foreach (var wt in weaponTypes) { context.WeaponTypes.Add(wt); } context.SaveChanges(); } catch (Exception e) { throw e; } } if (!context.MovementTypes.Any()) { try { var movementTypes = JsonConvert.DeserializeObject <List <MovementType> >(File.ReadAllText("Seed" + Path.DirectorySeparatorChar + GetFileName("MovementType"))); foreach (var mt in movementTypes) { context.MovementTypes.Add(mt); } context.SaveChanges(); } catch (Exception e) { throw e; } } if (!context.Weapons.Any()) { try { var weapons = JsonConvert.DeserializeObject <List <WeaponResource> >(File.ReadAllText("Seed" + Path.DirectorySeparatorChar + GetFileName("Weapons"))); var refinedWeapons = JsonConvert.DeserializeObject <List <WeaponResource> >(File.ReadAllText("Seed" + Path.DirectorySeparatorChar + GetFileName("WeaponsRefined"))); // gets images for refined weapons (since they have the same image as the unrefined versions) for (int i = 0; i < refinedWeapons.Count(); i++) { if (string.IsNullOrEmpty(refinedWeapons[i].ImageUri)) { var split = refinedWeapons[i].Name.Split('(')[0]; var fixedLength = split.Substring(0, split.Length - 1); var weaponWhere = weapons.Where(w => w.Name.Contains(fixedLength)); refinedWeapons[i].ImageUri = weaponWhere.First().ImageUri; } } await weaponService.CreateFromList(weapons); await weaponService.CreateFromList(refinedWeapons); } catch (Exception e) { throw e; } } if (!context.Users.Any()) { try { UserResource userEntry = new UserResource() { Username = "******", Password = "******" }; await authService.CreateAccount(userEntry); } catch (Exception e) { throw e; } } }
public NinjaService(IWeaponService weaponService) { Console.WriteLine("ctor: NinjaService"); _weaponService = weaponService; }
public WeaponsController(IWeaponService _weaponService, ICharacterService _characterService) { weaponService = _weaponService; characterService = _characterService; }
public WeaponsController(IWeaponService service) { _service = service; }
public WeaponController(IWeaponService iWeaponService) { _iWeaponService = iWeaponService; }
public IndexModel(IWeaponService weaponService, IMajorService majorService) : base(majorService) { _weaponService = weaponService; }
public WeaponController(IWeaponService weaponService) => _weaponservice = weaponService;
public DataInputController(IWeaponService weaponService) { this._weaponService = new WeaponService(weaponService); }
public WeaponController(IWeaponService weapons) { _weapons = weapons; }