Ejemplo n.º 1
0
 public Level3(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs)
     : base(g,v)
 {
     CostPrice = 800;
     IsActivated = false;
     _selected = _jobs.Cooker;
     _owner = v;
 }
Ejemplo n.º 2
0
 internal Whitewash(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs)
     : base(g, v)
 {
     CostPrice = 100;
     IsActivated = false;
     _selected = _jobs.Cooker;
     _owner = v;
 }
Ejemplo n.º 3
0
 public Scarecrow(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs)
     : base(g, v)
 {
     CostPrice = 500;
     IsActivated = false;
     _selected = _jobs.Farmer;
     _owner = v;
 }
Ejemplo n.º 4
0
 internal Pulley(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs)
     : base(g, v)
 {
     CostPrice = 200;
     IsActivated = false;
     _selected = _jobs.Construction_Worker;
     _owner = v;
 }
Ejemplo n.º 5
0
 public Fertilizer(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs)
     : base(g, v)
 {
     CostPrice = 1000;
     IsActivated = false;
     _selected = _jobs.Farmer;
     _owner = v;
 }
Ejemplo n.º 6
0
 internal Saw(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs)
     : base(g, v)
 {
     CostPrice = 600;
     IsActivated = false;
     _selected = _jobs.Blacksmith;
     _owner = v;
 }
Ejemplo n.º 7
0
 public Plow(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs)
     : base(g,v)
 {
     CostPrice = 1000;
     IsActivated = false;
     _selected = _jobs.Blacksmith;
     _owner = v;
     _jobsList = _jobs;
 }
Ejemplo n.º 8
0
 public ApothecaryOffice(Village v, JobsModel job)
     : base(v)
 {
     Name = "Pharmacie";
     _name = Name;
     Hp = MaxHp = 50;
     _job = job;
     this.CostPrice = 200;
 }
Ejemplo n.º 9
0
        /// <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;
        }
Ejemplo n.º 10
0
 internal void setJob(JobsModel NewJob)
 {
     _job = NewJob;
 }
Ejemplo n.º 11
0
 public bool AddToJob(JobsModel job)
 {
     if (_job != null)
         _job.RemovePerson2(this);
     return job.AddPerson2(this);
 }
Ejemplo n.º 12
0
 private void ListOfJobs_SelectedValueChanged(object sender, EventArgs e)
 {
     if (ListOfJobs.SelectedValue != null)
         _job = (JobsModel)ListOfJobs.SelectedValue;
     else
         _job = null;
 }
Ejemplo n.º 13
0
        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;
            }
        }
Ejemplo n.º 14
0
        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();
        }