예제 #1
0
        public AnimatedMultipleComponent( GenericManager<String, AnimationComponent> animationList, int ownerID, Vector2 position, int width, int height,
            Texture2D texture, Nullable<Rectangle> sourceRect = null, bool glow = false,
            Nullable<Color> tint = null, float rotation = 0.0f, Nullable<Vector2> origin = null,
            float scale = 1.0f, SpriteEffects spriteEffect = SpriteEffects.None, float layer = 1.0f)
            : base(ownerID, position, width, height, texture, sourceRect, glow, tint, rotation, origin, scale, spriteEffect, layer)
        {
            // Start Constructor.

            _aimationList = animationList;
        }
예제 #2
0
        //Hypersticks
        private void CreateCylinderByShader(int start)
        {
            GameObject Stick;
            int        i = start;

            int[] atomsIds = bondEPList[i] as int[];
            Stick = GameObject.CreatePrimitive(PrimitiveType.Cube);
            RuntimePlatform platform = Application.platform;

            switch (platform)
            {
            case RuntimePlatform.WindowsPlayer:
            case RuntimePlatform.WindowsWebPlayer:
            case RuntimePlatform.WindowsEditor:
                Stick.GetComponent <Renderer>().material.shader = Shader.Find("FvNano/Stick HyperBalls 2 OpenGL");
                break;

            default:
                Stick.GetComponent <Renderer>().material.shader = Shader.Find("FvNano/Stick HyperBalls 2 OpenGL");
                break;
            }
            StickUpdate comp = Stick.AddComponent <StickUpdate>();

            //Debug.Log("BOND : " + atomsIds[0] + " - " + atomsIds[1]);
            //comp.atompointer1=(GameObject)MoleculeModel.atoms[atomsIds[0]];
            //comp.atompointer2=(GameObject)MoleculeModel.atoms[atomsIds[1]];

            if (UI.UIData.atomtype == UI.UIData.AtomType.particleball)
            {
                comp.atompointer1 = (GameObject)MoleculeModel.atoms[atomsIds[0]];
                comp.atompointer2 = (GameObject)MoleculeModel.atoms[atomsIds[1]];
            }
            else
            {
                GenericManager manager = Molecule.View.DisplayMolecule.GetManagers()[0];
                comp.atompointer1 = manager.GetBall(Molecule.Model.MoleculeModel.atoms.Count - 1 - atomsIds[0]);
                comp.atompointer2 = manager.GetBall(Molecule.Model.MoleculeModel.atoms.Count - 1 - atomsIds[1]);
            }

            comp.enabled = true;
            Stick.GetComponent <Renderer>().material.SetFloat("_Shrink", StickUpdate.shrink);
            Stick.tag = "Club";
            Stick.GetComponent <Collider>().enabled = false;
            Stick.transform.position = comp.atompointer1.transform.position;
            Stick.transform.parent   = BondCubeParent.transform;
        }
        public static UserGuideEvent CheckUserGuideEvent(this UserProfile profile, GenericManager <BFDataContext> models, bool includeAfterToday = false)

        {
            var items = models.GetTable <UserEvent>().Where(v => v.StartDate <= DateTime.Today && v.UID == profile.UID)
                        .Join(models.GetTable <SystemEventBulletin>(), v => v.SystemEventID, b => b.EventID, (v, b) => v);

            if (items.Count() > 0)
            {
                return(new UserGuideEvent
                {
                    GuideEventList = items,
                    Profile = profile,
                });
            }

            return(null);
        }
예제 #4
0
        public static void CreateAllowanceForContract(this GenericManager <BFDataContext> models, CourseContract contractItem, int totalAllowanceAmount, UserProfile handler, DateTime?allowanceDate = null)
        {
            var paymentItems = contractItem.ContractPayment.Select(p => p.Payment)
                               .Where(p => p.PayoffAmount > 0)
                               .FilterByEffective()
                               .Where(p => p.InvoiceID.HasValue)
                               .OrderByDescending(p => p.PaymentID)
                               .ToArray();
            int totalAmt = totalAllowanceAmount;

            for (int i = 0; totalAmt > 0 && i < paymentItems.Length; i++)
            {
                var allowanceAmt = Math.Min(totalAmt, paymentItems[i].PayoffAmount.Value);
                models.PrepareAllowanceForPayment(paymentItems[i], allowanceAmt, "終止退款", allowanceDate);
                paymentItems[i].VoidPayment.HandlerID = handler?.UID;
                totalAmt -= allowanceAmt;
            }
        }
예제 #5
0
        public static WebHome.Models.MIG3_1.E0402.BranchTrackBlank CreateE0402(this GenericManager <BFDataContext> models, InquireVacantNoResult[] items)

        {
            var v        = items[0];
            var interval = models.GetTable <InvoiceNoInterval>().Where(i => i.SellerID == v.SellerID && i.TrackID == v.TrackID).First();
            var result   = new Models.MIG3_1.E0402.BranchTrackBlank
            {
                Main = new Models.MIG3_1.E0402.Main
                {
                    BranchBan = interval.InvoiceTrackCodeAssignment.Organization.ReceiptNo,
                    HeadBan   = interval.GroupID.HasValue
                        ? interval.InvoiceNoIntervalGroup.InvoiceNoInterval.First().InvoiceTrackCodeAssignment.Organization.ReceiptNo
                        : interval.InvoiceTrackCodeAssignment.Organization.ReceiptNo,
                    InvoiceTrack = v.TrackCode,
                    InvoiceType  = Models.MIG3_1.E0402.InvoiceTypeEnum.Item07,
                    YearMonth    = String.Format("{0}{1:00}", v.Year - 1911, v.PeriodNo * 2)
                }
            };

            List <Models.MIG3_1.E0402.DetailsBranchTrackBlankItem> details = new List <Models.MIG3_1.E0402.DetailsBranchTrackBlankItem>();

            foreach (var item in items.Where(r => !r.CheckPrev.HasValue))
            {
                InquireVacantNoResult tailItem;
                if (item.CheckNext.HasValue)
                {
                    var index = Array.IndexOf(items, item);
                    tailItem = items[index + 1];
                }
                else
                {
                    tailItem = item;
                }

                details.Add(new Models.MIG3_1.E0402.DetailsBranchTrackBlankItem
                {
                    InvoiceBeginNo = String.Format("{0:00000000}", item.InvoiceNo),
                    InvoiceEndNo   = String.Format("{0:00000000}", tailItem.InvoiceNo)
                });
            }

            result.Details = details.ToArray();
            return(result);
        }
        public static void UpdateMonthlyAchievementGoal(this MonthlyIndicator item, GenericManager <BFDataContext> models)

        {
            IQueryable <MonthlyCoachRevenueIndicator> coachItems      = models.GetTable <MonthlyCoachRevenueIndicator>().Where(r => r.PeriodID == item.PeriodID);
            List <MonthlyBranchRevenueGoal>           branchGoalItems = new List <MonthlyBranchRevenueGoal>();

            foreach (var branchIndicator in item.MonthlyBranchIndicator)
            {
                var revenueGoal = branchIndicator.MonthlyBranchRevenueIndicator.Where(r => r.MonthlyBranchRevenueGoal != null)
                                  .Select(r => r.MonthlyBranchRevenueGoal).FirstOrDefault();
                if (revenueGoal == null)
                {
                    continue;
                }

                var branchItems = coachItems.Where(c => c.BranchID == branchIndicator.BranchID);
                revenueGoal.CustomRevenueGoal = branchItems.Sum(b => b.LessonTuitionGoal + b.AchievementGoal);

                var baseIndicator = branchIndicator.MonthlyBranchRevenueIndicator.OrderBy(m => m.GradeID).First();
                revenueGoal.CustomIndicatorPercentage = Math.Round(((decimal?)revenueGoal.CustomRevenueGoal * (decimal?)baseIndicator.MonthlyRevenueGrade.IndicatorPercentage / (decimal?)baseIndicator.RevenueGoal) ?? 0m, 2);

                revenueGoal.AchievementGoal     = branchItems.Sum(b => b.AchievementGoal);
                revenueGoal.LessonTuitionGoal   = branchItems.Sum(b => b.LessonTuitionGoal);
                revenueGoal.CompleteLessonsGoal = branchItems.Sum(b => b.CompleteLessonsGoal);

                models.SubmitChanges();
                branchGoalItems.Add(revenueGoal);
            }

            var headquarterRevenueGoal = item.MonthlyRevenueIndicator.Where(r => r.MonthlyRevenueGoal != null)
                                         .Select(r => r.MonthlyRevenueGoal).FirstOrDefault();

            if (headquarterRevenueGoal != null)
            {
                headquarterRevenueGoal.CustomRevenueGoal = branchGoalItems.Sum(b => b.CustomRevenueGoal);
                var baseIndicator = item.MonthlyRevenueIndicator.OrderBy(r => r.GradeID).First();
                headquarterRevenueGoal.CustomIndicatorPercentage = Math.Round((decimal)headquarterRevenueGoal.CustomRevenueGoal * (decimal)baseIndicator.MonthlyRevenueGrade.IndicatorPercentage / (decimal)baseIndicator.RevenueGoal, 2);
                headquarterRevenueGoal.AchievementGoal           = branchGoalItems.Sum(b => b.AchievementGoal);
                headquarterRevenueGoal.LessonTuitionGoal         = branchGoalItems.Sum(b => b.LessonTuitionGoal);
                headquarterRevenueGoal.CompleteLessonsGoal       = branchGoalItems.Sum(b => b.CompleteLessonsGoal);

                models.SubmitChanges();
            }
        }
