public SceneController(MainWindow window) { _window = window; _entitiesController = _window.entitiesController; _fsManager = FS.Manager.Instance; _formatter = new BinaryFormatter(); }
public BaseWorld(WorldInfo worldInfo, RelationshipMap relationshipMap, Vector3 firePlace) { _worldInfo = worldInfo; EntityMapping = new EntityMapping(relationshipMap); Entities = new EntitiesController(EntityMapping); FreeCitizens = new Queue <Actor>(); Stockpile = new Stockpile(); Events = new WorldEventsController(); MaxPopulation = _worldInfo.MaxPopulation; RelationshipMap = relationshipMap; MinPopulation = _worldInfo.MinPopulation; FirePlace = firePlace; TaxController = new PerCitizenResourceController(new[] { -2, -1, 0, 1, 2 }, new[] { 2, 1, 0, -1, -2 }); // TODO: Flawed logic, food can be 1/8 at least. Might need to redesign food amounts and shieeet FoodController = new PerCitizenResourceController(new[] { 0, 1, 2, 3 }, new[] { -1, 0, 1, 2 }); TaxController.SetValueIndex(2); FoodController.SetValueIndex(1); _popularityInternal = _worldInfo.MaxPopularity; }
public void Init() { contextMock = new Mock <MarketplaceContext>(); authorizationServiceMock = new Mock <AuthorizationService>(); queryHelperMock = new Mock <QueryHelper>(); entitiesController = new EntitiesController(contextMock.Object, authorizationServiceMock.Object, queryHelperMock.Object); }
protected AttackingEntity(EntitiesController <TTargetType> targetsController, EntitiesController <TEntityType> entitiesController, UnitParameters up) : base(up) { TargetsController = targetsController; Controller = entitiesController; _bulletsCount = _up.ClipSize; }
private void InitEavAndSerializer() { // Improve the serializer so it's aware of the 2sxc-context (module, portal etc.) _entitiesController = new EntitiesController(App.AppId); _entitiesController.SetUser(Environment.Dnn7.UserIdentity.CurrentUserIdentityToken); ((Serializer)_entitiesController.Serializer).Sxc = SxcContext; }
public void Get_person() { var db = new CrisisCheckin(); var controller = new EntitiesController(db); Assert.AreEqual(_person.PhoneNumber, controller.Persons().OrderByDescending(p => p.Id).First().PhoneNumber); }
private PrefabController(MainWindow window) { _mainWindow = window; _entitiesController = window.entitiesController; _metadatas = new List <PrefabMetadata> { new PrefabMetadata(PrefabEnum.BREAKOUT, _mainWindow.BreakoutMenuEntry), }; }
public void EntityGetWithIdTest() { using (var repo = new RepositoryMock()) { var target = new EntitiesController(repo); var result = target.Get(2); Assert.AreEqual(1, repo.TimesCalled); } }
public void EntityGetTest() { using (var repo = new RepositoryMock()) { var target = new EntitiesController(repo); IEnumerable <Entity> result = target.Get(); Assert.AreEqual(1, repo.TimesCalled); } }
// ======================================================== // ======================================================== // ======================================================== void Awake() { attackContactFilter.layerMask = hittableLayers; attackContactFilter.useLayerMask = true; attackContactFilter.useTriggers = canHitTriggers; if (offsetBasedOnFacing) { entity = GetComponent <EntitiesController>(); } }
private void InitEavAndSerializer(int?appId = null) { // Improve the serializer so it's aware of the 2sxc-context (module, portal etc.) _entitiesController = new EntitiesController(appId ?? App.AppId); _entitiesController.SetUser(Environment.Dnn7.UserIdentity.CurrentUserIdentityToken); // only do this if we have a real context - otherwise don't do this if (!appId.HasValue) { ((Serializer)_entitiesController.Serializer).Sxc = SxcContext; } }
private void InitEavAndSerializer(int?appId = null) { Log.Add($"init eav for a#{appId}"); // Improve the serializer so it's aware of the 2sxc-context (module, portal etc.) _entitiesController = new EntitiesController(appId ?? App.AppId); // only do this if we have a real context - otherwise don't do this if (!appId.HasValue) { ((Serializer)_entitiesController.Serializer).Sxc = SxcContext; } }
public async Task CreateItemAsync() { using (var controllerStore = new EntitiesController(AuthenticationProvider)) { // Produto para criar no invoicing ProductResource product = new ProductResource("Cad-0002", "Descrição da cadeira 2"); var result = await controllerStore.PostItem(product); Assert.IsTrue(!string.IsNullOrEmpty(result.Value)); } }
public void EntitiesDeletTest() { using (var repo = new RepositoryMock()) { Assert.AreEqual(0, repo.TimesCalled); var target = new EntitiesController(repo); target.Delete(2); Assert.AreEqual(1, repo.TimesCalled); } }
public async Task CreateCustomerAsync() { using (var controllerStore = new EntitiesController(AuthenticationProvider)) { // Produto para criar no invoicing Client resource = new Client("C-MD-0002", "Miguel Dias", "Rua dos Bombeiros", "Leiria", "4509-003"); var result = await controllerStore.PostCustomerItem(resource); if (string.IsNullOrEmpty(result.Value)) { throw new Exception((result.Result as ObjectResult).Value.ToString()); } Assert.IsTrue(!string.IsNullOrEmpty(result.Value)); } }
public void ListPresentsCorrectPageOfEntities() { IEntitiesRepository repository = MockEntitiesRepository( new Entity { Name = "P1" }, new Entity { Name = "P2" }, new Entity { Name = "P3" }, new Entity { Name = "P4" }, new Entity { Name = "P5" } ); EntitiesController controller = new EntitiesController(repository); controller.PageSize = 3; var result = controller.List(2); Assert.IsNotNull(result, "Didn't render view"); var entities = result.Entities as IList <Entity>; Assert.AreEqual(2, entities.Count, "Got wrong number of products"); Assert.AreEqual(2, result.CurrentPage, "Wrong page number"); Assert.AreEqual(2, result.TotalPages, "Wrong page count"); Assert.AreEqual("P4", entities[0].Name); Assert.AreEqual("P5", entities[1].Name); }
void Awake() { instance = this; }
private void Awake() { EntitiesController.INSTANCE = this; }
public void SetEntity(EntitiesController entity) { this.entity = entity; }