private List <Room> RSS; //saving the states of all rooms (visited and location) // Start is called before the first frame update void Start() { criticalPath = transform.GetChild(0).gameObject; extraRooms = transform.GetChild(1).gameObject; icons = transform.GetChild(2).gameObject; SIZE = GetComponent <SizeController>(); }
void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } }
/// <summary> /// Creates a new <see cref="MessageControllerTests"/> instance /// </summary> public SizeControllerTests() { // Configure repo mock this._repo = new Mock <IMatchMessageRepository>(); // Configure service this._service = new MessageService(this._repo.Object); // Configure controller this._controller = new SizeController(this._service); this._controller.ControllerContext = new ControllerContext(); this._controller.ControllerContext.HttpContext = new DefaultHttpContext(); }
void Start() { sizeController.isTouched = false; sizeController = GetComponent <SizeController>(); emch = new List <Transform>(); emch.Add(burstComponent); foreach (Transform child in burstComponent) { emch.Add(child); ParticleSystem.EmissionModule em1 = child.GetComponent <ParticleSystem>().emission; em1.enabled = false; } audio = GetComponent <AudioSource>(); }
public async Task Invalid_Id_Returns_Null() { var mockSize = new Mock <Size>(); var id = Guid.NewGuid(); var mockSizeService = new Mock <ISizeService>(); mockSizeService.Setup(s => s.GetSizeAsync(Guid.NewGuid())) .Returns(() => Task.FromResult(mockSize.Object)); var sizeController = new SizeController(mockSizeService.Object); var result = await sizeController.GetSize(id); Assert.Null(result); }
public async Task Valid_Id_Returns_Size() { var id = Guid.NewGuid(); var size = Size.Create(id, "M"); var mockSizeService = new Mock <ISizeService>(); mockSizeService.Setup(s => s.GetSizeAsync(id)) .Returns(() => Task.FromResult(size)); var sizeController = new SizeController(mockSizeService.Object); var result = await sizeController.GetSize(id); mockSizeService.Verify(mock => mock.GetSizeAsync(id), Times.Once()); Assert.NotNull(result); }
public static async Task RemoveSize(size.SizeId id) { var connectionString = ConnectivityService.GetConnectionString("TEMP"); var context = new SplurgeStopDbContext(connectionString); var repository = new SizeRepository(context); var unitOfWork = new EfCoreUnitOfWork(context); var service = new size.SizeService(repository, unitOfWork); var sizeController = new SizeController(service); var updateCommand = new size.Commands.DeleteSize { Id = id }; await sizeController.DeleteSize(updateCommand); }
public static async Task UpdateSizeAmount(size.SizeId id, string amount) { var connectionString = ConnectivityService.GetConnectionString("TEMP"); var context = new SplurgeStopDbContext(connectionString); var repository = new SizeRepository(context); var unitOfWork = new EfCoreUnitOfWork(context); var service = new size.SizeService(repository, unitOfWork); var sizeController = new SizeController(service); var updateCommand = new size.Commands.SetSizeAmount { Id = id, Amount = amount }; await sizeController.Put(updateCommand); }
private void Start() { // Initial starting position (0 - 4) ALWAYS int randStartingPos = Random.Range(0, startingPositions.Length); transform.position = startingPositions[randStartingPos].position; // Starting room & Player Icon Instantiate(rooms[1], transform.position, Quaternion.identity); Instantiate(playerIcon, transform.position, Quaternion.identity); // Set up Camera, Demensions (Scenes.cs) // @param 4x4, 5x5, 6x6 SIZE = GetComponent <SizeController>(); SIZE.setUp(Scenes.getDimension()); direction = Random.Range(1, 6); }
public static async Task <dynamic> CreateInvalidSize() { var connectionString = ConnectivityService.GetConnectionString("TEMP"); var context = new SplurgeStopDbContext(connectionString); var repository = new SizeRepository(context); var unitOfWork = new EfCoreUnitOfWork(context); var service = new size.SizeService(repository, unitOfWork); var command = new size.Commands.Create { Id = null }; var sizeController = new SizeController(service); return(await sizeController.Post(command)); }
public async Task Get_All_Sizes() { List <SizeDto> mockSizes = MockSizes(); var mockRepository = new Mock <IRepository <Size, SizeDto, SizeId> >(); mockRepository.Setup(repo => repo.GetAllDtoAsync()) .Returns(() => Task.FromResult(mockSizes.AsEnumerable())); var mockUnitOfWork = new Mock <IUnitOfWork>(); var sizeService = new SizeService(mockRepository.Object, mockUnitOfWork.Object); var sizeController = new SizeController(sizeService); var result = await sizeController.GetSizes(); Assert.Equal(10, result.Count()); mockRepository.Verify(mock => mock.GetAllDtoAsync(), Times.Once()); }
public Component() { ClipArea = new ClipArea(this); _positionController = new PositionController(this); _sizeController = new SizeController(this); _marginController = new MarginController(this); _paddingController = new PaddingController(this); _scrollController = new ScrollController(this); _tPosObserver = new Observer <Vector2i>(TargetPosition); _tRelPosObserver = new Observer <Vector2i>(TargetRelativePosition); _tSizObserver = new Observer <Vector2i>(TargetSize); _tMarObserver = new Observer <Spacing>(TargetMargins); _tPadObserver = new Observer <Spacing>(TargetPaddings); _tScrObserver = new Observer <Vector2i>(TargetScrollOffset); StyleManager = new StyleManager(this); TransformChanged = true; StyleChanged = true; }
private void Start() { Time.timeScale = 1f; meshFilter = GetComponent <MeshFilter>(); arena = GameObject.FindGameObjectWithTag("Arena").GetComponent <SizeController>(); shaker = Camera.main.GetComponent <CameraShake>(); rb = GetComponent <Rigidbody>(); Hp = maxHP; speed = maxSpeed; currentAmmo = maxAmmo; if (OnAmmoUpdate != null) { OnAmmoUpdate(currentAmmo, maxAmmo); } if (OnHealthUpdate != null) { OnHealthUpdate(hp, maxHP); } Spawner.endOfWaveEvent += DisableShooting; }
/// <summary> /// Set calculated score /// </summary> private void Start() { SizeController sizeController = GetComponent <SizeController>(); _score = (int)Mathf.Lerp(_minSizeScore, _maxSizeScore, 1 - sizeController.SizeInPercent); }
public SizeControllerTests() { _mockSizeService = new Mock <ISizeService>(); _sizeController = new SizeController(_mockSizeService.Object); }
private void Awake() { _motor = GetComponent <Motor>(); _sizeController = GetComponent <SizeController>(); }
// Start is called before the first frame update void Start() { SIZE = GetComponent <SizeController>(); mCamera.gameObject.SetActive(true); }