예제 #7
0
        private void GetValues()
        {
            if (Entity != null && GenericManager != null)
            {
                IsVisibleGridRibbon    = true;
                IsVisibleSubGridRibbon = false;
                var data = new DataSetModel();
                data = GenericManager.RetrieveAll(Entity.LogicalName);

                if (FilterRelationsip != null && FilterRelationsipId != Guid.Empty)
                {
                    IsVisibleGridRibbon    = false;
                    IsVisibleSubGridRibbon = true;
                    if (FilterRelationsip.IsManyToMany)
                    {
                        var firstEntity  = Entity.LogicalName;
                        var secondEntity = FilterRelationsip.MainEntity == firstEntity
                                ? FilterRelationsip.RelatedEntity
                                : FilterRelationsip.MainEntity;
                        FirstEntityAssociation  = firstEntity;
                        SecondEntityAssociation = secondEntity;

                        var values = GenericManager.RetrieveAllAssociated(secondEntity, FilterRelationsipId, FilterRelationsip.IntersectionName, firstEntity);
                        data = values;
                    }
                    else
                    {
                        var filteredValues = data.Values.Where(row =>
                        {
                            var containsRecord = row.Values.ContainsKey(FilterRelationsip.RelatedAttribute);
                            if (containsRecord)
                            {
                                var record = (EntityReferenceValue)row.Values[FilterRelationsip.RelatedAttribute];
                                return(record.Id == FilterRelationsipId);
                            }
                            return(false);
                        }).ToList();
                        data.Values = filteredValues;
                    }
                }
                DataSetModel = data;
                _view.UpdateColumns(Entity.Attributes);
            }
        }
        List <MailTemplate> GetCachedTemplates()
        {
            List <MailTemplate> templates = GetTemplatesFromCache();

            if (templates == null)
            {
                GenericManager manager = new GenericManager();
                templates = manager.GetTemplates();
                try{
                    _CacheTemplates.Add(_CacheKeyMailTemplate, new CachedItem <List <MailTemplate> >(templates));
                }
                catch (ArgumentException ex)
                {
                    templates = GetTemplatesFromCache();
                }
            }

            return(templates);
        }
예제 #9
0
        private void CreateOwnerAttribute(GenericManager manager)
        {
            var ownerProperty = new Property()
            {
                Name     = "Owner",
                Type     = new OptionSetValue((int)Property.PropertyType.EntityReference),
                SchemaId = SchemaEntityReference,
            };

            manager.Create(Property.LogicalName, Entity.EntityToDictionary(ownerProperty));

            CreateDefaultViewRepositoryMethod(manager, "GetByOwner", new MethodParameter[] {
                new MethodParameter()
                {
                    Name = "Id",
                    Type = MethodParameter.ParameterInputType.Guid
                }
            });
        }
        public static void RegisterSpecialGivingLesson2021(this GenericManager <BFDataContext> models, int[] items)

        {
            var table = models.GetTable <RegisterLesson>();

            foreach (var uid in items)
            {
                foreach (var priceID in SpecialGivingLesson2021)
                {
                    var givingLesson = table
                                       .Where(r => r.ClassLevel == priceID)
                                       .Where(r => r.UID == uid)
                                       .FirstOrDefault();

                    if (givingLesson == null)
                    {
                        givingLesson = new RegisterLesson
                        {
                            UID                 = uid,
                            RegisterDate        = DateTime.Now,
                            GroupingMemberCount = 1,
                            Lessons             = 1,
                            ClassLevel          = priceID,
                            IntuitionCharge     = new IntuitionCharge
                            {
                                ByInstallments = 1,
                                Payment        = "Cash",
                                FeeShared      = 0
                            },
                            Attended        = (int)Naming.LessonStatus.準備上課,
                            AdvisorID       = Startup.Properties.GetValue <int?>("DefaultCoach"),
                            AttendedLessons = 0,
                            GroupingLesson  = new GroupingLesson {
                            },
                        };

                        table.InsertOnSubmit(givingLesson);
                    }

                    models.SubmitChanges();
                }
            }
        }
        public static PDQQuestion PromptLearnerDailyQuestion(this GenericManager <BFDataContext> models, UserProfile profile)

        {
            if (models.GetTable <PDQTask>().Any(t => t.UID == profile.UID &&
                                                t.TaskDate >= DateTime.Today && t.TaskDate < DateTime.Today.AddDays(1) &&
                                                t.PDQQuestion.GroupID == 6))
            {
                return(null);
            }

            if (models.GetTable <PDQTask>().Count(t => t.UID == profile.UID && t.PDQQuestion.GroupID == 6) >=
                models.GetTable <RegisterLesson>()
                .Where(r => r.UID == profile.UID)
                .Where(r => r.LessonPriceType.Status != (int)Naming.LessonPriceStatus.在家訓練)
                .Where(r => r.LessonPriceType.Status != (int)Naming.LessonPriceStatus.教練PI)
                .Where(r => r.LessonPriceType.Status != (int)Naming.LessonPriceStatus.點數兌換課程)
                .Join(models.GetTable <GroupingLesson>(), r => r.RegisterGroupID, g => g.GroupID, (r, g) => g)
                .Join(models.GetTable <LessonTime>(), g => g.GroupID, l => l.GroupID, (g, l) => l)
                .Where(l => l.LessonPlan.CommitAttendance.HasValue || l.LessonAttendance != null).Count())
            {
                return(null);
            }

            IQueryable <PDQQuestion> questItems = models.PromptDailyQuestion()
                                                  .Join(models.GetTable <UserProfile>().Where(u => u.LevelID == (int)Naming.MemberStatusDefinition.Checked),
                                                        q => q.AskerID, u => u.UID, (q, u) => q);

            int[] items = questItems
                          .Select(q => q.QuestionID)
                          .Where(q => !models.GetTable <PDQTask>().Where(t => t.UID == profile.UID).Select(t => t.QuestionID).Contains(q)).ToArray();

            if (items.Length == 0)
            {
                items = questItems
                        .Select(q => q.QuestionID).ToArray();
            }

            profile.DailyQuestionID = items[DateTime.Now.Ticks % items.Length];

            var item = models.GetTable <PDQQuestion>().Where(q => q.QuestionID == profile.DailyQuestionID).FirstOrDefault();

            return(item);
        }
        //List<MailNotificationSettings> GetCachedMailSettings()
        //{
        //    List<MailNotificationSettings> settings;
        //    CachedItem<List<MailNotificationSettings>> cached;
        //    DateTime DataRead = DateTime.Now.AddMinutes(-15);
        //    if ((_CacheMailSettings.TryGetValue(_CacheKeyMailNotificationSettings, out cached)))
        //    {
        //        if (cached == null || cached.InsertedDate < DataRead)
        //        {
        //            GenericManager manager = new GenericManager();
        //            settings = manager.GetMailNotificationSettings();
        //            _CacheMailSettings[_CacheKeyMailNotificationSettings] = new CachedItem<List<MailNotificationSettings>>(settings);
        //        }
        //        else
        //        {
        //            settings = cached.Item;
        //        }
        //    }
        //    else
        //    {
        //        GenericManager manager = new GenericManager();
        //        settings = manager.GetMailNotificationSettings();
        //        _CacheMailSettings.Add(_CacheKeyMailNotificationSettings, new CachedItem<List<MailNotificationSettings>>(settings));
        //    }

        //    return settings;
        //}
        List <ErrorSettings> GetCachedErrorSettings()
        {
            List <ErrorSettings> settings = GetErrorSettingsFromCache();

            if (settings == null)
            {
                GenericManager manager = new GenericManager();
                settings = manager.GetErrorSettings();
                try
                {
                    _CacheErrorSettings.Add(_CacheKeyErrorSettings, new CachedItem <List <ErrorSettings> >(settings));
                }
                catch (ArgumentException ex) {
                    settings = GetErrorSettingsFromCache();
                }
            }

            return(settings);
        }
예제 #13
0
        protected override void Seed(ApplicationDbContext context)
        {
            var  postadmin = new GenericManager <Post>(new DomainModel.Data.DataContext());
            Post post      = new Post {
                post = "Админ"
            };

            postadmin.Add(post);
            postadmin.Save();
            var userManager = new ApplicationUserManager(new UserStore <ApplicationUser>(context));

            var roleManager = new RoleManager <IdentityRole>(new RoleStore <IdentityRole>(context));

            // создаем две роли
            var role1 = new IdentityRole {
                Name = "admin"
            };
            var role2 = new IdentityRole {
                Name = "user"
            };

            // добавляем роли в бд
            roleManager.Create(role1);
            roleManager.Create(role2);

            // создаем пользователей
            var admin = new ApplicationUser {
                Email = "*****@*****.**", UserName = "******"
            };                                                                                      // , Post = post };
            string password = "******";
            var    result   = userManager.Create(admin, password);

            // если создание пользователя прошло успешно
            if (result.Succeeded)
            {
                // добавляем для пользователя роль
                userManager.AddToRole(admin.Id, role1.Name);
                userManager.AddToRole(admin.Id, role2.Name);
            }

            base.Seed(context);
        }
예제 #14
0
        private void InitializeCommands()
        {
            SaveCommand = new RelayCommand((data) =>
            {
                if (Mode == DetailMode.Creating)
                {
                    var id      = GenericManager.Create(Entity.LogicalName, Values);
                    var newData = GenericManager.Retrieve(Entity.LogicalName, id);
                    Id          = id;
                    Values      = newData.Values;
                    Mode        = DetailMode.Updating;
                    BusinessEventManager.RaiseOnCreatedEntity(Entity, newData.Values);
                }
                else if (Mode == DetailMode.Updating)
                {
                    GenericManager.Update(Entity.LogicalName, Id, Values);
                    BusinessEventManager.RaiseOnUpdatedEntity(Entity, Id, Values);
                }
            },
                                           (data) =>
            {
                return(IsCompleted);
            });

            DeleteCommand = new RelayCommand((data) =>
            {
                var dialog = new OkCancelMessageBox("Confirm the delete? This operation cannot be undone", "Delete operation");
                dialog.ShowDialog();
                if (dialog.Response == OkCancelMessageBox.InputTextBoxResponse.OK)
                {
                    GenericManager.Delete(Entity.LogicalName, Id);
                    BusinessEventManager.RaiseOnDeletedEntity(Entity, Id);
                }
            },
                                             (data) =>
            {
                return(Mode == DetailMode.Updating);
            });

            RegisterCommand(SaveCommand);
            RegisterCommand(DeleteCommand);
        }
