Example #1
0
 public GEMenuItem(string id, GEText menuName, List <GEAction> actions, GERequirement requirements, SortedList <string, GEText> texts, bool?isActive, int?maxUseNumber) : this(id, menuName, actions)
 {
     this.requirements = requirements;
     this.texts        = texts;
     this.maxUseNumber = maxUseNumber ?? 0;
     this.isActive     = isActive ?? false;
 }
Example #2
0
 public GERequirement(GEText textOnFail, List <GEActivationChecker> activationChecks, List <GEPropertyChecker> propertyCehecks, List <GEEquippedChecker> equippedChecks)
 {
     this.textOnFail       = textOnFail;
     this.activationChecks = activationChecks;
     this.propertyCehecks  = propertyCehecks;
     this.equippedChecks   = equippedChecks;
 }
Example #3
0
 public GEItem(string id, GEText itemName) : base(id)
 {
     menuItems     = new SortedList <string, GEMenuItem>();
     properties    = new SortedList <string, GEProperty>();
     texts         = new SortedList <string, GEText>();
     this.itemName = itemName;
     isEquipped    = false;
 }
Example #4
0
 public GERoom(string id, GEText nameText, string imgPath) : base(id)
 {
     this.nameText     = nameText;
     this.imgPath      = imgPath;
     this.isActive     = true;
     this.isCheckPoint = false;
     this.isVisited    = false;
 }
 public GEGameProperties(string firstRoomId, string defLang, GEText gameNameText, string menuImgSrc)
 {
     this.firstRoomId    = firstRoomId;
     this.defLang        = defLang;
     this.gameNameText   = gameNameText;
     IsMenuSaveAvailable = true;
     this.checkpointsOn  = false;
     this.menuImgSrc     = menuImgSrc;
 }
Example #6
0
 public GEAction(GameElementManager elementManager, GEText responseText, List <GEActivation> activations, List <GEPropertySetter> propertySetters, GESaveAction saveAction, int useInterval)
 {
     this.elementManager  = elementManager;
     this.responseText    = responseText;
     this.activations     = activations;
     this.propertySetters = propertySetters;
     this.useInterval     = useInterval;
     this.saveAction      = saveAction;
 }
Example #7
0
    public GEText GetTextElement(string id, bool log = true)
    {
        if (id == null)
        {
            return(GEText.GETextEmpty.Instance);
        }
        GEText ret = GetFromDic(texts, id, log);

        return(ret ?? GEText.GETextEmpty.Instance);
    }
Example #8
0
        public new GEText Execute()
        {
            foreach (GEEquipItem equipItem in equipItems)
            {
                equipItem.Execute(elementManager);
            }
            GEText response = base.Execute();

            return(response);
        }
Example #9
0
 public GEMenuItem(string id, GEText menuName, List <GEAction> actions) : base(id)
 {
     this.menuName = menuName;
     this.actions  = actions;
     actions.Sort((a1, a2) =>
     {
         return(a1.UseInterval - a2.UseInterval);
     });
     isActive      = true;
     maxUseNumber  = 0; //infinit representations
     ActionCounter = 0;
 }
Example #10
0
    public string GetText(string id, string lang, bool log = true)
    {
        GEText text = GetTextElement(id);

        if (text == null || text.IsEmpty())
        {
            if (log)
            {
                ObjectManager.Logger.LogWarn("There is no GEText with the given id! " + id);
                //throw new Exception(String.Format("There is no text with the given id! id: {0}", id));
            }
            return(null);
        }
        return(text.GetText(lang, log));
    }
Example #11
0
    public GEText AddText(string id, string txt, string lang)
    {
        GEText text = GetTextElement(id, false);

        if (text == null || text.IsEmpty())
        {
            text = new GEText(id, defLang, lang, txt);
            AddTextElement(text);
        }
        else
        {
            text.AddText(lang, txt);
        }
        if (!AvailableLangs.Contains(lang))
        {
            AvailableLangs.Add(lang);
        }
        return(text);
    }
Example #12
0
    public GEText Execute()
    {
        foreach (GEActivation activation in activations)
        {
            activation.Execute(elementManager);
        }

        foreach (GEPropertySetter propSetter in propertySetters)
        {
            propSetter.Execute(elementManager);
        }
        if (saveAction != null)
        {
            saveAction.Execute();
        }
        if (responseText == null)
        {
            responseText = GEText.GETextEmpty.Instance;
        }
        return(responseText);
    }
Example #13
0
 public GEProperty(string id, GEText name) : base(id)
 {
     this.name     = name;
     this.defValue = 0f;
     this.value    = 0f;
 }
Example #14
0
 public void AddTextElement(GEText text)
 {
     AddToDic(texts, text);
 }
Example #15
0
 public GEItemAction(GameElementManager elementManager, GEText responseText, List <GEActivation> activations, List <GEPropertySetter> propertySetters, GESaveAction saveAction, List <GEEquipItem> equipItems, int useInterval) : base(elementManager, responseText, activations, propertySetters, saveAction, useInterval)
 {
     this.equipItems = equipItems;
 }
Example #16
0
 public GEProperty(string id, GEText name, double defValue, double minValue, double?maxValue) : this(id, name, defValue)
 {
     this.minValue = minValue;
     this.maxValue = maxValue;
 }
Example #17
0
 public GEProperty(string id, GEText name, double defValue) : base(id)
 {
     this.name     = name;
     this.defValue = defValue;
     this.value    = defValue;
 }
Example #18
0
 public GEItem(string id, GEText itemName, bool isActive, bool equipable, GEText description) : this(id, itemName)
 {
     this.isActive    = isActive;
     this.equipable   = equipable;
     this.description = description;
 }
Example #19
0
 public GERoom(string id, GEText nameText, string imgPath, GEText descText, bool isActive, bool isCheckpoint) : this(id, nameText, imgPath)
 {
     this.descText     = descText;
     this.isActive     = isActive;
     this.isCheckPoint = isCheckpoint;
 }
 public GEGameProperties(string firstRoomId, string defLang, GEText gameNameText, string menuImgPath, GEText greetingText, bool isMenuSaveAvailable, bool checkpointsOn) : this(firstRoomId, defLang, gameNameText, menuImgPath)
 {
     this.greetingText   = greetingText;
     this.checkpointsOn  = checkpointsOn;
     IsMenuSaveAvailable = isMenuSaveAvailable;
 }