private void Awake() { _rigidbody = GetComponent <Rigidbody>(); _sphereApplicationService = new SphereApplicationService(new SphereFactory(), new SphereRepository()); _sphereId = new SphereId(Guid.NewGuid()); _sphereApplicationService.Create(_sphereId); }
public Sphere MoveSphere(SphereId sphereId, Vector2 rawMoveDir) { var sphere = _sphereRepository.Find(sphereId); if (sphere == null) { throw new ArgumentNullException(); } sphere.ChangeMoveDirection(new SphereMoveDirection(rawMoveDir)); return(sphere); }
public Sphere Find(SphereId sphereId) { return(Db.ContainsKey(sphereId) ? Db[sphereId] : null); }
public Sphere Create(SphereId sphereId) { return(new Sphere(sphereId)); }
public void Create(SphereId sphereId) { var sphere = _sphereFactory.Create(sphereId); _sphereRepository.Save(sphere); }