예제 #15
0
        public void Initialize(
            InputParameterSelectorWindow view,
            GenericManager manager,
            List <MethodParameterViewModel> methodInputParameters,
            List <MethodParameterReferenceViewModel> availableInputParameterReferences,
            List <MethodParameterReferenceValueViewModel> methodInputParametersReferenceValues)
        {
            NewInputParametersReferenceValues = new List <MethodParameterReferenceValueViewModel>();

            _view = view
                    ?? throw new ArgumentNullException(nameof(view));
            MethodInputParameters = methodInputParameters
                                    ?? throw new ArgumentNullException(nameof(methodInputParameters));
            AvailableInputParameterReferences = availableInputParameterReferences
                                                ?? throw new ArgumentNullException(nameof(availableInputParameterReferences));;
            MethodInputParametersReferenceValues = methodInputParametersReferenceValues
                                                   ?? throw new ArgumentNullException(nameof(methodInputParametersReferenceValues));
            GenericManager = manager
                             ?? throw new ArgumentNullException(nameof(manager));
        }
        public static UserProfile ValiateLogin(this LoginViewModel viewModel, GenericManager <BFDataContext> models, ModelStateDictionary modelState)

        {
            UserProfile item = models.GetTable <UserProfile>().Where(u => u.PID == viewModel.PID &&
                                                                     u.LevelID == (int)Naming.MemberStatusDefinition.Checked).FirstOrDefault();

            if (item == null)
            {
                modelState.AddModelError("PID", "您輸入的資料錯誤,請確認後再重新輸入!!");
                return(null);
            }

            if (item.Password != (viewModel.Password).MakePassword())
            {
                modelState.AddModelError("PID", "您輸入的資料錯誤,請確認後再重新輸入!!");
                return(null);
            }

            return(item);
        }
        public static ModelSource <TEntity> InvokeModelSource <TEntity>(this TempDataDictionary tempData)
            where TEntity : class, new()
        {
            GenericManager <BFDataContext> models = tempData.GetGenericModelSource();

            if (models == null)
            {
                models = new ModelSource <TEntity>();
                tempData.SetModelSource <TEntity>((ModelSource <TEntity>)models);
                return((ModelSource <TEntity>)models);
            }
            else if (models is ModelSource <TEntity> )
            {
                return((ModelSource <TEntity>)models);
            }
            else
            {
                return(new ModelSource <TEntity>(models));
            }
        }
예제 #18
0
        public void Initialize(
            GenericRecordFinderWindow view,
            GenericManager manager,
            string mainEntityLogicalName,
            Guid mainEntityId,
            string targetEntityLogicalName)
        {
            if (string.IsNullOrEmpty(mainEntityLogicalName))
            {
                throw new ArgumentException("message", nameof(mainEntityLogicalName));
            }

            if (string.IsNullOrEmpty(targetEntityLogicalName))
            {
                throw new ArgumentException("message", nameof(targetEntityLogicalName));
            }
            MainEntityId            = mainEntityId;
            _view                   = view ?? throw new ArgumentNullException(nameof(view));
            GenericManager          = manager ?? throw new ArgumentNullException(nameof(manager));
            MainEntityLogicalName   = mainEntityLogicalName;
            TargetEntityLogicalName = targetEntityLogicalName;


            if (mainEntityId == Guid.Empty)
            {
                // Show first record list (grid)
                HierarchyRecordCollection = new HierarchyDrmRecordCollectionInputData()
                {
                    GenericManager          = GenericManager,
                    TargetEntityLogicalName = TargetEntityLogicalName,
                    Records               = GenericManager.RetrieveAll(MainEntityLogicalName).Values,
                    ParentContextEntity   = null,
                    ParentContextEntityId = Guid.Empty,
                    ContextEntity         = MainEntityLogicalName,
                };
            }
            else
            {
                // Show first record
            }
        }
예제 #19
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                string __RedirectURL = string.Empty;
                {
                    GenericManager <T_User> Manager   = new GenericManager <T_User>();
                    List <string>           FieldList = new List <string>();
                    var model = new T_User();
                    CreateModel(FieldList, model, Manager);

                    PluginEventArgs __PluginEventArg = new PluginEventArgs(model, FieldList, __RedirectURL);
                    //旧插件按钮前的操作和判断跳转
                    PagePluginFactory.InvokeBeforePlugins(sender, __PluginEventArg);
                    if (!string.IsNullOrEmpty(__PluginEventArg.Params[2].ToString()))
                    {
                        Response.Redirect(__PluginEventArg.Params[2].ToString(), false);
                    }


                    Manager.Update(model, FieldList);

                    //旧插件按钮后的操作和判断跳转
                    PagePluginFactory.InvokeAfterPlugins(sender, __PluginEventArg);
                    if (!string.IsNullOrEmpty(__PluginEventArg.Params[2].ToString()))
                    {
                        Response.Redirect(__PluginEventArg.Params[2].ToString(), false);
                    }



                    __Id = model.User_ID;

                    this.AjaxAlert("保存成功", "EnableButton();");
                }
            }
            catch (Exception ex)
            {
                this.AjaxAlert(ex, "EnableButton();");
            }
        }
예제 #20
0
        public static IQueryable <RegisterLesson> FilterByUnpaidLesson(this GenericManager <BFDataContext> models, IQueryable <RegisterLesson> items = null)

        {
            if (items == null)
            {
                items = models.GetTable <RegisterLesson>();
            }

            IQueryable <IntuitionCharge> intuitionItems = models.GetTable <IntuitionCharge>()
                                                          .Join(models.GetTable <TuitionInstallment>(), c => c.RegisterID, t => t.RegisterID, (c, t) => c);
            var voidItems = models.GetTable <VoidPayment>()
                            .Where(v => v.Status == (int)Naming.CourseContractStatus.已生效);
            IQueryable <IntuitionCharge> paidItems = models.GetTable <Payment>().Where(p => !voidItems.Any(v => v.VoidID == p.PaymentID))
                                                     .Join(models.GetTable <TuitionInstallment>(), p => p.PaymentID, t => t.InstallmentID, (p, t) => t)
                                                     .Join(models.GetTable <IntuitionCharge>(), t => t.RegisterID, c => c.RegisterID, (t, c) => c);

            //return items.Where(r => r.IntuitionCharge.TuitionInstallment.Count == 0
            //        || !r.IntuitionCharge.TuitionInstallment.Any(t => t.Payment.VoidPayment == null || t.Payment.VoidPayment.Status != (int)Naming.CourseContractStatus.已生效));
            return(items.Where(r => !intuitionItems.Any(c => c.RegisterID == r.RegisterID) ||
                               !paidItems.Any(v => v.RegisterID == r.RegisterID)));
        }
예제 #21
0
        public override void OnCreate()
        {
            base.OnCreate();

            string dbfilename  = "fietsdb.db";
            string libraryPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
            string path        = System.IO.Path.Combine(libraryPath, dbfilename);

            if (!System.IO.File.Exists(path))
            {
                var        s           = Resources.OpenRawResource(Resource.Raw.fietsdb);
                FileStream writeStream = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write);
                ReadWriteStream(s, writeStream);
            }

            connection = new SQLiteConnection(path);

            RobberyManager     = new GenericManager <Robbery>(connection);
            BicyclceBinManager = new GenericManager <BicycleBin>(connection);
            OurLocationManager = new CurrentLocationActivity();
        }
예제 #22
0
        private Guid CreateDefaultViewRepositoryMethod(GenericManager genericManager, string methodName, MethodParameter[] inputParameters)
        {
            var content = new RepositoryMethodContent()
                          .AddDefaultOutputViewParameter();

            foreach (var item in inputParameters)
            {
                item.Direction = MethodParameter.ParameterDirection.Input;
            }
            content.Parameters.AddRange(inputParameters);

            var method = new RepositoryMethod()
            {
                Name         = methodName,
                RepositoryId = RepositoryEntityReference,
                Type         = new OptionSetValue((int)RepositoryMethod.RepositoryMethodType.View),
                Content      = JsonParserService.StringfyWithTypes(content),
            };

            return(genericManager.Create(RepositoryMethod.LogicalName, Entity.EntityToDictionary(method)));
        }
        public static void ClearUnpaidOverdueContract(this GenericManager <BFDataContext> models)

        {
            DateTime checkDate = DateTime.Today.FirstDayOfMonth();
            var      items     = models.PromptUnpaidContract()
                                 .Where(c => c.PayoffDue.Value.AddMonths(1) < checkDate)
                                 .Where(c => c.CourseContractExtension.Version.HasValue);

            foreach (var item in items)
            {
                item.Status  = (int)Naming.CourseContractStatus.已終止;
                item.ValidTo = checkDate;
                item.Subject = "已自動終止";
            }
            models.SubmitChanges();

            foreach (var item in items)
            {
                item.TerminateRegisterLesson(models);
            }
        }
예제 #24
0
        private void CreateStateAttributes(GenericManager genericManager)
        {
            var stateProperty = new Property()
            {
                Name     = "State",
                Type     = new OptionSetValue((int)Property.PropertyType.State),
                SchemaId = SchemaEntityReference
            };

            var statusProperty = new Property()
            {
                Name     = "Status",
                Type     = new OptionSetValue((int)Property.PropertyType.Status),
                SchemaId = SchemaEntityReference
            };

            genericManager.Create(Property.LogicalName, Entity.EntityToDictionary(stateProperty));
            genericManager.Create(Property.LogicalName, Entity.EntityToDictionary(statusProperty));

            _ = CreateDefaultZeroInputsViewRepositoryMethod(genericManager, "GetActive");
            _ = CreateDefaultZeroInputsViewRepositoryMethod(genericManager, "GetInactive");
        }
예제 #25
0
        public static void ProcessE0402(this GenericManager <BFDataContext> models, int year, int periodNo, int?branchID)

        {
            IQueryable <BranchStore> items = models.GetTable <BranchStore>();

            if (branchID.HasValue)
            {
                items = items.Where(b => b.BranchID == branchID);
            }

            foreach (var item in items)
            {
                var vacantNoList = models.DataContext.InquireVacantNo(item.BranchID, year, periodNo)
                                   .GroupBy(v => v.TrackID);
                foreach (var v in vacantNoList)
                {
                    Models.MIG3_1.E0402.BranchTrackBlank result = models.CreateE0402(v.ToArray());
                    String fileName = Path.Combine(TaskExtensionMethods.E0402Outbound, result.Main.YearMonth + "-" + result.Main.BranchBan + ".xml");
                    result.ConvertToXml().Save(fileName);
                }
            }
        }
        public static DataSet GetDataSetResult(this GenericManager <BFDataContext> models, IQueryable items, DataTable table)

        {
            using (SqlCommand sqlCmd = (SqlCommand)models.GetCommand(items))
            {
                //sqlCmd.Connection = (SqlConnection)models.DataContext.Database.GetDbConnection();
                sqlCmd.Connection = (SqlConnection)models.DataContext.Connection;
                using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCmd))
                {
                    int colCount = table.Columns.Count;
                    adapter.Fill(table);
                    if (colCount > 0)
                    {
                        while (table.Columns.Count > colCount)
                        {
                            table.Columns.RemoveAt(table.Columns.Count - 1);
                        }
                    }
                    return(table.DataSet);
                }
            }
        }
