Example #1
0
        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));
        }
Example #4
0
 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;
 }
Example #6
0
        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);
        }
Example #7
0
 public WeaponController(IWeaponService weaponService)
 {
     _weaponService = weaponService;
 }
Example #8
0
 public WeaponService(IWeaponService service)
 {
     _service = service;
 }
Example #9
0
 public IndexModel(IWeaponService weaponService)
 {
     _weaponService = weaponService;
 }
Example #10
0
        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;
                }
            }
        }
Example #11
0
 public NinjaService(IWeaponService weaponService)
 {
     Console.WriteLine("ctor: NinjaService");
     _weaponService = weaponService;
 }
Example #12
0
 public WeaponsController(IWeaponService _weaponService, ICharacterService _characterService)
 {
     weaponService    = _weaponService;
     characterService = _characterService;
 }
Example #13
0
 public WeaponsController(IWeaponService service)
 {
     _service = service;
 }
 public WeaponController(IWeaponService iWeaponService)
 {
     _iWeaponService = iWeaponService;
 }
Example #15
0
 public IndexModel(IWeaponService weaponService, IMajorService majorService) : base(majorService)
 {
     _weaponService = weaponService;
 }
Example #16
0
 public WeaponController(IWeaponService weaponService) => _weaponservice = weaponService;
 public DataInputController(IWeaponService weaponService)
 {
     this._weaponService = new WeaponService(weaponService);
 }
 public WeaponController(IWeaponService weapons)
 {
     _weapons = weapons;
 }