コード例 #1
0
        /// <summary>
        /// Syncs the needed types for the filter.
        /// For every type that is change filtered we need to CompleteWriteDependency to avoid race conditions on the
        /// change version of those types
        /// </summary>
        internal void SyncFilterTypes()
        {
            if (m_Filter.Type == FilterType.Changed)
            {
                fixed(int *indexInComponentGroupPtr = m_Filter.Changed.IndexInComponentGroup)
                for (int i = 0; i < m_Filter.Changed.Count; ++i)
                {
                    var type = m_GroupData->RequiredComponents[indexInComponentGroupPtr[i]];

                    SafetyManager.CompleteWriteDependency(type.TypeIndex);
                }
            }
        }
コード例 #2
0
        private static void SeedData(IList <IEmployee> employees)
        {
            ChiefExecutiveOfficer chiefExecutiveOfficer = new ChiefExecutiveOfficer();

            chiefExecutiveOfficer.Id                   = 1;
            chiefExecutiveOfficer.JobTitle             = "CEO";
            chiefExecutiveOfficer.FirstName            = "James";
            chiefExecutiveOfficer.LastName             = "Jenkins";
            chiefExecutiveOfficer.AnnualSalary         = 200000;
            chiefExecutiveOfficer.HighestQualification = "Masters Degree";
            chiefExecutiveOfficer.Gender               = 'm';
            chiefExecutiveOfficer.OfficeId             = "E120";
            chiefExecutiveOfficer.JoinDate             = new DateTime(2018, 1, 12);
            chiefExecutiveOfficer.SecretaryId          = 43;
            chiefExecutiveOfficer.PersonalAssistant    = 102;

            employees.Add(chiefExecutiveOfficer);

            Manager projectManager = new ProjectManager();

            projectManager.Id                   = 2;
            projectManager.JobTitle             = "Project Manager";
            projectManager.FirstName            = "Bob";
            projectManager.LastName             = "Jones";
            projectManager.AnnualSalary         = 100000;
            projectManager.HighestQualification = "Honours Degree";
            projectManager.Gender               = 'm';
            projectManager.OfficeId             = "D017";
            projectManager.JoinDate             = new DateTime(2015, 4, 1);
            projectManager.SecretaryId          = 110;
            projectManager.Id                   = 2;

            employees.Add(projectManager);

            Manager safetyManager = new SafetyManager();

            safetyManager.Id                   = 3;
            safetyManager.JobTitle             = "Safety Manager";
            safetyManager.FirstName            = "Jane";
            safetyManager.LastName             = "Summers";
            safetyManager.AnnualSalary         = 100000;
            safetyManager.HighestQualification = "Honours Degree";
            safetyManager.Gender               = 'f';
            safetyManager.OfficeId             = "D018";
            safetyManager.JoinDate             = new DateTime(2016, 2, 3);
            safetyManager.SecretaryId          = 145;

            employees.Add(safetyManager);

            Employee craneOperator = new CraneOperator();

            craneOperator.Id                   = 4;
            craneOperator.JobTitle             = "Crane Operator";
            craneOperator.FirstName            = "Sam";
            craneOperator.LastName             = "Drake";
            craneOperator.AnnualSalary         = 50000;
            craneOperator.HighestQualification = "Bachelor's Degree";
            craneOperator.Gender               = 'm';
            craneOperator.JoinDate             = new DateTime(2012, 5, 7);

            employees.Add(craneOperator);

            Employee electrician = new Electrician();

            electrician.Id                   = 5;
            electrician.JobTitle             = "Electrician";
            electrician.FirstName            = "James";
            electrician.LastName             = "Ross";
            electrician.AnnualSalary         = 45000;
            electrician.HighestQualification = "Bachelor's Degree";
            electrician.Gender               = 'm';
            electrician.JoinDate             = new DateTime(2013, 1, 16);

            employees.Add(electrician);

            Employee electrician2 = new Electrician();

            electrician2.Id                   = 6;
            electrician2.JobTitle             = "Electrician";
            electrician2.FirstName            = "Henry";
            electrician2.LastName             = "Sanders";
            electrician2.AnnualSalary         = 45000;
            electrician2.HighestQualification = "Bachelor's Degree";
            electrician2.Gender               = 'm';
            electrician2.JoinDate             = new DateTime(2017, 1, 16);

            employees.Add(electrician2);
        }