예제 #27
0
        private void CreateCrudServices(GenericManager manager)
        {
            CreateCreateMethod(manager);

            var updateMehtodId = CreateRepositoryMethod(manager, "Update",
                                                        RepositoryMethod.RepositoryMethodType.Update,
                                                        new MethodParameter[] {
                new MethodParameter()
                {
                    Name = "Entity",
                    Type = MethodParameter.ParameterInputType.Entity,
                }
            }, null);

            var deleteMethodId = CreateRepositoryMethod(manager, "DeleteByPk",
                                                        RepositoryMethod.RepositoryMethodType.DeleteByPk,
                                                        new MethodParameter[] {
                new MethodParameter()
                {
                    Name = "Id",
                    Type = MethodParameter.ParameterInputType.Guid,
                }
            }, null);

            var retrieveMehtodId = CreateRepositoryMethod(manager, "RetrieveByPk",
                                                          RepositoryMethod.RepositoryMethodType.RetrieveByPk,
                                                          new MethodParameter[] {
                new MethodParameter()
                {
                    Name = "Id",
                    Type = MethodParameter.ParameterInputType.Guid,
                }
            },
                                                          new MethodParameter()
            {
                Name = "Entity",
                Type = MethodParameter.ParameterInputType.Entity,
            });
        }
예제 #28
0
        public static void RefreshPersonalRank(this GenericManager <BFDataContext> models)

        {
            int rankIndex;

            models.ExecuteCommand("DELETE FROM ExerciseGamePersonalRank");
            rankIndex = 1;
            var personalRank = models.GetTable <ExerciseGamePersonalRank>();

            foreach (var p in models.GetTable <ExerciseGameRank>()
                     .Where(r => r.RankingScore.HasValue)
                     .GroupBy(r => r.UID).Select(g => new { UID = g.Key, TotalScore = g.Sum(p => p.RankingScore) })
                     .GroupBy(s => s.TotalScore)
                     .OrderByDescending(s => s.Key))
            {
                foreach (var rank in p)
                {
                    var item = models.GetTable <ExerciseGameContestant>().Where(c => c.UID == rank.UID).First();
                    item.TotalScope = p.Key;
                    item.Rank       = rankIndex;
                    item.ExerciseGamePersonalRank = new ExerciseGamePersonalRank
                    {
                        TotalScope = p.Key.Value,
                        Rank       = rankIndex
                    };

                    //personalRank.Add(new ExerciseGamePersonalRank
                    //{
                    //    UID = rank.UID,
                    //    TotalScope = p.Key.Value,
                    //    Rank = rankIndex
                    //});
                }
                rankIndex++;
            }

            models.SubmitChanges();
        }
예제 #29
0
        public MainControlViewModel()
        {
            GenericManager          = new GenericManager();
            BusinessWorkflowManager = new BusinessWorkflowManager(GenericManager);
            FileService             = new FileService();
            JsonParserService       = new JsonParserService();
            StoredMetadataModel     = new StoredMetadataSchemaService(JsonParserService, FileService);
            StoredDataModel         = new StoredGenericValuesService(JsonParserService, FileService);
            BusinessEventManager    = new BusinessEventManager();
            var currentModel = StoredMetadataModel
                               .GetStoredData()
                               .CompleteModel();

            GenericManager.InitializeModel(currentModel);

            GenericManager.CreateHandler                = new CreateService(StoredDataModel);
            GenericManager.UpdateHandler                = new UpdateService(StoredDataModel);
            GenericManager.DeleteHandler                = new DeleteService(StoredDataModel);
            GenericManager.RetrieveHandler              = new RetrieveService(StoredDataModel);
            GenericManager.RetrieveAllHandler           = new RetrieveAllService(StoredDataModel);
            GenericManager.AssociateHandler             = new AssociateService(StoredDataModel);
            GenericManager.DisassociateHandler          = new DisassociateService(StoredDataModel);
            GenericManager.RetrieveAllAssociatedHandler = new RetrieveAllAssociatedService(StoredDataModel);

            Entities      = GenericManager.Model.Entities.OrderBy(k => k.DisplayName).ToList();
            Relationships = GenericManager.Model.Relationships;

            CurrentEntity = !string.IsNullOrEmpty(currentModel.MainEntity)
                 ? Entities.First(k => k.LogicalName == currentModel.MainEntity)
                 : Entities.First();
            CurrentViewType = ViewType.List;

            BusinessEventManager.OnCreateRequested += BusinessEventManager_OnCreateRequested;
            BusinessEventManager.OnUpdatedEntity   += BusinessEventManager_OnUpdatedEntity;
            BusinessEventManager.OnSelectedEntity  += BusinessEventManager_OnSelectedEntity;
            BusinessEventManager.OnDeletedEntity   += BusinessEventManager_OnDeletedEntity;
            InitializeCommands();
        }
예제 #30
0
        //Cubes
        private void CreateCylinder(int i)
        {
/*			GameObject cylinder;
 *                      MeshFilter filter;
 *                      Mesh   cylinderMesh;
 *                      cylinder=GameObject.CreatePrimitive(PrimitiveType.Cube);
 *                      filter=cylinder.GetComponent<MeshFilter>();
 *                      cylinderMesh=filter.mesh;
 *                      filter.mesh=new Mesh();
 *                      CombineInstance []instances=new CombineInstance[end-start];
 */
            int[]      atomsIds = bondEPList[i] as int[];
            GameObject o        = GameObject.CreatePrimitive(PrimitiveType.Cube);

            o.renderer.material = (Material)Resources.Load("Materials/CubeBoneMaterial");
            BondCubeUpdate comp = o.AddComponent <BondCubeUpdate>();

            //comp.atompointer1=(GameObject)MoleculeModel.atoms[atomsIds[0]];
            //comp.atompointer2=(GameObject)MoleculeModel.atoms[atomsIds[1]];

            if (UI.UIData.atomtype == UI.UIData.AtomType.particleball)
            {
                comp.atompointer1 = (GameObject)MoleculeModel.atoms[atomsIds[0]];
                comp.atompointer2 = (GameObject)MoleculeModel.atoms[atomsIds[1]];
            }
            else
            {
                GenericManager manager = Molecule.View.DisplayMolecule.GetManagers()[0];
                comp.atompointer1 = manager.GetBall(Molecule.Model.MoleculeModel.atoms.Count - 1 - atomsIds[0]);
                comp.atompointer2 = manager.GetBall(Molecule.Model.MoleculeModel.atoms.Count - 1 - atomsIds[1]);
            }

//			o.transform.position = location[0];
//			o.transform.LookAt(location[1]);
            o.transform.localScale = new Vector3(0.1f, 0.1f, 1f);
            o.tag = "Club";
            o.transform.parent = BondCubeParent.transform;
        }
예제 #31
0
        public void Execute(GenericManager manager, WorkflowInputParameter inputParameter)
        {
            var id           = (Guid)inputParameter.Values["Id"];
            var record       = manager.Retrieve("Schema", id);
            var schemaObject = Entity.DictionartyToEntity <Schema>(record.Values);
            var schemaName   = schemaObject.Name;

            SchemaEntityReference = new EntityReferenceValue(id, Schema.LogicalName, schemaName);


            var repositoryName = $"I{schemaObject.Name}MainRepository";
            var repositoryId   = CreateMainRepository(manager, repositoryName);

            RepositoryEntityReference = new EntityReferenceValue(repositoryId, Repository.LogicalName, repositoryName);

            CreateIdAttribute(manager);
            CreateNameAttribute(manager);
            CreateDateAttributes(manager);

            if (schemaObject.HasState)
            {
                CreateStateAttributes(manager);
            }

            if (schemaObject.HasOwner)
            {
                CreateOwnerAttribute(manager);
            }

            if (schemaObject.HasUserRelationship)
            {
                CreateUserAttributes(manager);
            }

            CreateMainModel(manager, schemaName);

            CreateCrudServices(manager);
        }
예제 #32
0
        public static void loadAllTextureFilesToManager( ContentManager content, string path, FileInfo[] fileList, GenericManager<string, Texture2D> textureManager, string extension = null, bool append = false )
        {
            // Start loadAllTextureFiles.

            if ( !append )
            {
                textureManager.unlockList();
                textureManager.clearList();
            }
            else
                textureManager.unlockList();

            int listCount = fileList.Count();
            for (int i = 0; i < listCount; i++)
            {
                if( extension != null )
                    if( fileList[i].Extension != extension )
                        return;

                textureManager.addObject( fileList[i].ToString(), content.Load<Texture2D>( path + fileList[i].Name ) );
            }

            textureManager.lockList();
        }
예제 #33
0
        public void setUp( )
        {
            // Start default setup

            _content = Game1.Instance.Content;

            // Player information:
            _numberOfPlayers = GameGlobals.defaultNumberOfPlayers;

            _playerStartPointList = new List<Vector2>();
            for ( i = 0; i < _numberOfPlayers; i++)
                _playerStartPointList.Add(Vector2.Zero);

            // Viewport information:
            _viewportWidth = Game1.Instance.Graphics.GraphicsDevice.DisplayMode.Width;
            _viewportHeight = Game1.Instance.Graphics.GraphicsDevice.DisplayMode.Height;

            //Sound Options:
            _areSoundEffectsOn = GameGlobals.defaultAreSoundEffectsOn;
            _isMusicOn = GameGlobals.defaultIsMusicOn;
            SoundEffectsVolume = GameGlobals.defaultSoundEffectsVolume;
            MusicVolume = GameGlobals.defaultMusicVolume;

            // Game Object Data
            objectList = new GenericManager<string, BaseGameObject>();

            initializeGameData();
        }
