public PlayerBody LoadPlayerBody(Guid characterId, IMechanicEngine mechanicEngine) { //TODO: load config from DB, get some data from depended services and as a result - load player object var character = _characterRepository.Find(characterId).FirstOrDefault(); var player = _unityContainer.Resolve <PlayerBody>( new ParameterOverride("name", character.Name)); player.AddWeapon(_unityContainer.Resolve <WeaponSimpleBullet>("Revolver")); player.AddWeapon(_unityContainer.Resolve <WeaponSimpleBullet>("Gun")); player.AddWeapon(_unityContainer.Resolve <WeaponMultipleShotgunBullet>("Shotgun")); player.AddWeapon(_unityContainer.Resolve <WeaponDynamite>("Dynamite")); player.SocialGroups.Add("Bandit"); //Fill playerBody with character data player.Id = character.Id; //Create session var newSession = new GameSession(character.Id); _sessionRepository.AddSession(newSession); player.SessionId = newSession.Id; return(player); }