com.torvald → net.torvald

Former-commit-id: 375604da8a20a6ba7cd0a8d05a44add02b2d04f4
Former-commit-id: 287287c5920b07618174d7a7573f049d350ded66
This commit is contained in:
Song Minjae
2016-04-12 12:29:02 +09:00
parent 2a34efb489
commit ac9f5b5138
148 changed files with 473 additions and 524 deletions

View File

@@ -0,0 +1,9 @@
package net.torvald.terrarum.itemproperties
/**
* Created by minjaesong on 16-03-18.
*/
internal data class ItemProp (
var baseMass: Float,
var material: Material
)

View File

@@ -0,0 +1,44 @@
package net.torvald.terrarum.itemproperties
import net.torvald.terrarum.gameactors.CanBeAnItem
import net.torvald.terrarum.gameitem.InventoryItem
import net.torvald.terrarum.Terrarum
import org.newdawn.slick.GameContainer
import java.util.*
/**
* Created by minjaesong on 16-03-15.
*/
object ItemPropCodex {
val CSV_PATH = "./src/com/torvald/terrarum/itemproperties/itemprop.csv"
/**
* <ItemID or RefID for Actor, TheItem>
* Will return corresponding Actor if ID >= 32768
*/
private lateinit var itemCodex: Array<InventoryItem>
@JvmStatic val ITEM_UNIQUE_MAX = 32768
@JvmStatic
fun buildItemProp() {
itemCodex = arrayOf<InventoryItem>()
// read prop in csv
}
fun getItem(code: Long): InventoryItem {
if (code < ITEM_UNIQUE_MAX)
return itemCodex[(code and 0xFFFFFFFF).toInt()]
else {
for (actor in Terrarum.game.actorContainer) {
if (actor is CanBeAnItem && actor.referenceID == code)
return actor.itemData
}
throw NullPointerException()
}
}
}

View File

@@ -0,0 +1,10 @@
package net.torvald.terrarum.itemproperties
/**
* Created by minjaesong on 16-03-18.
*/
internal data class Material (
var maxEdge: Int,
var hardness: Int,
var density: Int
)

View File

@@ -0,0 +1,7 @@
package net.torvald.terrarum.itemproperties
/**
* Created by minjaesong on 16-03-19.
*/
object MaterialFactory {
}

View File

@@ -0,0 +1,9 @@
package net.torvald.terrarum.itemproperties
/**
* Created by minjaesong on 16-03-18.
*/
object MaterialPropCodex {
val CSV_PATH = "./src/com/torvald/terrarum/itemproperties/materialprop.csv"
}