예제 #34
0
    void Initialize()
    {
        // Getting Game system refrecnces:
        if( _gameData == null )
            _gameData = GameData.getInstance();
        if( axesInputDelayControl == null )
            axesInputDelayControl = AxesInputDelayControl.getInstance();

        // Preseting data here since UNITY seems to ignore anything global:
        MapWidth = (int)MazeGlobals.SMALL_MAP_SIZE.x;
        MapHeight = (int)MazeGlobals.SMALL_MAP_SIZE.y;

        // XML/Saving data:
        isSavable = true; //Globals.defaultIsSavable;
        xmlElementName = MazeGlobals.mazeXMLlElementNameDefault;
        xmlNamespace = MazeGlobals.mazeXMLNamespaceDefault;

        savePathAndName = MazeGlobals.mazeSavePathAndNameDefault;

        // Initalizing the list to hold the maps:
        if( _mapList == null )
            _mapList = new GenericManager<int, Map>( isSavable, xmlElementName, xmlNamespace, savePathAndName );

        // Loading a floor if needed:
        if( FloorObj == null )
        {
            FloorObj = GameObject.CreatePrimitive( PrimitiveType.Cube );
            FloorObj.name = GameGlobals.FLOOR_BLOCK_NAME;
            FloorObj.tag = GameGlobals.FLOOR_BLOCK_TAG;
            FloorObj.renderer.material = Resources.Load( GameGlobals.FLOOR_BLOCK_MAT, typeof(Material)) as Material;;
            FloorObj.renderer.material.shader = Shader.Find( GameGlobals.floorShaderList[ (int) SettingsData.getInstance().GameDifficulty ] );
            FloorObj.transform.localScale = GameGlobals.floorSize;

        }

        // Loading a wall if needed:
        if( WallObj == null )
        {
            WallObj = GameObject.CreatePrimitive( PrimitiveType.Cube );
            WallObj.name = GameGlobals.WALL_BLOCK_NAME;
            WallObj.tag = GameGlobals.WALL_BLOCK_TAG;
            WallObj.renderer.material = Resources.Load( ( GameGlobals.WALL_BLOCK_RANDOM_MAT + Random.Range( 2, 13).ToString() ), typeof(Material)) as Material;;
            //WallObj.renderer.material.shader = Shader.Find( GameGlobals.wallShaderList[ (int) _gameData.settings.GameDifficulty ] );
            WallObj.transform.localScale = GameGlobals.wallSize;
        }

        // If the wal or floor are null then exit:
        if( FloorObj == null || WallObj == null )
        {
            Debug.Log("Error wall and/or floor are not initalized");
            return;
        }

        #region Creating the light

        // Creating the light:
        if( AreaLight == null )
        {
            //AreaLight = new GameObject("The Light");
            //AreaLight.AddComponent<Light>();
            //AreaLight.light.color = AreaLightColor;
            //AreaLight.light.type = LightType.Directional;
            //AreaLight.light.intensity = 0.5f;
            //AreaLight.transform.localRotation = new Quaternion( 90, 0, 0, 0 );
            //AreaLight.transform.position = new Vector3( ( MapWidth * FloorSize.x ) / GameGlobals.HALF, ( FloorSize.y + WallSize.y ) * 10,  ( MapHeight * FloorSize.z ) / GameGlobals.HALF );
        }
        #endregion

        #region Map Loading/Gernerating

        Generator = new MazeGenerator();

        // Attempting to laod an XML file and make the first maze,
        // If this does not work then we load the default maze:
        if( !_mapList.loadObjectList( false, Path.Combine( Application.dataPath, savePathAndName ), xmlElementName, xmlNamespace ) )
        {
            // Creating the default raw map data:
            MainMap = new Map();
            MainMap.initalizeDefaultMap(false);

            // Transforming the default raw map data into Unity objects:
            Generator.genrate( ref MainMap, ref MapWidth, ref MapHeight, ref FloorObj, ref WallObj );
            _mapList.addObject( _mapList.Listcount, MainMap );

            // Adding aditional raw map data as needed:
            AddingMazeHelper.mazeListToAdd( ref _mapList ); // Use this to add lots of maps.

            // Saving the raw map data to xml:
            _mapList.saveObjectList( Path.Combine( Application.dataPath, savePathAndName ), xmlElementName, xmlNamespace );
        }
        else
        {
            MainMap = _mapList.getObject(0);
            MainMap.initalizeLoadedMap( false );
            Generator.genrate( ref MainMap, ref MapWidth, ref MapHeight, ref FloorObj, ref WallObj );
        }

        #endregion

        #region Creating Start and End Positions
        // Creating the Start Position Marker:
        if( StartPoint == null )
        {
            StartVector = MainMap.playerStartPoint;
            StartVector.x = (StartVector.x) * FloorObj.transform.localScale.x;
            StartVector.z = (StartVector.z) * FloorObj.transform.localScale.z;
            StartPoint = GameObject.CreatePrimitive( PrimitiveType.Cube );
            StartPoint.name = GameGlobals.START_POSITION_NAME;
            StartPoint.tag = GameGlobals.START_POSITION_TAG;
            StartPoint.transform.localScale = GameGlobals.startAndEndMarkerSize;
            StartPoint.transform.position = new Vector3( StartVector.x, StartPoint.transform.localScale.y, StartVector.z);
            StartMat = Resources.Load( GameGlobals.START_BLOCK_MAT, typeof(Material)) as Material;
            StartPoint.renderer.material = StartMat;

        }

        // Creating the End Position Marker:
        if( EndPoint == null )
        {
            EndVector = MainMap.playerEndPoint;
            EndVector.x = EndVector.x * FloorObj.transform.localScale.x;
            EndVector.z = EndVector.z * FloorObj.transform.localScale.z;
            EndPoint = GameObject.CreatePrimitive( PrimitiveType.Sphere );
            EndPoint.name = GameGlobals.END_POSITION_NAME;
            EndPoint.tag = GameGlobals.END_POSITION_TAG;
            EndPoint.transform.localScale = GameGlobals.startAndEndMarkerSize;
            EndPoint.transform.position = new Vector3( EndVector.x, EndPoint.transform.localScale.y, EndVector.z );  ;
            EndMat = Resources.Load( GameGlobals.END_BLOCK_MAT, typeof(Material)) as Material;
            EndPoint.renderer.material = EndMat;
            EndPoint.collider.isTrigger = true;
            EndPoint.AddComponent<EndPointScript>();
        }

        #endregion

        #region Creating the Player
        // Creating the Player and puting it in the game:
        //Player = Instantiate( Resources.Load( "Player" , typeof(GameObject)) ) as GameObject;
        Player = Instantiate( Resources.Load( "Prefabs/FPSPlayer" , typeof(GameObject)) ) as GameObject;
        Player.name = "FPSPlayer";
        Player.transform.position = new Vector3
            (  StartVector.x, 2, StartVector.z );
        playerScript = Player.GetComponent<vp_FPSPlayer>();
        #endregion

        // Setting up gameplay variables:
        gameState = GameGlobals.GameState.running;

        // Interface Variables
        _playTime = 0.0f;
        _playTimePosition = new Rect( Screen.width - 50,  20, 50, 50 );

        #region Pause Button

        // Seting up the pause Button:
        //_pauseTextureList = new Texture[ GUIGlobals.numberOfButtonStates ];
        //_pauseButtonPosition = new Rect( 0,  Screen.height - 50, 100, 50 );

        //listCount = _pauseTextureList.Length;
        //for( i = 0; i < listCount; i++ )
            //_pauseTextureList[i] = (Texture2D)Resources.Load( GUIGlobals.pauseButtonPathList[i], typeof(Texture2D));

        #endregion

        #region Pause Menu

        // Creating the Pause Menu:
        pauseMenu = new GameObject();
        pauseMenu.name = PauseMenuGlobals.PAUSE_MENU_NAME;
        pauseMenu.tag = PauseMenuGlobals.PAUSE_MENU_TAG;
        pauseMenu.AddComponent<MenuBase>();
        pauseMenu.GetComponent<MenuBase>().initialize( GUIGlobals.menuTypeDefs.PAUSE, PauseMenuGlobals.PAUSE_MENU_BACKGROUND_PATH, PauseMenuGlobals.PAUSE_MENU_BUTTON_TEXTURES, PauseMenuGlobals.PAUSE_MENU_TOOL_TIPS, PauseMenuGlobals.PAUSE_MENU_BUTTON_POSITIONS );
        pauseMenu.SetActive( false );

        #endregion

        // Cleaning up the origanal wall and floor objects:
        Destroy(WallObj);
        Destroy(FloorObj);
    }
예제 #35
0
        public void initializeGameData()
        {
            // Start initializeGameData.

            // Manager Classes:
            ArtManager = new GenericManager<string, Texture2D>();

            // Initializing Definition Lists:
            AnimationDefinitionList = new GenericManager<string, AnimationDefenition>(true, GameGlobals.animationDefenitionFileNamespace, GameGlobals.xmlFileDefaultElement);
            SpriteDefinitionList = new GenericManager<string, SpriteDefenition>(true, GameGlobals.spriteDefenitionNamespace, GameGlobals.xmlFileDefaultElement);
            DoorDefinitionList = new GenericManager<string, AnimationDefenition>(true, GameGlobals.doorDefenitionNamespace, GameGlobals.xmlFileDefaultElement);

            // Testing:
            //TestAnimationList = new GenericManager<string, BaseGameObject>();

            // Garbing the default Data File extinons and path:
            _animationDefenitionFileExtension = GameGlobals.animationDefenitionFileExtension;
            _spriteDefenitionExtension = GameGlobals.spriteDefenitionExtension;
            _doorDefenitionExtension = GameGlobals.doorDefenitionExtension;
            _defaultDataFilePath = GameGlobals.defaultDataFilePath;

            // Grabbing the default Graphic File names and path:
            _defaultGraphicFilePath = GameGlobals.defaultGraphicFilePath;
            _defaultGraphicFiles = GameGlobals.defaultGraphicFiles;

            //Loading the default data lists:
            loadGameDataFiles( );

            // Loading the default Graphic Files:
            loadGameGraphicFiles();
        }
