public Arena() { instance = this; mapData = MapGenerator.Generate(); FSprite bgSprite = new FSprite("Arena/BG_1"); AddChild(bgSprite); AddChild(entityArea = new EntityArea()); float inset = 13; entityArea.bounds.x = -Config.WIDTH / 2 + inset; entityArea.bounds.y = -Config.HEIGHT / 2 + inset; entityArea.bounds.width = Config.WIDTH - inset * 2; entityArea.bounds.height = Config.HEIGHT - inset * 2; colorOverlay = new FSprite("WhiteBox"); colorOverlay.color = new Color(1, 1, 1, 0); colorOverlay.width = Config.WIDTH; colorOverlay.height = Config.HEIGHT; entityArea.overlayContainer.AddChild(colorOverlay); AddChild(frontContainer = new FContainer()); dayManager = new DayManager(); CreateBuildings(); SetupPlayers(); ListenForUpdate(Update); }
public BooksModule(EntityArea area) : base(area, "Books", "Books module", version: CurrentVersion) { RegisterEntities(typeof(IBook), typeof(IPublisher), typeof(IAuthor), typeof(IBookAuthor), typeof(IBookReview), typeof(IUser), typeof(IBookOrder), typeof(IBookOrderLine), typeof(ICoupon), typeof(IImage)); RegisterViews(); }//method
public Arena() { instance = this; mapData = MapGenerator.Generate(); FSprite bgSprite = new FSprite("Arena/BG_1"); AddChild(bgSprite); AddChild(entityArea = new EntityArea()); float inset = 13; entityArea.bounds.x = -Config.WIDTH/2 + inset; entityArea.bounds.y = -Config.HEIGHT/2 + inset; entityArea.bounds.width = Config.WIDTH - inset*2; entityArea.bounds.height = Config.HEIGHT - inset*2; colorOverlay = new FSprite("WhiteBox"); colorOverlay.color = new Color(1,1,1,0); colorOverlay.width = Config.WIDTH; colorOverlay.height = Config.HEIGHT; entityArea.overlayContainer.AddChild(colorOverlay); AddChild(frontContainer = new FContainer()); dayManager = new DayManager(); CreateBuildings(); SetupPlayers(); ListenForUpdate(Update); }
public Wolf(WolfActivePlayer player, EntityArea entityArea) : base(entityArea) { this.player = player; offsetY = 12f; body = new FContainer(); bodySprite = new FSprite(WolfAnimation.Idle.frames[0]); body.AddChild(bodySprite); bodySprite.color = player.player.color.color + new Color(0.5f,0.5f,0.5f,0.0f); bodySprite.y = offsetY; body.scaleX = player.isFacingLeft ? 1f : -1f; // colorSprite = new FSprite("Arena/Wolf_Idle1_color"); // colorSprite.color = player.player.color.color; // body.AddChild(colorSprite); // shadowSprite = new FSprite("Arena/VillShadow"); shadowSprite.alpha = 0.2f; shadowSprite.scaleX = 1.9f; shadowSprite.scaleY = 1.0f; }
// Alice created a constructor with extra parameter userEntityType // suggesting to provide a real type of User entity in the system. public LoginModule(EntityArea area, Type userEntityType) : base(area, "Login") { RegisterEntities(typeof(ILogin), typeof(IUserStub)); //still need to register IUserStub, to immediately replace it var serv = App.GetService <IEntityModelCustomizationService>(); serv.ReplaceEntity(typeof(IUserStub), userEntityType); }
/// <summary>Moves entities (types) from their original areas to the target Area. </summary> /// <param name="toArea">Target area.</param> /// <param name="entityTypes">Entity types.</param> public void MoveTo(EntityArea toArea, params Type[] entityTypes) { CheckNotClosed(); foreach (var ent in entityTypes) { MovedEntities[ent] = toArea; } }
public OAuthClientModule(EntityArea area, OAuthClientSettings settings = null) : base(area, "OAuthClient", version: CurrentVersion) { Settings = settings ?? new OAuthClientSettings(); this.App.RegisterConfig(this.Settings); RegisterEntities(typeof(IOAuthRemoteServer), typeof(IOAuthRemoteServerAccount), typeof(IOAuthAccessToken), typeof(IOAuthClientFlow), typeof(IOAuthOpenIdToken), typeof(IOAuthExternalUser)); App.RegisterService <IOAuthClientService>(this); Requires <EncryptedData.EncryptedDataModule>(); }
public string GetSchema(EntityArea area) { string schema; if (SchemaMappings.TryGetValue(area.Name, out schema)) { return(schema); } return(area.Name); }
public JobExecutionModule(EntityArea area, JobModuleSettings settings = null) : base(area, "JobRunner", version: CurrentVersion) { RegisterEntities(typeof(IJob), typeof(IJobRun), typeof(IJobSchedule)); _settings = settings ?? new JobModuleSettings(); _activitiesCounter = new ThreadSafeCounter(); App.RegisterConfig(_settings); App.RegisterService <IJobInformationService>(this); App.RegisterService <IJobExecutionService>(this); App.RegisterService <IJobDiagnosticsService>(this); }
private bool IsActive(EntityArea area) { return(true); /* * if(!_driver.Supports(DbFeatures.Schemas)) * return true; * return _dbModel.ContainsSchema(area.Name); */ }
public TransactionLogModule(EntityArea area, TransactionLogSettings settings = null, bool trackHostApp = true) : base(area, "TransactionLog", version: CurrentVersion) { Settings = settings ?? new TransactionLogSettings(); App.RegisterConfig(Settings); RegisterEntities(typeof(ITransactionLog)); App.RegisterService <ITransactionLogService>(this); if (trackHostApp) { SetupLoggingFor(this.App); } }
public House(float x, float y, EntityArea entityArea) : base(entityArea) { this.x = x; this.y = y; main = new FContainer(); mainSprite = new FSprite("Arena/House_1"); mainSprite.y = -offsetY; main.AddChild(mainSprite); blockingRect = new TORect(x - 40, y - 24, 80, 42); }
public FenceV(float x, float y, EntityArea entityArea) : base(entityArea) { this.x = x; this.y = y; main = new FContainer(); mainSprite = new FSprite("Arena/fenceV_1"); mainSprite.y = -offsetY; main.AddChild(mainSprite); blockingRect = new TORect(x - 4, y - 30, 8, 60); blockingRect.shouldBlockVills = false; }
public House(float x, float y, EntityArea entityArea) : base(entityArea) { this.x = x; this.y = y; main = new FContainer(); mainSprite = new FSprite("Arena/House_1"); mainSprite.y = -offsetY; main.AddChild(mainSprite); blockingRect = new TORect(x-40,y-24,80,42); }
public FenceV(float x, float y, EntityArea entityArea) : base(entityArea) { this.x = x; this.y = y; main = new FContainer(); mainSprite = new FSprite("Arena/fenceV_1"); mainSprite.y = -offsetY; main.AddChild(mainSprite); blockingRect = new TORect(x-4,y-30,8,60); blockingRect.shouldBlockVills = false; }
public Vill(VillagerActivePlayer player, EntityArea entityArea) : base(entityArea) { this.player = player; attackCooldown = RXRandom.Float(); //random cooldown to start so they're not synced offsetY = 6f; int numArts = 8; artIndex = RXRandom.Range(0, numArts) + 1; body = new FContainer(); bodySprite = new FSprite("Arena/Vill" + artIndex + "_body"); body.AddChild(bodySprite); colorSprite = new FSprite("Arena/Vill" + artIndex + "_color"); colorSprite.color = player.player.color.color; body.AddChild(colorSprite); weapon = new FContainer(); body.AddChild(weapon); string weaponName = RXRandom.GetRandomString("RollingPin", "Torch", "Pitchfork", "", "", "", ""); //Rake, FryingPan if (weaponName != "" && artIndex != 8) { if (weaponName == "Torch") { var torch = new VillTorch(); weapon.AddChild(torch); } else { FSprite weaponSprite = new FSprite("Arena/" + weaponName + "_1"); weapon.AddChild(weaponSprite); } } shadowSprite = new FSprite("Arena/VillShadow"); shadowSprite.alpha = 0.2f; shadowSprite.scaleX = 0.7f; shadowSprite.scaleY = 0.5f; hopper = new Hopper(this); hopper.config.jumpDist = RXRandom.Range(18f, 19f); hopper.config.jumpDuration = RXRandom.Range(0.2f, 0.24f); hopper.config.jumpHeight = RXRandom.Range(3f, 4f); }
// public readonly LoginAuthorizationRoles Roles; #region constructors and init public LoginModule(EntityArea area, LoginModuleSettings settings, string name = null) : base(area, name ?? "LoginModule", "Login module", version: CurrentVersion) { _settings = settings; App.RegisterConfig(_settings); //Register entities RegisterEntities(typeof(ILogin), typeof(ISecretQuestion), typeof(ISecretQuestionAnswer), typeof(ITrustedDevice), typeof(ILoginExtraFactor), typeof(ILoginProcess)); //Register services App.RegisterService <ILoginService>(this); App.RegisterService <ILoginProcessService>(this); App.RegisterService <ILoginManagementService>(this); App.RegisterService <ILoginAdministrationService>(this); RegisterSize("EventType", 50); }
public Vill(VillagerActivePlayer player, EntityArea entityArea) : base(entityArea) { this.player = player; attackCooldown = RXRandom.Float(); //random cooldown to start so they're not synced offsetY = 6f; int numArts = 8; artIndex = RXRandom.Range(0,numArts)+1; body = new FContainer(); bodySprite = new FSprite("Arena/Vill"+artIndex+"_body"); body.AddChild(bodySprite); colorSprite = new FSprite("Arena/Vill"+artIndex+"_color"); colorSprite.color = player.player.color.color; body.AddChild(colorSprite); weapon = new FContainer(); body.AddChild(weapon); string weaponName = RXRandom.GetRandomString("RollingPin","Torch","Pitchfork","","","",""); //Rake, FryingPan if(weaponName != "" && artIndex != 8) { if(weaponName == "Torch") { var torch = new VillTorch(); weapon.AddChild(torch); } else { FSprite weaponSprite = new FSprite("Arena/"+weaponName+"_1"); weapon.AddChild(weaponSprite); } } shadowSprite = new FSprite("Arena/VillShadow"); shadowSprite.alpha = 0.2f; shadowSprite.scaleX = 0.7f; shadowSprite.scaleY = 0.5f; hopper = new Hopper(this); hopper.config.jumpDist = RXRandom.Range(18f,19f); hopper.config.jumpDuration = RXRandom.Range(0.2f,0.24f); hopper.config.jumpHeight = RXRandom.Range(3f,4f); }
public EntityInfo(EntityModule module, Type entityType, EntityKind kind = EntityKind.Table, EntityArea altArea = null) { Module = module; EntityType = entityType; Area = altArea ?? Module.Area; Kind = kind; Name = entityType.Name; Members = new List <EntityMemberInfo>(); Events = new EntityEvents(); //Check for generic types - happens in modules with generic entities (interfaces), provided for customization if (Name.Contains('`')) { Name = Name.Substring(0, Name.IndexOf('`')); } if (EntityType.IsInterface && Name.Length > 1 && Name.StartsWith("I")) { Name = Name.Substring(1); } FullName = Area.Name + "." + Name; EntitySetConstant = ExpressionMaker.MakeEntitySetConstant(this.EntityType); }
public LoginModule(EntityArea area, LoginModuleSettings settings, string name = null) : base(area, name ?? "LoginModule", "Login module", version: CurrentVersion) { _settings = settings; App.RegisterConfig(_settings); //Register entities RegisterEntities(typeof(ILogin), typeof(ISecretQuestion), typeof(ISecretQuestionAnswer), typeof(ITrustedDevice), typeof(ILoginExtraFactor), typeof(IPasswordHistory), typeof(ILoginProcess)); //Register services App.RegisterService <ILoginService>(this); App.RegisterService <ILoginProcessService>(this); App.RegisterService <ILoginManagementService>(this); App.RegisterService <ILoginAdministrationService>(this); RegisterSize("EventType", 50); Roles = new LoginAuthorizationRoles(); // Create recaptcha service if settings are there if (_settings.Recaptcha != null) { var recaptcha = new RecaptchaService(_settings.Recaptcha); App.RegisterService <IRecaptchaService>(recaptcha); } }
public Human(WolfActivePlayer player, EntityArea entityArea, bool shouldStartWithTransform) : base(entityArea) { this.player = player; isTransformingFromWolf = shouldStartWithTransform; tranPercent = 0.0f; offsetY = 18f; body = new FContainer(); bodySprite = new FSprite(HumanAnimation.Idle.frames[0]); body.AddChild(bodySprite); bodySprite.color = player.player.color.color + new Color(0.7f,0.7f,0.7f,0.0f); bodySprite.y = offsetY; body.scaleX = player.isFacingLeft ? 1f : -1f; // colorSprite = new FSprite("Arena/Human_Idle1_color"); // colorSprite.color = player.player.color.color; // body.AddChild(colorSprite); shadowSprite = new FSprite("Arena/VillShadow"); shadowSprite.alpha = 0.2f; shadowSprite.scaleX = 1.9f; shadowSprite.scaleY = 1.0f; attackableRect = new TORect(0,0,62,29); healthBar = new HumanHealthBar(this); healthBar.alpha = 0.0f; Go.to(healthBar, 1.0f, new TweenConfig().alpha(1.0f)); float healthPercent = ((float)player.health / (float)Config.HUMAN_MAX_HEALTH); healthBar.SetPercent(healthPercent); }
public BooksModule(EntityArea area) : base(area, "Books", "Books module", version: CurrentVersion) { RegisterEntities(typeof(IBook), typeof(IPublisher), typeof(IAuthor), typeof(IBookAuthor), typeof(IBookReview), typeof(IUser), typeof(IBookOrder), typeof(IBookOrderLine), typeof(ICoupon), typeof(IImage)); /* * //Add extra tracking columns in book, order, coupon entities * var tranLogExt = new TransactionLogModelExtender(); * tranLogExt.AddUpdateStampColumns(new[] { typeof(IBook), typeof(IBookOrder), typeof(IBookOrderLine), typeof(ICoupon) }, * createIdPropertyName: "CreatedIn", updateIdPropertyName: "UpdatedIn"); * App.ModelExtenders.Add(tranLogExt); */ //Set cached types // App.CacheSettings.AddCachedTypes(CacheType.FullSet, typeof(IBook), typeof(IPublisher), typeof(IAuthor), typeof(IBookAuthor)); // App.CacheSettings.AddCachedTypes(CacheType.Sparse, typeof(IBookOrder), typeof(IBookOrderLine), typeof(IUser), typeof(IImage)); //Register api controllers App.ApiConfiguration.RegisterControllerTypes(typeof(CatalogController), typeof(UserAccountController), typeof(SignupController), typeof(DiagnosticsController)); RegisterViews(); }//method
public Human(WolfActivePlayer player, EntityArea entityArea, bool shouldStartWithTransform) : base(entityArea) { this.player = player; isTransformingFromWolf = shouldStartWithTransform; tranPercent = 0.0f; offsetY = 18f; body = new FContainer(); bodySprite = new FSprite(HumanAnimation.Idle.frames[0]); body.AddChild(bodySprite); bodySprite.color = player.player.color.color + new Color(0.7f, 0.7f, 0.7f, 0.0f); bodySprite.y = offsetY; body.scaleX = player.isFacingLeft ? 1f : -1f; // colorSprite = new FSprite("Arena/Human_Idle1_color"); // colorSprite.color = player.player.color.color; // body.AddChild(colorSprite); shadowSprite = new FSprite("Arena/VillShadow"); shadowSprite.alpha = 0.2f; shadowSprite.scaleX = 1.9f; shadowSprite.scaleY = 1.0f; attackableRect = new TORect(0, 0, 62, 29); healthBar = new HumanHealthBar(this); healthBar.alpha = 0.0f; Go.to(healthBar, 1.0f, new TweenConfig().alpha(1.0f)); float healthPercent = ((float)player.health / (float)Config.HUMAN_MAX_HEALTH); healthBar.SetPercent(healthPercent); }
public EntityInfo(EntityModule module, Type entityType, EntityKind kind = EntityKind.Table) { Module = module; EntityType = entityType; Kind = kind; Name = entityType.Name; //Check for generic types - happens in modules with generic entities (interfaces), provided for customization if (Name.Contains('`')) { Name = Name.Substring(0, Name.IndexOf('`')); } if (EntityType.IsInterface && Name.Length > 1 && Name.StartsWith("I")) { Name = Name.Substring(1); } //check if entity was moved if (!module.App.MovedEntities.TryGetValue(entityType, out this.Area)) { Area = Module.Area; } FullName = Area.Name + "." + Name; }
public BooksModule(EntityArea area) : base(area, "Books", "Books module", version: CurrentVersion) { Requires <JobExecutionModule>(); RegisterEntities(typeof(IBook), typeof(IPublisher), typeof(IAuthor), typeof(IBookAuthor), typeof(IBookReview), typeof(IUser), typeof(IBookOrder), typeof(IBookOrderLine), typeof(ICoupon), typeof(IImage)); //Register companion types that describe keys and indexes on entities RegisterCompanionTypes( typeof(IBookKeys), typeof(IAuthorKeys), typeof(IPublisherKeys)); //Add extra tracking columns in book, order, coupon entities var tranLogExt = new TransactionLogModelExtender(); tranLogExt.AddUpdateStampColumns(new[] { typeof(IBook), typeof(IBookOrder), typeof(IBookOrderLine), typeof(ICoupon) }, createIdPropertyName: "CreatedIn", updateIdPropertyName: "UpdatedIn"); App.ModelExtenders.Add(tranLogExt); //Set cached types App.CacheSettings.AddCachedTypes(CacheType.FullSet, typeof(IBook), typeof(IPublisher), typeof(IAuthor), typeof(IBookAuthor)); App.CacheSettings.AddCachedTypes(CacheType.Sparse, typeof(IBookOrder), typeof(IBookOrderLine), typeof(IUser), typeof(IImage)); //Register api controllers App.ApiConfiguration.RegisterControllerTypes(typeof(CatalogController), typeof(UserAccountController), typeof(SignupController)); RegisterViews(); }//method
public Wolf(WolfActivePlayer player, EntityArea entityArea) : base(entityArea) { this.player = player; offsetY = 12f; body = new FContainer(); bodySprite = new FSprite(WolfAnimation.Idle.frames[0]); body.AddChild(bodySprite); bodySprite.color = player.player.color.color + new Color(0.5f, 0.5f, 0.5f, 0.0f); bodySprite.y = offsetY; body.scaleX = player.isFacingLeft ? 1f : -1f; // colorSprite = new FSprite("Arena/Wolf_Idle1_color"); // colorSprite.color = player.player.color.color; // body.AddChild(colorSprite); // shadowSprite = new FSprite("Arena/VillShadow"); shadowSprite.alpha = 0.2f; shadowSprite.scaleX = 1.9f; shadowSprite.scaleY = 1.0f; }
public LoginLogModule(EntityArea area, string name = "LoginLog", string description = null) : base(area, name, description, version: CurrentVersion) { RegisterEntities(typeof(ILoginLog)); App.RegisterService <ILoginLogService>(this); }
public EntityCommand(string commandName, string description, EntityCommandKind kind, Type entityType, EntityArea area) : this(commandName, description, kind) { TargetEntityType = entityType; Area = area; }
public IncidentLogModule(EntityArea area, string name = "IncidentLog") : base(area, name, version: CurrentVersion) { RegisterEntities(typeof(IIncidentLog), typeof(IIncidentAlert)); App.RegisterService <IIncidentLogService>(this); }
public Entity(EntityArea entityArea) { this.entityArea = entityArea; }
public PersonModule(EntityArea area) : base(area, "PersonModule") { RegisterEntities(typeof(IPerson)); }
public LockTestModule(EntityArea area) : base(area, "LockTestModule", version: new Version("1.0.0.0")) { RegisterEntities(typeof(IDoc), typeof(IDocDetail)); }
public AppEventLogModule(EntityArea area) : base(area, "AppEventLog", "App events log.", CurrentVersion) { RegisterEntities(typeof(IAppEvent)); }
public List<string> UpdateMemberNames; //For PartialUpdate - names of members to update #endregion Fields #region Constructors public EntityCommand(string commandName, string description, EntityCommandKind kind, Type entityType, EntityArea area) : this(commandName, description, kind) { TargetEntityType = entityType; Area = area; }
public DbInfoModule(EntityArea area) : base(area, "DbInfo", version: CurrentVersion) { RegisterEntities(typeof(IDbInfo), typeof(IDbModuleInfo)); App.RegisterService <IDbInfoService>(this); }
public EntityModuleBooks(EntityArea area) : base(area, "EntityModuleBooks", version: CurrentVersion) { base.RegisterEntities( typeof(Object)); }
// Alice created a constructor with extra parameter userEntityType // suggesting to provide a real type of User entity in the system. public LoginModule(EntityArea area, Type userEntityType) : base(area, "Login") { RegisterEntities(typeof(ILogin), typeof(IUserStub)); //still need to register IUserStub, to immediately replace it App.ReplaceEntity(typeof(IUserStub), userEntityType); }
public UserSessionModule(EntityArea area, UserSessionSettings settings = null, string name = "UserSessionModule") : base(area, settings, name) { }
public DbUpgradeLogModule(EntityArea area, string name = "DbUpgradeLog") : base(area, name, version: CurrentVersion) { RegisterEntities(EntityTypes); App.RegisterService <IDbUpgradeLogService>(this); }
public AddressPhoneModule(EntityArea area, string name = "AddressPhone") : base(area, name) { }