Class MagellanSpellImpl

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  MagellanSpellImpl.Component
      Standard spell component implementation.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addAttribute​(java.lang.String key, java.lang.String value)  
      boolean containsAttribute​(java.lang.String key)  
      java.lang.String getAttribute​(java.lang.String key)  
      java.util.List<java.lang.String> getAttributeKeys()  
      int getAttributeSize()  
      int getBlockID()
      Returns the integer serving as the block id in the cr.
      java.util.Map<java.lang.String,​java.lang.String> getComponents()
      Returns the components of this spell as Strings.
      StringID getID()
      Returns the id uniquely identifying this object.
      boolean getIsFamiliar()
      Returns true if this is a spell can be cast by the mage's familiar.
      boolean getIsFar()
      Returns true if this spell has far effects
      int getLevel()
      Returns the level of this spell which indicates the lowest skill level a mage must have to be able to cast this spell.
      java.util.Locale getLocale()
      Only returns the locale of the spell
      java.lang.String getName()
      Returns the name of this object.
      boolean getOnOcean()
      Returns true if this spell can be cast while on oceans.
      boolean getOnShip()
      Returns true if this spell can be cast on leaving ships.
      java.util.List<? extends Spell.Component> getParsedComponents()
      Returns a list of the spells components in a more convenient form.
      int getRank()
      Returns the rank of this spell.
      SpellSyntax getSpellSyntax()
      returns the spellsyntax object of this spell
      java.lang.String getSyntax()
      Enno in e-client about the syntax: 'c' = Zeichenkette 'k' = REGION|EINHEIT|STUFE|SCHIFF|GEBAEUDE 'i' = Zahl 's' = Schiffsnummer 'b' = Gebaeudenummer 'r' = Regionskoordinaten (x, y) 'u' = Einheit '+' = Wiederholung des vorangehenden Parameters '?'
      java.lang.String getSyntaxString()
      A human readable string with information about the syntax of the spell (FF)
      java.lang.String getType()
      Returns the class attribute of this spell.
      java.lang.String getTypeName()
      Returns a name for this spell's type.
      protected java.lang.String getUnTranslatedName()
      Deprecated.
      this may change if the constructor is changed to not include a reference to the GameData any more.
      void setBlockID​(int id)
      Sets the integer serving as the block id in the cr.
      void setComponents​(java.util.Map<java.lang.String,​java.lang.String> components)
      Sets the components of this spell as Strings.
      void setIsFamiliar​(boolean isFamiliar)
      Sets the familiar property.
      void setIsFar​(boolean _isFar)
      Sets if this spell has far effects
      void setLevel​(int level)
      Sets the level of this spell which indicates the lowest skill level a mage must have to be able to cast this spell.
      void setLocale​(java.util.Locale locale)
      Sets the locale and invalidates the description if required.
      void setOnOcean​(boolean onOcean)
      Sets if this spell has effect on oceans.
      void setOnShip​(boolean onShip)
      Sets if this spell can be cast on leaving ships
      void setRank​(int rank)
      Sets the rank of this spell.
      void setSyntax​(java.lang.String syntax)  
      void setType​(java.lang.String type)
      Sets the class attribute of this spell.
      java.lang.String toString()
      Returns a string representation which looks like this: [N1 F S See ] denoting the type, the level, and if this is a far, a ship or a sea spell.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MagellanSpellImpl

        public MagellanSpellImpl​(StringID id,
                                 GameData _data)
        Creates a new Spell object. CR looks as follows:
         ZAUBER 1234567
         "german name";name
         "localized description";description
         ...
         ...
         EINHEIT mage
         ...
         SPRUECHE
         "german name"
         ...
         ...
         TRANSLATION
         "english name";german name
         
        this means, spells are identified by their german names
        Parameters:
        id - This should currently be a StringID
        _data -
    • Method Detail

      • getBlockID

        public int getBlockID()
        Returns the integer serving as the block id in the cr.
        Specified by:
        getBlockID in interface Spell
      • setBlockID

        public void setBlockID​(int id)
        Sets the integer serving as the block id in the cr.
        Specified by:
        setBlockID in interface Spell
      • getLevel

        public int getLevel()
        Returns the level of this spell which indicates the lowest skill level a mage must have to be able to cast this spell.
        Specified by:
        getLevel in interface Spell
      • setLevel

        public void setLevel​(int level)
        Sets the level of this spell which indicates the lowest skill level a mage must have to be able to cast this spell.
        Specified by:
        setLevel in interface Spell
      • getRank

        public int getRank()
        Description copied from interface: Spell
        Returns the rank of this spell.
        Specified by:
        getRank in interface Spell
        See Also:
        Spell.getRank()
      • setRank

        public void setRank​(int rank)
        Description copied from interface: Spell
        Sets the rank of this spell.
        Specified by:
        setRank in interface Spell
        See Also:
        Spell.setRank(int)
      • getType

        public java.lang.String getType()
        Returns the class attribute of this spell.
        Specified by:
        getType in interface Spell
      • setType

        public void setType​(java.lang.String type)
        Sets the class attribute of this spell.
        Specified by:
        setType in interface Spell
      • getOnOcean

        public boolean getOnOcean()
        Description copied from interface: Spell
        Returns true if this spell can be cast while on oceans.
        Specified by:
        getOnOcean in interface Spell
        See Also:
        Spell.getOnOcean()
      • getOnShip

        public boolean getOnShip()
        Description copied from interface: Spell
        Returns true if this spell can be cast on leaving ships.
        Specified by:
        getOnShip in interface Spell
        See Also:
        Spell.getOnShip()
      • setOnShip

        public void setOnShip​(boolean onShip)
        Description copied from interface: Spell
        Sets if this spell can be cast on leaving ships
        Specified by:
        setOnShip in interface Spell
        See Also:
        Spell.setOnShip(boolean)
      • getIsFamiliar

        public boolean getIsFamiliar()
        Description copied from interface: Spell
        Returns true if this is a spell can be cast by the mage's familiar.
        Specified by:
        getIsFamiliar in interface Spell
        See Also:
        Spell.getIsFamiliar()
      • setIsFamiliar

        public void setIsFamiliar​(boolean isFamiliar)
        Description copied from interface: Spell
        Sets the familiar property. true means that this is a spell can be cast by the mage's familiar.
        Specified by:
        setIsFamiliar in interface Spell
        See Also:
        Spell.setIsFamiliar(boolean)
      • getIsFar

        public boolean getIsFar()
        Description copied from interface: Spell
        Returns true if this spell has far effects
        Specified by:
        getIsFar in interface Spell
        See Also:
        Spell.getIsFar()
      • setIsFar

        public void setIsFar​(boolean _isFar)
        Description copied from interface: Spell
        Sets if this spell has far effects
        Specified by:
        setIsFar in interface Spell
        See Also:
        Spell.setIsFar(boolean)
      • getComponents

        public java.util.Map<java.lang.String,​java.lang.String> getComponents()
        Returns the components of this spell as Strings.
        Specified by:
        getComponents in interface Spell
        See Also:
        Spell.getComponents()
      • getParsedComponents

        public java.util.List<? extends Spell.Component> getParsedComponents()
        Description copied from interface: Spell
        Returns a list of the spells components in a more convenient form.
        Specified by:
        getParsedComponents in interface Spell
      • setComponents

        public void setComponents​(java.util.Map<java.lang.String,​java.lang.String> components)
        Description copied from interface: Spell
        Sets the components of this spell as Strings. Types (the keys) are not localized.
        Specified by:
        setComponents in interface Spell
        See Also:
        Spell.setComponents(java.util.Map)
      • getUnTranslatedName

        @Deprecated
        protected java.lang.String getUnTranslatedName()
        Deprecated.
        this may change if the constructor is changed to not include a reference to the GameData any more.
      • getTypeName

        public java.lang.String getTypeName()
        Returns a name for this spell's type.
        Specified by:
        getTypeName in interface Spell
      • getSyntaxString

        public java.lang.String getSyntaxString()
        A human readable string with information about the syntax of the spell (FF)
        Specified by:
        getSyntaxString in interface Spell
        See Also:
        Spell.getSyntaxString()
      • getSyntax

        public java.lang.String getSyntax()
        Description copied from interface: Spell
        Enno in e-client about the syntax:
        • 'c' = Zeichenkette
        • 'k' = REGION|EINHEIT|STUFE|SCHIFF|GEBAEUDE
        • 'i' = Zahl
        • 's' = Schiffsnummer
        • 'b' = Gebaeudenummer
        • 'r' = Regionskoordinaten (x, y)
        • 'u' = Einheit
        • '+' = Wiederholung des vorangehenden Parameters
        • '?' = vorangegangener Parameter
        ist nicht zwingend Syntaxcheks, die der Server auf dieser Basis macht, sind nicht perfekt; es ist notwendig, aber nicht hinreichend, dass die Syntax erfuellt wird. Aber in den vielen Faellen kann man damit schonmal sagen, was denn falsch war.
        Specified by:
        getSyntax in interface Spell
        Returns:
        the syntax or null
        See Also:
        Spell.getSyntax()
      • setSyntax

        public void setSyntax​(java.lang.String syntax)
        Specified by:
        setSyntax in interface Spell
        Parameters:
        syntax - the syntax to set
      • getSpellSyntax

        public SpellSyntax getSpellSyntax()
        returns the spellsyntax object of this spell
        Specified by:
        getSpellSyntax in interface Spell
        Returns:
        a SpellSyntax object or null
      • getLocale

        public java.util.Locale getLocale()
        Only returns the locale of the spell
        Specified by:
        getLocale in interface Localized
        Returns:
        the locale of the spell or null
        See Also:
        Localized.getLocale()