예제 #36
0
    // Use this for initialization
    public void Initialize()
    {
        // Start Initialize.

        #region Settings up XML related variables
        // High Score XML/Saving data:
        HSIsSaveable = DataGlobals.HSIsSaveableDefault;
        HSXmlElementName = DataGlobals.HSXmlElementNameDefault;
        HSXmlNamespace = DataGlobals.HSXmlNamespaceDefault;
        HSSavePathAndName = DataGlobals.HSSavePathAndNameDefault;

        // settings XML/Saving data:
        settingsIsSaveable = DataGlobals.settingsIsSaveableDefault;
        settingsXmlElementName = DataGlobals.settingsXmlElementNameDefault;
        settingsXmlNamespace = DataGlobals.settingsXmlNamespaceDefault;
        settingsSavePathAndName = DataGlobals.settingsSavePathAndNameDefault;

        // settings XML/Saving data:
        saveDataIsSaveable = DataGlobals.saveDataIsSaveableDefault;
        saveDataXmlElementName = DataGlobals.saveDataXmlElementNameDefault;
        saveDataXmlNamespace = DataGlobals.saveDataXmlNamespaceDefault;
        saveDataSavePathAndName = DataGlobals.saveDataSavePathAndNameDefault;

        #endregion

        // Setting up the game settings:
        //settings = new SettingsData();
        //settings.Initialize( settingsXmlElementName, settingsXmlNamespace, settingsSavePathAndName );
        //settings = new SettingsData( settingsXmlElementName, settingsXmlNamespace, settingsSavePathAndName );
        SettingsData.getInstance();
        SettingsData.getInstance().Initialize( settingsXmlElementName, settingsXmlNamespace, settingsSavePathAndName );

        // Setting up the save data:
        saveData = new SaveData( saveDataXmlElementName, saveDataXmlNamespace, saveDataSavePathAndName );

        // Attempting to laod an XML file and set the high scores
        // If this does not work then we load the default scores:
        #region High Score Loading/Gernerating
        highScoreList = new GenericManager<int,float>( HSIsSaveable, HSXmlElementName, HSXmlNamespace, HSSavePathAndName );
        if( !highScoreList.loadObjectList( HSIsSaveable, Path.Combine( Application.dataPath, HSSavePathAndName ), HSXmlElementName, HSXmlNamespace ) )
        {
            // Setting a default high score list:
            listCount = DataGlobals.highScoreDefaultListSize;
            for( i = 0; i < listCount; i++ )
                highScoreList.addObject( i, DataGlobals.highScoreDefaultList[i] );

            // Saving the Default high Score List:
            highScoreList.saveObjectList( Path.Combine( Application.dataPath, HSSavePathAndName ), HSXmlElementName, HSXmlNamespace );
        }
        #endregion
    }
