Пример #1
0
        protected void Update(AbstractModel model)
        {
            //            m_log.InfoFormat("RECEIVED UPDATE FROM BUYPOINT");
            RootPart.Name = m_bp.Name;
            RootPart.OwnerID = m_bp.DevelopmentRightsOwner.Uuid;

            GameStateType state = m_controller.Game.State;

            if (state == GameStateType.Registration)
            {
                Status = WAITING_FOR_GAME_TO_BEGIN_BUY_POINT_STATUS_MSG;
            }
            else if (state == GameStateType.Build)
            {
                if (m_bp.HasAnyOwner)
                {
                    Status
                        = string.Format(
                            BUY_POINT_STATUS_MSG,
                            m_bp.DevelopmentRightsOwner.Name, m_bp.GameAssets.Count);
                }
                else
                {
                    Status
                        = string.Format(
                            BUY_POINT_SALE_MSG,
                            m_bp.DevelopmentRightsOwner.Name, m_bp.CombinedPrice, m_bp.InitialWaterRights);
                }
            }
            else if (state == GameStateType.Water)
            {
                Status
                    = string.Format(
                        BUY_POINT_STATUS_MSG,
                        m_bp.DevelopmentRightsOwner.Name, m_bp.GameAssets.Count);
            }
            else if (state == GameStateType.Game_Ended)
            {
                Status = GAME_ENDED_STATUS_MSG;
            }
            else if (state == GameStateType.Game_Resetting)
            {
                Status = GAME_RESETTING_STATUS_MSG;
            }
        }
Пример #2
0
 public Update(AbstractModel lastSelected, string news)
 {
     LastSelected = lastSelected;
     News = news;
 }
Пример #3
0
 protected string Serialize(AbstractModel model)
 {
     return JsonConvert.SerializeObject(model, Newtonsoft.Json.Formatting.Indented);
 }
Пример #4
0
 protected void RecordStandardAttributes(AbstractModel am)
 {
     m_xtw.WriteAttributeString("Name", am.Name);
     m_xtw.WriteAttributeString("ID", am.Uuid.ToString());
 }