示例#1
0
 public void Rename(WorkshopName newName)
 {
     if (_state.Status == WorkshopStatus.InActive)
     {
         throw new InvalidOperationException("Workshop is inactive");
     }
     RaiseEvent(new WorkshopRenamed(Id, newName, _state.Name));
 }
示例#2
0
 public string GetI18nKeyword()
 {
     if (@Enum.Type == typeof(PlayerSelector) && WorkshopName.StartsWith("Slot"))
     {
         return("Slot");
     }
     if (@Enum.Type == typeof(Button) && WorkshopName.StartsWith("Ability"))
     {
         return("Ability");
     }
     if ((@Enum.Type == typeof(Team) || @Enum.Type == typeof(Color)) && WorkshopName.StartsWith("Team"))
     {
         return("Team");
     }
     return(WorkshopName);
 }
示例#3
0
        public string ToWorkshop(OutputLanguage language, ToWorkshopContext context)
        {
            string numTranslate(string name)
            {
                return(LanguageInfo.Translate(language, name) + WorkshopName.Substring(name.Length));
            }

            if (@Enum.Type == typeof(PlayerSelector) && WorkshopName.StartsWith("Slot"))
            {
                return(numTranslate("Slot"));
            }
            if (@Enum.Type == typeof(Button) && WorkshopName.StartsWith("Ability"))
            {
                return(numTranslate("Ability"));
            }
            if ((@Enum.Type == typeof(Team) || @Enum.Type == typeof(Color)) && WorkshopName.StartsWith("Team"))
            {
                return(numTranslate("Team"));
            }

            return(LanguageInfo.Translate(language, WorkshopName).RemoveStructuralChars());
        }
示例#4
0
        public string ToWorkshop(OutputLanguage language)
        {
            string numTranslate(string name)
            {
                return(I18n.I18n.Translate(language, name) + WorkshopName.Substring(name.Length));
            }

            if (@Enum.Type == typeof(PlayerSelector) && WorkshopName.StartsWith("Slot"))
            {
                return(numTranslate("Slot"));
            }
            if (@Enum.Type == typeof(Button) && WorkshopName.StartsWith("Ability"))
            {
                return(numTranslate("Ability"));
            }
            if ((@Enum.Type == typeof(Team) || @Enum.Type == typeof(Color)) && WorkshopName.StartsWith("Team"))
            {
                return(numTranslate("Team"));
            }

            return(I18n.I18n.Translate(language, WorkshopName));
        }
示例#5
0
 public WorkshopAggregate(NonEmptyIdentity id, WorkshopName name, NonEmptyIdentity cityId) : this(id)
 {
     RaiseEvent(new WorkshopAdded(id, name, cityId, WorkshopStatus.Active));
 }