예제 #37
0
    // Start AddingMazeHelper.
    public static void mazeListToAdd( ref GenericManager<int,Map> workingMpList )
    {
        // Start mazeListToAdd.

        // Creating the temp Variables:
        Map _tempMap;
        List<Vector2> _tempPassageList;

        #region Addign map 2

        // Setting up basic map information:
        _tempMap = new Map( );
        _tempMap.resizeMap(); // Resizeing to default size.
        _tempMap.mapName = "1";

        // Setting up the hardcoded passage Information:
        _tempPassageList = new List<Vector2>();
        _tempPassageList.Add( new Vector2( 0, 3 ) );
        _tempPassageList.Add( new Vector2( 19, 3 ));
        _tempPassageList.Add( new Vector2( 8, 0 ));
        _tempPassageList.Add( new Vector2( 8, 10 ));
        _tempMap.hardCodedPassageWays = _tempPassageList;

        // Setting the time to beat:
        _tempMap.TimeToBeat = MazeGlobals.timeToBeatDefault;

        #region row 0
        _tempMap.setTileID( 0, 0, 2 );
        _tempMap.setTileID( 1, 0, 2 );
        _tempMap.setTileID( 2, 0, 2 );
        _tempMap.setTileID( 3, 0 ,2 );
        _tempMap.setTileID( 4, 0 ,2 );
        _tempMap.setTileID( 5, 0, 2 );
        _tempMap.setTileID( 6, 0, 2 );
        _tempMap.setTileID( 7, 0, 2 );
        _tempMap.setTileID( 8, 0, 2 );
        _tempMap.setTileID( 9, 0, 2 );
        _tempMap.setTileID( 10, 0, 2 );
        _tempMap.setTileID( 11, 0, 2 );
        _tempMap.setTileID( 12, 0, 2 );
        _tempMap.setTileID( 13, 0, 2 );
        _tempMap.setTileID( 14, 0, 2 );
        _tempMap.setTileID( 15, 0, 2 );
        _tempMap.setTileID( 16, 0, 2 );
        _tempMap.setTileID( 17, 0, 2 );
        _tempMap.setTileID( 18, 0, 2 );
        _tempMap.setTileID( 19, 0, 2 );
        #endregion

        #region Row 1
        _tempMap.setTileID( 0, 1, 2 );
        _tempMap.setTileID( 1, 1, 1 );
        _tempMap.setTileID( 2, 1, 1 );
        _tempMap.setTileID( 3, 1, 1 );
        _tempMap.setTileID( 4, 1, 1 );
        _tempMap.setTileID( 5, 1, 1 );
        _tempMap.setTileID( 6, 1, 1 );
        _tempMap.setTileID( 7, 1, 2 );
        _tempMap.setTileID( 8, 1, 1 );
        _tempMap.setTileID( 9, 1, 2 );
        _tempMap.setTileID( 10, 1, 1 );
        _tempMap.setTileID( 11, 1, 1 );
        _tempMap.setTileID( 12, 1, 1 );
        _tempMap.setTileID( 13, 1, 2 );
        _tempMap.setTileID( 14, 1, 1 );
        _tempMap.setTileID( 15, 1, 1 );
        _tempMap.setTileID( 16, 1, 1 );
        _tempMap.setTileID( 17, 1, 1 );
        _tempMap.setTileID( 18, 1, 1 );
        _tempMap.setTileID( 19, 1, 2 );
        #endregion

        #region Row 2
        _tempMap.setTileID( 0, 2, 2 );
        _tempMap.setTileID( 1, 2, 1 );
        _tempMap.setTileID( 2, 2, 2 );
        _tempMap.setTileID( 3, 2, 2 );
        _tempMap.setTileID( 4, 2, 1 );
        _tempMap.setTileID( 5, 2, 2 );
        _tempMap.setTileID( 6, 2, 1 );
        _tempMap.setTileID( 7, 2, 2 );
        _tempMap.setTileID( 8, 2, 1 );
        _tempMap.setTileID( 9, 2, 2 );
        _tempMap.setTileID( 10, 2, 1 );
        _tempMap.setTileID( 11, 2, 2 );
        _tempMap.setTileID( 12, 2, 2 );
        _tempMap.setTileID( 13, 2, 2 );
        _tempMap.setTileID( 14, 2, 1 );
        _tempMap.setTileID( 15, 2, 2 );
        _tempMap.setTileID( 16, 2, 2 );
        _tempMap.setTileID( 17, 2, 2 );
        _tempMap.setTileID( 18, 2, 2 );
        _tempMap.setTileID( 19, 2, 2 );
        #endregion

        #region Row 3
        _tempMap.setTileID( 0, 3, 2 );
        _tempMap.setTileID( 1, 3, 1 );
        _tempMap.setTileID( 2, 3, 1 );
        _tempMap.setTileID( 3, 3, 2 );
        _tempMap.setTileID( 4, 3, 1 );
        _tempMap.setTileID( 5, 3, 2 );
        _tempMap.setTileID( 6, 3, 1 );
        _tempMap.setTileID( 7, 3, 1 );
        _tempMap.setTileID( 8, 3, 1 );
        _tempMap.setTileID( 9, 3, 1 );
        _tempMap.setTileID( 10, 3, 1 );
        _tempMap.setTileID( 11, 3, 1 );
        _tempMap.setTileID( 12, 3, 1 );
        _tempMap.setTileID( 13, 3, 2 );
        _tempMap.setTileID( 14, 3, 1 );
        _tempMap.setTileID( 15, 3, 1 );
        _tempMap.setTileID( 16, 3, 1 );
        _tempMap.setTileID( 17, 3, 1 );
        _tempMap.setTileID( 18, 3, 1 );
        _tempMap.setTileID( 19, 3, 2 );
        #endregion

        #region Row 4
        _tempMap.setTileID( 0, 4, 2 );
        _tempMap.setTileID( 1, 4, 1 );
        _tempMap.setTileID( 2, 4, 2 );
        _tempMap.setTileID( 3, 4, 2 );
        _tempMap.setTileID( 4, 4, 1 );
        _tempMap.setTileID( 5, 4, 2 );
        _tempMap.setTileID( 6, 4, 1 );
        _tempMap.setTileID( 7, 4, 2 );
        _tempMap.setTileID( 8, 4, 2 );
        _tempMap.setTileID( 9, 4, 2 );
        _tempMap.setTileID( 10, 4, 2 );
        _tempMap.setTileID( 11, 4, 1 );
        _tempMap.setTileID( 12, 4, 1 );
        _tempMap.setTileID( 13, 4, 2 );
        _tempMap.setTileID( 14, 4, 2 );
        _tempMap.setTileID( 15, 4, 2 );
        _tempMap.setTileID( 16, 4, 2 );
        _tempMap.setTileID( 17, 4, 2 );
        _tempMap.setTileID( 18, 4, 1 );
        _tempMap.setTileID( 19, 4, 2 );
        #endregion

        #region Row 5
        _tempMap.setTileID( 0, 5, 2 );
        _tempMap.setTileID( 1, 5, 1 );
        _tempMap.setTileID( 2, 5, 2 );
        _tempMap.setTileID( 3, 5, 1 );
        _tempMap.setTileID( 4, 5, 1 );
        _tempMap.setTileID( 5, 5, 2 );
        _tempMap.setTileID( 6, 5, 1 );
        _tempMap.setTileID( 7, 5, 1 );
        _tempMap.setTileID( 8, 5, 2 );
        _tempMap.setTileID( 9, 5, 1 );
        _tempMap.setTileID( 10, 5, 1 );
        _tempMap.setTileID( 11, 5, 1 );
        _tempMap.setTileID( 12, 5, 1 );
        _tempMap.setTileID( 13, 5, 1 );
        _tempMap.setTileID( 14, 5, 1 );
        _tempMap.setTileID( 15, 5, 1 );
        _tempMap.setTileID( 16, 5, 2 );
        _tempMap.setTileID( 17, 5, 1 );
        _tempMap.setTileID( 18, 5, 1 );
        _tempMap.setTileID( 19, 5, 2 );
        #endregion

        #region Row 6
        _tempMap.setTileID( 0, 6, 2 );
        _tempMap.setTileID( 1, 6, 2 );
        _tempMap.setTileID( 2, 6, 2 );
        _tempMap.setTileID( 3, 6, 2 );
        _tempMap.setTileID( 4, 6, 2 );
        _tempMap.setTileID( 5, 6, 2 );
        _tempMap.setTileID( 6, 6, 2 );
        _tempMap.setTileID( 7, 6, 1 );
        _tempMap.setTileID( 8, 6, 2 );
        _tempMap.setTileID( 9, 6, 2 );
        _tempMap.setTileID( 10, 6, 2 );
        _tempMap.setTileID( 11, 6, 2 );
        _tempMap.setTileID( 12, 6, 2 );
        _tempMap.setTileID( 13, 6, 2 );
        _tempMap.setTileID( 14, 6, 2 );
        _tempMap.setTileID( 15, 6, 1 );
        _tempMap.setTileID( 16, 6, 2 );
        _tempMap.setTileID( 17, 6, 2 );
        _tempMap.setTileID( 18, 6, 1 );
        _tempMap.setTileID( 19, 6, 2 );
        #endregion

        #region Row 7
        _tempMap.setTileID( 0, 7, 2 );
        _tempMap.setTileID( 1, 7, 1 );
        _tempMap.setTileID( 2, 7, 1 );
        _tempMap.setTileID( 3, 7, 2 );
        _tempMap.setTileID( 4, 7, 1 );
        _tempMap.setTileID( 5, 7, 1 );
        _tempMap.setTileID( 6, 7, 1 );
        _tempMap.setTileID( 7, 7, 1 );
        _tempMap.setTileID( 8, 7, 2 );
        _tempMap.setTileID( 9, 7, 1 );
        _tempMap.setTileID( 10, 7, 1 );
        _tempMap.setTileID( 11, 7, 1 );
        _tempMap.setTileID( 12, 7, 1 );
        _tempMap.setTileID( 13, 7, 1 );
        _tempMap.setTileID( 14, 7, 1 );
        _tempMap.setTileID( 15, 7, 1 );
        _tempMap.setTileID( 16, 7, 2 );
        _tempMap.setTileID( 17, 7, 1 );
        _tempMap.setTileID( 18, 7, 1 );
        _tempMap.setTileID( 19, 7, 2 );
        #endregion

        #region Row 8
        _tempMap.setTileID( 0, 8, 2 );
        _tempMap.setTileID( 1, 8, 1 );
        _tempMap.setTileID( 2, 8, 2 );
        _tempMap.setTileID( 3, 8, 2 );
        _tempMap.setTileID( 4, 8, 2 );
        _tempMap.setTileID( 5, 8, 1 );
        _tempMap.setTileID( 6, 8, 2 );
        _tempMap.setTileID( 7, 8, 1 );
        _tempMap.setTileID( 8, 8, 2 );
        _tempMap.setTileID( 9, 8, 2 );
        _tempMap.setTileID( 10, 8, 1 );
        _tempMap.setTileID( 11, 8, 2 );
        _tempMap.setTileID( 12, 8, 2 );
        _tempMap.setTileID( 13, 8, 2 );
        _tempMap.setTileID( 14, 8, 2 );
        _tempMap.setTileID( 15, 8, 2 );
        _tempMap.setTileID( 16, 8, 2 );
        _tempMap.setTileID( 17, 8, 1 );
        _tempMap.setTileID( 18, 8, 2 );
        _tempMap.setTileID( 19, 8, 2 );
        #endregion

        #region Row 9
        _tempMap.setTileID( 0, 9, 2 );
        _tempMap.setTileID( 1, 9, 1 );
        _tempMap.setTileID( 2, 9, 1 );
        _tempMap.setTileID( 3, 9, 1 );
        _tempMap.setTileID( 4, 9, 1 );
        _tempMap.setTileID( 5, 9, 1 );
        _tempMap.setTileID( 6, 9, 2 );
        _tempMap.setTileID( 7, 9, 1 );
        _tempMap.setTileID( 8, 9, 1 );
        _tempMap.setTileID( 9, 9, 1 );
        _tempMap.setTileID( 10, 9, 1 );
        _tempMap.setTileID( 11, 9, 1 );
        _tempMap.setTileID( 12, 9, 1 );
        _tempMap.setTileID( 13, 9, 1 );
        _tempMap.setTileID( 14, 9, 1 );
        _tempMap.setTileID( 15, 9, 1 );
        _tempMap.setTileID( 16, 9, 1 );
        _tempMap.setTileID( 17, 9, 1 );
        _tempMap.setTileID( 18, 9, 1 );
        _tempMap.setTileID( 19, 9, 2 );
        #endregion

        #region row 10
        _tempMap.setTileID( 0, 10, 2 );
        _tempMap.setTileID( 1, 10, 2 );
        _tempMap.setTileID( 2, 10, 2 );
        _tempMap.setTileID( 3, 10 ,2 );
        _tempMap.setTileID( 4, 10 ,2 );
        _tempMap.setTileID( 5, 10, 2 );
        _tempMap.setTileID( 6, 10, 2 );
        _tempMap.setTileID( 7, 10, 2 );
        _tempMap.setTileID( 8, 10, 2 );
        _tempMap.setTileID( 9, 10, 2 );
        _tempMap.setTileID( 10, 10, 2 );
        _tempMap.setTileID( 11, 10, 2 );
        _tempMap.setTileID( 12, 10, 2 );
        _tempMap.setTileID( 13, 10, 2 );
        _tempMap.setTileID( 14, 10, 2 );
        _tempMap.setTileID( 15, 10, 2 );
        _tempMap.setTileID( 16, 10, 2 );
        _tempMap.setTileID( 17, 10, 2 );
        _tempMap.setTileID( 18, 10, 2 );
        _tempMap.setTileID( 19, 10, 2 );
        #endregion

        workingMpList.addObject( 1, _tempMap );

        #endregion

        #region Addign map 3

        // Setting up basic map information:
        _tempMap = new Map();
        _tempMap.resizeMap(); // Resizeing to default size.
        _tempMap.mapName = "2";

        // Setting up the hardcoded passage Information:
        _tempPassageList = new List<Vector2>();
        _tempPassageList.Add( new Vector2( 0, 7 ));
        _tempPassageList.Add( new Vector2( 19, 7 ));
        _tempPassageList.Add( new Vector2( 8, 0 ));
        _tempPassageList.Add( new Vector2( 8, 10 ));
        _tempMap.hardCodedPassageWays = _tempPassageList;

        // Setting the time to beat:
        _tempMap.TimeToBeat = MazeGlobals.timeToBeatDefault;

        #region Row 0
        _tempMap.setTileID( 0, 0, 2 );
        _tempMap.setTileID( 1, 0, 2 );
        _tempMap.setTileID( 2, 0, 2 );
        _tempMap.setTileID( 3, 0 ,2 );
        _tempMap.setTileID( 4, 0 ,2 );
        _tempMap.setTileID( 5, 0, 2 );
        _tempMap.setTileID( 6, 0, 2 );
        _tempMap.setTileID( 7, 0, 2 );
        _tempMap.setTileID( 8, 0, 2 );
        _tempMap.setTileID( 9, 0, 2 );
        _tempMap.setTileID( 10, 0, 2 );
        _tempMap.setTileID( 11, 0, 2 );
        _tempMap.setTileID( 12, 0, 2 );
        _tempMap.setTileID( 13, 0, 2 );
        _tempMap.setTileID( 14, 0, 2 );
        _tempMap.setTileID( 15, 0, 2 );
        _tempMap.setTileID( 16, 0, 2 );
        _tempMap.setTileID( 17, 0, 2 );
        _tempMap.setTileID( 18, 0, 2 );
        _tempMap.setTileID( 19, 0, 2 );
        #endregion

        #region Row 1
        _tempMap.setTileID( 0, 1, 2 );
        _tempMap.setTileID( 1, 1, 1 );
        _tempMap.setTileID( 2, 1, 2 );
        _tempMap.setTileID( 3, 1, 1 );
        _tempMap.setTileID( 4, 1, 1 );
        _tempMap.setTileID( 5, 1, 1 );
        _tempMap.setTileID( 6, 1, 1 );
        _tempMap.setTileID( 7, 1, 1 );
        _tempMap.setTileID( 8, 1, 1 );
        _tempMap.setTileID( 9, 1, 2 );
        _tempMap.setTileID( 10, 1, 1 );
        _tempMap.setTileID( 11, 1, 2 );
        _tempMap.setTileID( 12, 1, 1 );
        _tempMap.setTileID( 13, 1, 1 );
        _tempMap.setTileID( 14, 1, 1 );
        _tempMap.setTileID( 15, 1, 1 );
        _tempMap.setTileID( 16, 1, 1 );
        _tempMap.setTileID( 17, 1, 1 );
        _tempMap.setTileID( 18, 1, 1 );
        _tempMap.setTileID( 19, 1, 2 );
        #endregion

        #region Row 2
        _tempMap.setTileID( 0, 2, 2 );
        _tempMap.setTileID( 1, 2, 1 );
        _tempMap.setTileID( 2, 2, 2 );
        _tempMap.setTileID( 3, 2, 1 );
        _tempMap.setTileID( 4, 2, 2 );
        _tempMap.setTileID( 5, 2, 2 );
        _tempMap.setTileID( 6, 2, 2 );
        _tempMap.setTileID( 7, 2, 2 );
        _tempMap.setTileID( 8, 2, 1 );
        _tempMap.setTileID( 9, 2, 2 );
        _tempMap.setTileID( 10, 2, 1 );
        _tempMap.setTileID( 11, 2, 2 );
        _tempMap.setTileID( 12, 2, 1 );
        _tempMap.setTileID( 13, 2, 2 );
        _tempMap.setTileID( 14, 2, 2 );
        _tempMap.setTileID( 15, 2, 2 );
        _tempMap.setTileID( 16, 2, 2 );
        _tempMap.setTileID( 17, 2, 2 );
        _tempMap.setTileID( 18, 2, 1 );
        _tempMap.setTileID( 19, 2, 2 );
        #endregion

        #region Row 3
        _tempMap.setTileID( 0, 3, 2 );
        _tempMap.setTileID( 1, 3, 1 );
        _tempMap.setTileID( 2, 3, 2 );
        _tempMap.setTileID( 3, 3, 1 );
        _tempMap.setTileID( 4, 3, 2 );
        _tempMap.setTileID( 5, 3, 1 );
        _tempMap.setTileID( 6, 3, 1 );
        _tempMap.setTileID( 7, 3, 2 );
        _tempMap.setTileID( 8, 3, 1 );
        _tempMap.setTileID( 9, 3, 2 );
        _tempMap.setTileID( 10, 3, 1 );
        _tempMap.setTileID( 11, 3, 2 );
        _tempMap.setTileID( 12, 3, 1 );
        _tempMap.setTileID( 13, 3, 2 );
        _tempMap.setTileID( 14, 3, 1 );
        _tempMap.setTileID( 15, 3, 1 );
        _tempMap.setTileID( 16, 3, 1 );
        _tempMap.setTileID( 17, 3, 1 );
        _tempMap.setTileID( 18, 3, 1 );
        _tempMap.setTileID( 19, 3, 2 );
        #endregion

        #region Row 4
        _tempMap.setTileID( 0, 4, 2 );
        _tempMap.setTileID( 1, 4, 1 );
        _tempMap.setTileID( 2, 4, 1 );
        _tempMap.setTileID( 3, 4, 1 );
        _tempMap.setTileID( 4, 4, 2 );
        _tempMap.setTileID( 5, 4, 2 );
        _tempMap.setTileID( 6, 4, 1 );
        _tempMap.setTileID( 7, 4, 2 );
        _tempMap.setTileID( 8, 4, 1 );
        _tempMap.setTileID( 9, 4, 2 );
        _tempMap.setTileID( 10, 4, 1 );
        _tempMap.setTileID( 11, 4, 2 );
        _tempMap.setTileID( 12, 4, 1 );
        _tempMap.setTileID( 13, 4, 2 );
        _tempMap.setTileID( 14, 4, 2 );
        _tempMap.setTileID( 15, 4, 2 );
        _tempMap.setTileID( 16, 4, 2 );
        _tempMap.setTileID( 17, 4, 2 );
        _tempMap.setTileID( 18, 4, 2 );
        _tempMap.setTileID( 19, 4, 2 );
        #endregion

        #region Row 5
        _tempMap.setTileID( 0, 5, 2 );
        _tempMap.setTileID( 1, 5, 2 );
        _tempMap.setTileID( 2, 5, 2 );
        _tempMap.setTileID( 3, 5, 2 );
        _tempMap.setTileID( 4, 5, 2 );
        _tempMap.setTileID( 5, 5, 1 );
        _tempMap.setTileID( 6, 5, 1 );
        _tempMap.setTileID( 7, 5, 2 );
        _tempMap.setTileID( 8, 5, 1 );
        _tempMap.setTileID( 9, 5, 2 );
        _tempMap.setTileID( 10, 5, 1 );
        _tempMap.setTileID( 11, 5, 1 );
        _tempMap.setTileID( 12, 5, 1 );
        _tempMap.setTileID( 13, 5, 1 );
        _tempMap.setTileID( 14, 5, 1 );
        _tempMap.setTileID( 15, 5, 1 );
        _tempMap.setTileID( 16, 5, 1 );
        _tempMap.setTileID( 17, 5, 1 );
        _tempMap.setTileID( 18, 5, 1 );
        _tempMap.setTileID( 19, 5, 2 );
        #endregion

        #region Row 6
        _tempMap.setTileID( 0, 6, 2 );
        _tempMap.setTileID( 1, 6, 1 );
        _tempMap.setTileID( 2, 6, 1 );
        _tempMap.setTileID( 3, 6, 1 );
        _tempMap.setTileID( 4, 6, 1 );
        _tempMap.setTileID( 5, 6, 1 );
        _tempMap.setTileID( 6, 6, 2 );
        _tempMap.setTileID( 7, 6, 2 );
        _tempMap.setTileID( 8, 6, 1 );
        _tempMap.setTileID( 9, 6, 2 );
        _tempMap.setTileID( 10, 6, 1 );
        _tempMap.setTileID( 11, 6, 2 );
        _tempMap.setTileID( 12, 6, 2 );
        _tempMap.setTileID( 13, 6, 1 );
        _tempMap.setTileID( 14, 6, 2 );
        _tempMap.setTileID( 15, 6, 2 );
        _tempMap.setTileID( 16, 6, 2 );
        _tempMap.setTileID( 17, 6, 2 );
        _tempMap.setTileID( 18, 6, 2 );
        _tempMap.setTileID( 19, 6, 2 );
        #endregion

        #region Row 7
        _tempMap.setTileID( 0, 7, 2 );
        _tempMap.setTileID( 1, 7 ,1 );
        _tempMap.setTileID( 2, 7, 2 );
        _tempMap.setTileID( 3, 7, 2 );
        _tempMap.setTileID( 4, 7, 2 );
        _tempMap.setTileID( 5, 7, 2 );
        _tempMap.setTileID( 6, 7, 2 );
        _tempMap.setTileID( 7, 7 ,1 );
        _tempMap.setTileID( 8, 7 ,1 );
        _tempMap.setTileID( 9, 7 ,1 );
        _tempMap.setTileID( 10, 7 ,1 );
        _tempMap.setTileID( 11, 7, 2 );
        _tempMap.setTileID( 12, 7 ,1 );
        _tempMap.setTileID( 13, 7 ,1 );
        _tempMap.setTileID( 14, 7, 2 );
        _tempMap.setTileID( 15, 7 ,1 );
        _tempMap.setTileID( 16, 7 ,1 );
        _tempMap.setTileID( 17, 7 ,1 );
        _tempMap.setTileID( 18, 7 ,1 );
        _tempMap.setTileID( 19, 7, 2 );
        #endregion

        #region Row 8
        _tempMap.setTileID( 0, 8, 2 );
        _tempMap.setTileID( 1, 8, 1 );
        _tempMap.setTileID( 2, 8, 1 );
        _tempMap.setTileID( 3, 8, 1 );
        _tempMap.setTileID( 4, 8, 2 );
        _tempMap.setTileID( 5, 8, 1 );
        _tempMap.setTileID( 6, 8, 1 );
        _tempMap.setTileID( 7, 8, 1 );
        _tempMap.setTileID( 8, 8, 2 );
        _tempMap.setTileID( 9, 8, 2 );
        _tempMap.setTileID( 10, 8, 1 );
        _tempMap.setTileID( 11, 8, 2 );
        _tempMap.setTileID( 12, 8, 1 );
        _tempMap.setTileID( 13, 8, 2 );
        _tempMap.setTileID( 14, 8, 2 );
        _tempMap.setTileID( 15, 8, 1 );
        _tempMap.setTileID( 16, 8, 2 );
        _tempMap.setTileID( 17, 8, 2 );
        _tempMap.setTileID( 18, 8, 1 );
        _tempMap.setTileID( 19, 8, 2 );
        #endregion

        #region Row 9
        _tempMap.setTileID( 0, 9, 2 );
        _tempMap.setTileID( 1, 9, 1 );
        _tempMap.setTileID( 2, 9, 2 );
        _tempMap.setTileID( 3, 9, 1 );
        _tempMap.setTileID( 4, 9, 1 );
        _tempMap.setTileID( 5, 9,1 );
        _tempMap.setTileID( 6, 9, 2 );
        _tempMap.setTileID( 7, 9, 1 );
        _tempMap.setTileID( 8, 9, 1 );
        _tempMap.setTileID( 9, 9, 1 );
        _tempMap.setTileID( 10, 9, 1 );
        _tempMap.setTileID( 11, 9, 2 );
        _tempMap.setTileID( 12, 9, 1 );
        _tempMap.setTileID( 13, 9, 1 );
        _tempMap.setTileID( 14, 9, 1 );
        _tempMap.setTileID( 15, 9, 1 );
        _tempMap.setTileID( 16, 9, 2 );
        _tempMap.setTileID( 17, 9, 1 );
        _tempMap.setTileID( 18, 9, 1 );
        _tempMap.setTileID( 19, 9, 2 );
        #endregion

        #region Row 10
        _tempMap.setTileID( 0, 10, 2 );
        _tempMap.setTileID( 1, 10, 2 );
        _tempMap.setTileID( 2, 10, 2 );
        _tempMap.setTileID( 3, 10 ,2 );
        _tempMap.setTileID( 4, 10 ,2 );
        _tempMap.setTileID( 5, 10, 2 );
        _tempMap.setTileID( 6, 10, 2 );
        _tempMap.setTileID( 7, 10, 2 );
        _tempMap.setTileID( 8, 10, 2 );
        _tempMap.setTileID( 9, 10, 2 );
        _tempMap.setTileID( 10, 10, 2 );
        _tempMap.setTileID( 11, 10, 2 );
        _tempMap.setTileID( 12, 10, 2 );
        _tempMap.setTileID( 13, 10, 2 );
        _tempMap.setTileID( 14, 10, 2 );
        _tempMap.setTileID( 15, 10, 2 );
        _tempMap.setTileID( 16, 10, 2 );
        _tempMap.setTileID( 17, 10, 2 );
        _tempMap.setTileID( 18, 10, 2 );
        _tempMap.setTileID( 19, 10, 2 );
        #endregion

        // Sending the temp map to the working map list:
        workingMpList.addObject( 2, _tempMap );

        #endregion
    }