예제 #1
0
    // also create a removescreen

    public void Draw(Gametime gametime)
    {
        foreach (GameScreen screen in screens)
        {
            screen.Draw(gametime);
        }
    }
예제 #2
0
        public string _name; //character name

        #endregion Fields

        #region Constructors

        public Character()
        {
            _name = "";
            _id = 0;
            _fame = 0;
            _age = 0;
            _jobID = -1;
            _mindset = new CharacterMindset();
            _bodyneeds = new CharacterBodyNeeds();
            _currentActionFinishTime = new Gametime(0, 0, 0);
            _health = new CharacterHealth();
            _characterActions = new characterActionPriorityQueue(); //the list of actions the character wants to do
            _characterPreviousActions = new List<actionHistory>();
            _characterinventory = new CharacterInventory();
            _locationID = Consts.stronghold_yard;
            _homeID = Consts.stronghold_yard;

            //eating events
            _bodyneeds._hungryEvent += this.OnHungryEventHandler; //hungry event listener

            //determining gender 50-50
            if (Consts.rand.Next(1, 1000) > 500)
            {
                _gender = Consts.gender.Male;
            }
            else _gender = Consts.gender.Female;
        }
예제 #3
0
        public BuildingForLiving(int idValue,int ownerIDValue, int typeValue, string nameValue, Status hpValue, int costToBuildValue, Status levelValue, Gametime startBuildTimeValue,
                                 int numberOfManBuildingHoursValue, Status tenantsValue, int[] tenantsIDValue, Consts.buildingState buildingStateValue)
            : base(idValue, ownerIDValue, typeValue, nameValue, hpValue, costToBuildValue, levelValue, startBuildTimeValue, numberOfManBuildingHoursValue, buildingStateValue)
        {
            _tenants = new Status(tenantsValue);

            if (tenantsIDValue != null)
            {
                _tenantsID = new int[tenantsIDValue.Length];
                for (int i = 0; i < tenantsIDValue.Length; i++)
                {
                    _tenantsID[i] = tenantsIDValue[i];
                }
            }
            else _tenantsID = null;
        }
 public void UpdatePlayer(Gametime gametime)
 {
     if (!is_jumping)
     {
         if (keystate.isKeyDown(Keys.W) && previousKeyBoardState.isKeyUp(Keys.W))
         {
             do_jump(speed);
         }
         else
         {
             Velocity.Y++;
             if (Position.Y >= LandPosition)
             {
                 is_jumping = false;
             }
         }
     }
     Position += Velocity;
 }
예제 #5
0
파일: Job.cs 프로젝트: Kaliet/Stronghold
 public Job(int jobID, int buildingID, int ownerID, int workerID, string jobName, Gametime startDate, Gametime endDate, Gametime startTime, Gametime endTime, int payroll, Consts.JobStatus jobStatus)
 {
     if (startDate <= endDate &&
         startTime <= endTime)
     {
         _jobID = jobID;
         _buildingID = buildingID;
         _ownerID = ownerID;
         _workerID = workerID;
         _jobName = String.Copy(jobName);
         _startDate = new Gametime();
         _startDate.CopyGameTime(startDate);
         _endDate = new Gametime();
         _endDate.CopyGameTime(endDate);
         _startTime = new Gametime();
         _startTime.CopyGameTime(startTime);
         _endTime = new Gametime();
         _endTime.CopyGameTime(endTime);
         _payroll = payroll;
         _jobStatus = jobStatus;
     }
 }
예제 #6
0
파일: Job.cs 프로젝트: Kaliet/Stronghold
 public void Clone(Job targetJob)
 {
     Consts.writeEnteringMethodToDebugLog(System.Reflection.MethodBase.GetCurrentMethod().ReflectedType + "." + System.Reflection.MethodBase.GetCurrentMethod().Name);
     _jobID = targetJob.JobID;
     _buildingID = targetJob.BuildingID;
     _ownerID = targetJob.OwnerID;
     _workerID = targetJob.WorkerID;
     _jobName = String.Copy(targetJob.JobName);
     _startDate = new Gametime();
     _startDate.CopyGameTime(targetJob.StartDate);
     _endDate = new Gametime();
     _endDate.CopyGameTime(targetJob.EndDate);
     _startTime = new Gametime();
     _startTime.CopyGameTime(targetJob.StartTime);
     _endTime = new Gametime();
     _endTime.CopyGameTime(targetJob.EndTime);
     _payroll = targetJob.Payroll;
     _jobStatus = targetJob.JobStatus;
     Consts.writeExitingMethodToDebugLog(System.Reflection.MethodBase.GetCurrentMethod().ReflectedType + "." + System.Reflection.MethodBase.GetCurrentMethod().Name);
 }
예제 #7
0
        public BuildingForLiving(int idValue, int ownerIDValue, int typeValue, string nameValue, Status hpValue, int costToBuildValue, Status levelValue, Gametime startBuildTimeValue,
                                 int numberOfManBuildingHoursValue, Status tenantsValue, int[] tenantsIDValue, BuildingState buildingStateValue)
            : base(idValue, ownerIDValue, typeValue, nameValue, hpValue, costToBuildValue, levelValue, startBuildTimeValue, numberOfManBuildingHoursValue, buildingStateValue)
        {
            _tenants = new Status(tenantsValue);

            if (tenantsIDValue != null)
            {
                _tenantsID = new int[tenantsIDValue.Length];
                for (int i = 0; i < tenantsIDValue.Length; i++)
                {
                    _tenantsID[i] = tenantsIDValue[i];
                }
            }
            else
            {
                _tenantsID = null;
            }
        }
예제 #8
0
 public CharacterAction(CharacterAction targetCharacterAction)
 {
     _action     = targetCharacterAction.Action;
     _priority   = targetCharacterAction.Priority;
     _finishtime = new Gametime(targetCharacterAction.FinishTime);
 }
예제 #9
0
 public CharacterAction(CharacterState actionValue, int priorityValue, Gametime finishTimeValue)
 {
     _action     = actionValue;
     _priority   = priorityValue;
     _finishtime = new Gametime(finishTimeValue);
 }
예제 #10
0
 public CharacterAction()
 {
     _action     = CharacterState.Undefined;
     _priority   = -1;
     _finishtime = new Gametime();
 }