Packages

  • package root
    Definition Classes
    root
  • package io
    Definition Classes
    root
  • package github
    Definition Classes
    io
  • package memo33
    Definition Classes
    github
  • package scdbpf

    Provides methods for accessing and modifying the contents of DBPF formatted files.

    Provides methods for accessing and modifying the contents of DBPF formatted files. Currently, only DBPF version 1.0 is supported (used by SimCity 4).

    DBPF files are accessed via DbpfFiles, a container of DbpfEntries. The content of a DbpfEntry can be accessed from BufferedEntries in decoded form as DbpfType, such as Exemplar, Fsh or Sc4Path.

    This package object provides additional type aliases for DbpfExceptions.

    Examples

    To get started, it is easiest to start the REPL via sbt console, which loads all the dependencies and useful initial import statements. Reading a DBPF file, sorting its entries by TGI and writing back to the same file could be achieved like this:

    val dbpf = DbpfFile.read(new File("foobar.dat"))
    dbpf.write(dbpf.entries.sortBy(_.tgi))

    This example shifts the GIDs of all LTexts by +3:

    dbpf.write(dbpf.entries.map { e =>
      if (e.tgi matches Tgi.LText)
        e.copy(e.tgi.copy(gid = e.tgi.gid + 3))
      else
        e
    })

    Another example: This decodes all the Sc4Path entries and rotates them by 90 degree.

    val writeList = for (e <- dbpf.entries) yield {
      if (e.tgi matches Tgi.Sc4Path) {
        val be = e.toBufferedEntry.convertContentTo(Sc4Path)
        be.copy(content = be.content * RotFlip.R1F0)
      } else {
        e
      }
    }
    dbpf.write(writeList)

    The following example finds the first entry that is an exemplar and contains a property with a specific ID. (Note the view to avoid unnecessary decoding if the exemplar is already among the first entries.)

    val id = UInt(0x12345678)
    dbpf.entries.view.
      filter(_.tgi matches Tgi.Exemplar).
      map(_.toBufferedEntry.convertContentTo(Exemplar)).
      find(_.content.properties.contains(id))
    Definition Classes
    memo33
  • package compat
    Definition Classes
    scdbpf
  • BufferedEntry
  • DbpfEntry
  • DbpfExceptions
  • DbpfFile
  • DbpfPackager
  • DbpfProperty
  • DbpfType
  • DbpfTypeCompanion
  • DbpfUtil
  • Exemplar
  • Experimental
  • Fsh
  • LText
  • RawEntry
  • RawType
  • S3d
  • Sc4Path
  • StreamedEntry
  • Tgi
  • TgiMask
  • WithContentConverter

object Tgi

Provides various masks that Tgis can be matched against.

Source
tgi.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Tgi
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed trait LabeledTgi extends TgiLike
  2. sealed trait TgiLike extends AnyRef

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val Blank: Tgi
  5. val Cohort: TgiMask with LabeledTgi
  6. val Directory: Tgi
  7. val EffDir: TgiMask with LabeledTgi
  8. val Exemplar: TgiMask with LabeledTgi
  9. val ExemplarAvenue: TgiMask with LabeledTgi
  10. val ExemplarDirtroad: TgiMask with LabeledTgi
  11. val ExemplarGroundhighway: TgiMask with LabeledTgi
  12. val ExemplarHighway: TgiMask with LabeledTgi
  13. val ExemplarLightrail: TgiMask with LabeledTgi
  14. val ExemplarMonorail: TgiMask with LabeledTgi
  15. val ExemplarOnewayroad: TgiMask with LabeledTgi
  16. val ExemplarPowerpole: TgiMask with LabeledTgi
  17. val ExemplarRail: TgiMask with LabeledTgi
  18. val ExemplarRoad: TgiMask with LabeledTgi
  19. val ExemplarStreet: TgiMask with LabeledTgi
  20. val ExemplarSubway: TgiMask with LabeledTgi
  21. val ExemplarT21: TgiMask with LabeledTgi
  22. val Fsh: TgiMask with LabeledTgi
  23. val FshAnimNonprops: TgiMask with LabeledTgi
  24. val FshAnimProps: TgiMask with LabeledTgi
  25. val FshBaseOverlay: TgiMask with LabeledTgi
  26. val FshMisc: TgiMask with LabeledTgi
  27. val FshShadow: TgiMask with LabeledTgi
  28. val FshTerrainFoundation: TgiMask with LabeledTgi
  29. val FshUi: TgiMask with LabeledTgi
  30. val Ini: TgiMask with LabeledTgi
  31. val IniFont: Tgi
  32. val IniNetwork: Tgi
  33. val LText: TgiMask with LabeledTgi
  34. val Ld: TgiMask with LabeledTgi
  35. val Lua: TgiMask with LabeledTgi
  36. val LuaGen: TgiMask with LabeledTgi
  37. val Null: TgiMask with LabeledTgi
  38. val Png: TgiMask with LabeledTgi
  39. val PngIcon: TgiMask with LabeledTgi
  40. val Rul: TgiMask with LabeledTgi
  41. val S3d: TgiMask with LabeledTgi
  42. val S3dMaxis: TgiMask with LabeledTgi
  43. val Sc4Path: TgiMask with LabeledTgi
  44. val Sc4Path2d: TgiMask with LabeledTgi
  45. val Sc4Path3d: TgiMask with LabeledTgi
  46. val Wav: TgiMask with LabeledTgi
  47. def apply(tid: Int, gid: Int, iid: Int): Tgi
  48. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  49. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  50. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  51. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  52. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  53. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  54. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  55. val igtOrdering: Ordering[Tgi]

    a Tgi ordering that sorts by IID, GID, TID

  56. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  57. implicit val itgOrdering: Ordering[Tgi]

    the default implicit Tgi ordering that sorts by IID, TID, GID

  58. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  59. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  60. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  61. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  62. val tigOrdering: Ordering[Tgi]

    a Tgi ordering that sorts by TID, IID, GID

  63. def toString(): String
    Definition Classes
    AnyRef → Any
  64. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  65. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  66. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped