コード例 #1
0
ファイル: Level3.cs プロジェクト: EmilieS/Gleipnir
 public Level3(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs)
     : base(g,v)
 {
     CostPrice = 800;
     IsActivated = false;
     _selected = _jobs.Cooker;
     _owner = v;
 }
コード例 #2
0
ファイル: Whitewash.cs プロジェクト: EmilieS/Gleipnir
 internal Whitewash(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs)
     : base(g, v)
 {
     CostPrice = 100;
     IsActivated = false;
     _selected = _jobs.Cooker;
     _owner = v;
 }
コード例 #3
0
ファイル: Scarecrow.cs プロジェクト: EmilieS/Gleipnir
 public Scarecrow(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs)
     : base(g, v)
 {
     CostPrice = 500;
     IsActivated = false;
     _selected = _jobs.Farmer;
     _owner = v;
 }
コード例 #4
0
ファイル: Pulley.cs プロジェクト: EmilieS/Gleipnir
 internal Pulley(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs)
     : base(g, v)
 {
     CostPrice = 200;
     IsActivated = false;
     _selected = _jobs.Construction_Worker;
     _owner = v;
 }
コード例 #5
0
ファイル: Fertilizer.cs プロジェクト: EmilieS/Gleipnir
 public Fertilizer(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs)
     : base(g, v)
 {
     CostPrice = 1000;
     IsActivated = false;
     _selected = _jobs.Farmer;
     _owner = v;
 }
コード例 #6
0
ファイル: Saw.cs プロジェクト: EmilieS/Gleipnir
 internal Saw(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs)
     : base(g, v)
 {
     CostPrice = 600;
     IsActivated = false;
     _selected = _jobs.Blacksmith;
     _owner = v;
 }
コード例 #7
0
ファイル: Plow.cs プロジェクト: EmilieS/Gleipnir
 public Plow(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs)
     : base(g,v)
 {
     CostPrice = 1000;
     IsActivated = false;
     _selected = _jobs.Blacksmith;
     _owner = v;
     _jobsList = _jobs;
 }
コード例 #8
0
ファイル: ApothecaryOffice.cs プロジェクト: EmilieS/Gleipnir
 public ApothecaryOffice(Village v, JobsModel job)
     : base(v)
 {
     Name = "Pharmacie";
     _name = Name;
     Hp = MaxHp = 50;
     _job = job;
     this.CostPrice = 200;
 }
コード例 #9
0
ファイル: Village.cs プロジェクト: EmilieS/Gleipnir
        /// <summary>
        /// Create family with no mother and no father but with jobs
        /// </summary>
        /// <param name="mothersJob"></param>
        /// <param name="fathersJob"></param>
        /// <returns></returns>
        public Family CreateFamilyFromScratch(JobsModel mothersJob, JobsModel fathersJob)
        {
            Debug.Assert(Game != null, @"(village, CreateFamilyFromScratch2) Game is null");

            // Create family
            var name = Game.NameList.NextName;
            Villager VillagerAM = new Villager(Game, Genders.MALE, Game.FirstNameList.NextName);
            Villager VillagerAF = new Villager(Game, Genders.FEMALE, Game.FirstNameList.NextName);
            var newFamily = new Family(Game, VillagerAF, VillagerAM, name);

            // Add family into families house
            _familiesList.Add(newFamily);

            // Remove villager into job worker list
            if (VillagerAF.Job != null)
                VillagerAF.Job.RemovePerson(VillagerAF);
            if (VillagerAM.Job != null)
                VillagerAM.Job.RemovePerson(VillagerAM);

            // Add villager into job worker list
            mothersJob.AddPerson(VillagerAF);
            fathersJob.AddPerson(VillagerAM);

            // Create new house
            Buildings.House house = new Buildings.House(this);

            // Add family into house and house in family
            house.Family = newFamily;
            newFamily.House = house;

            return newFamily;
        }
コード例 #10
0
ファイル: Villager.cs プロジェクト: EmilieS/Gleipnir
 internal void setJob(JobsModel NewJob)
 {
     _job = NewJob;
 }
コード例 #11
0
ファイル: Villager.cs プロジェクト: EmilieS/Gleipnir
 public bool AddToJob(JobsModel job)
 {
     if (_job != null)
         _job.RemovePerson2(this);
     return job.AddPerson2(this);
 }
コード例 #12
0
ファイル: ActionsPanel.cs プロジェクト: EmilieS/Gleipnir
 private void ListOfJobs_SelectedValueChanged(object sender, EventArgs e)
 {
     if (ListOfJobs.SelectedValue != null)
         _job = (JobsModel)ListOfJobs.SelectedValue;
     else
         _job = null;
 }
コード例 #13
0
ファイル: TabIndex.cs プロジェクト: EmilieS/Gleipnir
        internal void ShowWorkersInJob(JobsModel job)
        {
            if (passed == false)
            {
                passed = true;
                ListOfVillagersToShow = new List<VillagerBannerUC>();
            }
            DestroyVillagerList();

            for (int i = 0; i < job.Workers.Count; i++)
            {
                VillagerBannerUC tmp = new VillagerBannerUC(job.Workers[i]);

                // Set VillagerBannerUC
                tmp.Location = new System.Drawing.Point(positionX, positionY);

                // Add VillagerBannerUC to lists and show it
                this.VillagerList.Controls.Add(tmp);
                ListOfVillagersToShow.Add(tmp);
                tmp.Show();

                // Set position for next VillagerBannerUC
                positionY += 62;
            }
        }
コード例 #14
0
ファイル: InformationBox.cs プロジェクト: EmilieS/Gleipnir
        internal void SetJobInfo(JobsModel job, Image buildingImage)
        {
            if (job != null)
            {
                this.SuspendLayout();
                // Background
                this.BackgroundImage = GamePages.Properties.Resources.InformationBox_job_background;

                // BuildingImage
                buildingIcon.BackgroundImage = buildingImage;
                buildingIcon.Visible = true;

                #region InfoBox Infos
                // Title
                Title.Location = new Point(positionX, positionY);
                Title.Text = job.Building.Name;
                Title.Visible = true;

                // Object
                ElementName.Visible = true;
                ElementName.Text = job.Name;
                objectName.Visible = true;

                // Hidden Infos
                goldIcon.Visible = false;
                Gold.Visible = false;
                faithIcon.Visible = false;
                Faith.Visible = false;
                happinessIcon.Visible = false;
                Happiness.Visible = false;

                // Members
                membersIcon.Visible = true;
                NbMembers.Text = job.Workers.Count.ToString();
                NbMembers.Visible = true;

                // Building
                buildingHealthIcon.Visible = true;
                buildingLife.Visible = true;
                buildingLife.Text = job.Building.Hp.ToString();

                this.ResumeLayout();
                #endregion

                // Action Tab infos
                _page.ActionMenu.Visible = false;
                _page.ActionMenu.SuspendLayout();
                _page.ActionMenu.ShowWorkersInJob(job);
                _page.ActionMenu.ResumeLayout();
                _page.ActionMenu.Visible = true;

                // Meetings Details
                GodMeeting.Visible = false;
                GodMeeting.Enabled = false;
                StopMeeting.Visible = false;
                StopMeeting.Enabled = false;
                ActionsButton.Visible = false;
                ActionsButton.Enabled = false;
            }
            else
                SetError();
        }