diff --git a/ShakeAndCraft/.gitignore b/ShakeAndCraft/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/ShakeAndCraft/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/ShakeAndCraft/.idea/.gitignore b/ShakeAndCraft/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/ShakeAndCraft/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/ShakeAndCraft/.idea/.name b/ShakeAndCraft/.idea/.name new file mode 100644 index 0000000..38b0e9c --- /dev/null +++ b/ShakeAndCraft/.idea/.name @@ -0,0 +1 @@ +Shake&Craft \ No newline at end of file diff --git a/ShakeAndCraft/.idea/codeStyles/Project.xml b/ShakeAndCraft/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..7643783 --- /dev/null +++ b/ShakeAndCraft/.idea/codeStyles/Project.xml @@ -0,0 +1,123 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/.idea/codeStyles/codeStyleConfig.xml b/ShakeAndCraft/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/ShakeAndCraft/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/ShakeAndCraft/.idea/compiler.xml b/ShakeAndCraft/.idea/compiler.xml new file mode 100644 index 0000000..fb7f4a8 --- /dev/null +++ b/ShakeAndCraft/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/.idea/gradle.xml b/ShakeAndCraft/.idea/gradle.xml new file mode 100644 index 0000000..a2d7c21 --- /dev/null +++ b/ShakeAndCraft/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/.idea/misc.xml b/ShakeAndCraft/.idea/misc.xml new file mode 100644 index 0000000..282e8b8 --- /dev/null +++ b/ShakeAndCraft/.idea/misc.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/.idea/vcs.xml b/ShakeAndCraft/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/ShakeAndCraft/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/.gitignore b/ShakeAndCraft/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/ShakeAndCraft/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/ShakeAndCraft/app/assets/Group 37.svg b/ShakeAndCraft/app/assets/Group 37.svg new file mode 100644 index 0000000..36ae574 --- /dev/null +++ b/ShakeAndCraft/app/assets/Group 37.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/ShakeAndCraft/app/assets/Subtract.svg b/ShakeAndCraft/app/assets/Subtract.svg new file mode 100644 index 0000000..5b746c2 --- /dev/null +++ b/ShakeAndCraft/app/assets/Subtract.svg @@ -0,0 +1,3 @@ + + + diff --git a/ShakeAndCraft/app/assets/Union (3).svg b/ShakeAndCraft/app/assets/Union (3).svg new file mode 100644 index 0000000..5e0abde --- /dev/null +++ b/ShakeAndCraft/app/assets/Union (3).svg @@ -0,0 +1,3 @@ + + + diff --git a/ShakeAndCraft/app/assets/backgroundForest.png b/ShakeAndCraft/app/assets/backgroundForest.png new file mode 100644 index 0000000..96a6c47 Binary files /dev/null and b/ShakeAndCraft/app/assets/backgroundForest.png differ diff --git a/ShakeAndCraft/app/build.gradle b/ShakeAndCraft/app/build.gradle new file mode 100644 index 0000000..3737add --- /dev/null +++ b/ShakeAndCraft/app/build.gradle @@ -0,0 +1,50 @@ +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' +} + +android { + namespace 'com.example.shakecraft' + compileSdk 33 + + defaultConfig { + applicationId "com.example.shakecraft" + minSdk 19 + targetSdk 33 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } +} + +dependencies { + + implementation 'androidx.core:core-ktx:1.7.0' + implementation 'androidx.appcompat:appcompat:1.4.1' + implementation 'com.google.android.material:material:1.5.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.3' + implementation 'com.google.ar.sceneform:filament-android:1.17.1' + implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3' + implementation 'androidx.navigation:navigation-ui-ktx:2.5.3' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + implementation 'androidx.vectordrawable:vectordrawable:1.1.0' +} \ No newline at end of file diff --git a/ShakeAndCraft/app/proguard-rules.pro b/ShakeAndCraft/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/ShakeAndCraft/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/ShakeAndCraft/app/src/androidTest/java/com/example/shakecraft/ExampleInstrumentedTest.kt b/ShakeAndCraft/app/src/androidTest/java/com/example/shakecraft/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..494a749 --- /dev/null +++ b/ShakeAndCraft/app/src/androidTest/java/com/example/shakecraft/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.example.shakecraft + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.example.shakecraft", appContext.packageName) + } +} \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/AndroidManifest.xml b/ShakeAndCraft/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..cf53e4e --- /dev/null +++ b/ShakeAndCraft/app/src/main/AndroidManifest.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/ic_launcher-playstore.png b/ShakeAndCraft/app/src/main/ic_launcher-playstore.png new file mode 100644 index 0000000..8df10f1 Binary files /dev/null and b/ShakeAndCraft/app/src/main/ic_launcher-playstore.png differ diff --git a/ShakeAndCraft/app/src/main/java/com/example/shakecraft/BossFragment.kt b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/BossFragment.kt new file mode 100644 index 0000000..3591ff7 --- /dev/null +++ b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/BossFragment.kt @@ -0,0 +1,178 @@ +package com.example.shakecraft +import android.content.Context +import android.content.pm.ActivityInfo +import android.hardware.Sensor +import android.hardware.SensorEvent +import android.hardware.SensorEventListener +import android.hardware.SensorManager +import android.os.Bundle +import android.os.Vibrator +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.view.animation.Animation +import android.view.animation.ScaleAnimation +import android.widget.ImageView +import android.widget.ProgressBar +import android.widget.TextView +import androidx.navigation.fragment.findNavController +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView +import com.example.shakecraft.model.Generator +import com.example.shakecraft.view.adapter.AdapterBossLoot +import kotlin.math.pow +import kotlin.math.sqrt + + +class BossFragment() : Fragment() { + + + private lateinit var sensorManager: SensorManager + private lateinit var accelerometer: Sensor + private lateinit var accelerometerEventListener: SensorEventListener + private lateinit var progressBar: ProgressBar + private lateinit var image: ImageView + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + + val player = (activity as MainActivity).currentPlayer + + val view = inflater.inflate(R.layout.fragment_boss, container, false) + val buttonCollect = view.findViewById(R.id.backbutton) + buttonCollect.setOnClickListener{ + findNavController().navigate(R.id.action_bossFragment_to_homeFragment) + } + val imageView = view.findViewById(R.id.imageBoss) + imageView.scaleX = 1.2f + imageView.scaleY = 1.2f + +// Créez une animation qui modifie la propriété scaleX et scaleY de l'image + val scaleAnimation = ScaleAnimation( + 1.2f, // de 2.0 à 1.0 + 1.0f, + 1.2f, + 1.0f, + Animation.RELATIVE_TO_SELF, + 0.5f, + Animation.RELATIVE_TO_SELF, + 0.5f + ) + + scaleAnimation.duration = 1000 // dure 1 seconde + scaleAnimation.repeatCount = Animation.INFINITE // répéter indéfiniment + scaleAnimation.repeatMode = Animation.REVERSE // inverser la direction de l'animation + +// Appliquez l'animation à l'image + imageView.startAnimation(scaleAnimation) + + + progressBar = view.findViewById(R.id.progressBar) + sensorManager = requireActivity().getSystemService(Context.SENSOR_SERVICE) as SensorManager + accelerometer = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER) + var boss = Generator.generateBoss() + progressBar.max = boss.maxlife + progressBar.progress = boss.life + imageView.setImageResource(boss.image) + + + val recyclerView: RecyclerView = view.findViewById(R.id.recyclerviewBossLoot) + with(recyclerView) { + layoutManager = LinearLayoutManager(view.context) + adapter = AdapterBossLoot(boss.possibleLoot) + } + + + // Créez un écouteur de capteur d'accéléromètre pour écouter les secousses + accelerometerEventListener = object : SensorEventListener { + override fun onAccuracyChanged(sensor: Sensor?, accuracy: Int) { + // Ne faites rien ici + } + + override fun onSensorChanged(event: SensorEvent?) { + val acceleration = sqrt( + event!!.values[0].pow(2) + event.values[1].pow(2) + event.values[2].pow(2) + ) + if(boss.life <= 0){ + val item = Generator.generateLootBoss(boss.possibleLoot) + println(item) + player.addItem(item) + player.gainXp(boss.xpReward) + val maVue = view.findViewById(R.id.toast) + val image = maVue.findViewById(R.id.imageViewLoot) + val name = maVue.findViewById(R.id.nameLoot) + val xp = maVue.findViewById(R.id.xpRewarded) + maVue.visibility = View.VISIBLE + image.setImageResource(item.image) + name.text = item.name + xp.text = boss.xpReward.toString() + maVue.postDelayed({ + maVue.visibility = View.GONE + + }, 3000) + boss = Generator.generateBoss() + println(boss) + imageView.setImageResource(boss.image) + val vibrator = context?.getSystemService(Context.VIBRATOR_SERVICE) as Vibrator + vibrator.vibrate(100) + progressBar.max = boss.maxlife + progressBar.progress = boss.life + with(recyclerView) { + layoutManager = LinearLayoutManager(view.context) + adapter = AdapterBossLoot(boss.possibleLoot) + } + + + // Définissez la propriété scaleX et scaleY de l'image sur 0.5f + + + + + + + } + if (acceleration > 40) { + boss.takeDamage((acceleration/80).toInt()) + progressBar.progress = boss.life + + } + + + } + } + + + sensorManager.registerListener( + accelerometerEventListener, + accelerometer, + SensorManager.SENSOR_DELAY_GAME + ) + + + + return view + } + override fun onActivityCreated(savedInstanceState: Bundle?) { + super.onActivityCreated(savedInstanceState) + + val activity = requireActivity() + activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT + } + override fun onDestroy() { + super.onDestroy() + + // Désenregistrez l'écouteur de capteur d'accéléromètre lorsque le fragment est détruit + sensorManager.unregisterListener(accelerometerEventListener) + val activity = requireActivity() + activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED + } +} \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/java/com/example/shakecraft/CollectFragment.kt b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/CollectFragment.kt new file mode 100644 index 0000000..951cb10 --- /dev/null +++ b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/CollectFragment.kt @@ -0,0 +1,132 @@ +package com.example.shakecraft + +import android.annotation.SuppressLint +import android.content.Context +import android.content.pm.ActivityInfo +import android.hardware.Sensor +import android.hardware.SensorEvent +import android.hardware.SensorEventListener +import android.hardware.SensorManager +import android.os.Bundle +import android.os.Vibrator +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.ImageView +import android.widget.ProgressBar +import android.widget.TextView + +import androidx.navigation.fragment.findNavController + +import com.example.shakecraft.model.Generator + +import kotlin.math.pow +import kotlin.math.sqrt + + +class CollectFragment() : Fragment() { + private lateinit var sensorManager: SensorManager + private lateinit var accelerometer: Sensor + private lateinit var accelerometerEventListener: SensorEventListener + private lateinit var progressBar: ProgressBar + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + + + + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + val player = (activity as MainActivity).currentPlayer + // Récupérez une référence à la ProgressBar dans la vue + val view = inflater.inflate(R.layout.fragment_collect, container, false) + + + val buttonCollect = view.findViewById(R.id.backbutton) + buttonCollect.setOnClickListener{ + findNavController().navigate(R.id.action_collectFragment_to_homeFragment) + } + + progressBar = view.findViewById(R.id.progressBar) + sensorManager = requireActivity().getSystemService(Context.SENSOR_SERVICE) as SensorManager + accelerometer = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER) + + // Créez un écouteur de capteur d'accéléromètre pour écouter les secousses + accelerometerEventListener = object : SensorEventListener { + override fun onAccuracyChanged(sensor: Sensor?, accuracy: Int) { + // Ne faites rien ici + } + + @SuppressLint("ServiceCast") + override fun onSensorChanged(event: SensorEvent?) { + val acceleration = sqrt( + event!!.values[0].pow(2) + event.values[1].pow(2) + event.values[2].pow(2) + ) + if(progressBar.progress == 100){ + val item = Generator.generateLootCollection() + println(item) + + player.addItem(item) + player.gainXp(item.xpReward) + progressBar.progress = 0 + val vibrator = context?.getSystemService(Context.VIBRATOR_SERVICE) as Vibrator + vibrator.vibrate(100) + + + + + val maVue = view.findViewById(R.id.toast) + val image = maVue.findViewById(R.id.imageViewLoot) + val name = maVue.findViewById(R.id.nameLoot) + val xp = maVue.findViewById(R.id.xpRewarded) + maVue.visibility = View.VISIBLE + image.setImageResource(item.image) + name.text = item.name + xp.text = item.xpReward.toString() + maVue.postDelayed({ + maVue.visibility = View.GONE + + }, 3000) + + + + } + if (acceleration > 40) { + // Le téléphone a été secoué, mettre à jour la barre de chargement ici + progressBar.progress += (acceleration/20).toInt() // Incrémente la progression de la barre de 10 unités + } + } + } + + // Enregistrez l'écouteur de capteur d'accéléromètre + sensorManager.registerListener( + accelerometerEventListener, + accelerometer, + SensorManager.SENSOR_DELAY_GAME + ) + + + // Retournez la vue de fragment + return view + } + override fun onActivityCreated(savedInstanceState: Bundle?) { + super.onActivityCreated(savedInstanceState) + + val activity = requireActivity() + activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT + } + override fun onDestroy() { + super.onDestroy() + + // Désenregistrez l'écouteur de capteur d'accéléromètre lorsque le fragment est détruit + sensorManager.unregisterListener(accelerometerEventListener) + val activity = requireActivity() + activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED + } +} \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/java/com/example/shakecraft/HomeFragment.kt b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/HomeFragment.kt new file mode 100644 index 0000000..321024c --- /dev/null +++ b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/HomeFragment.kt @@ -0,0 +1,60 @@ +package com.example.shakecraft + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup + +import android.widget.ProgressBar +import android.widget.TextView +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.navigation.NavOptions +import androidx.navigation.fragment.findNavController + + + + +class HomeFragment : Fragment() { + + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + val player = (activity as MainActivity).currentPlayer + + val view = inflater.inflate(R.layout.fragment_home,container,false) + val buttonCollect = view.findViewById(R.id.buttonCollect) + buttonCollect.setOnClickListener{ + findNavController().navigate(R.id.action_homeFragment_to_collectFragment, null, NavOptions.Builder().setPopUpTo(R.id.homeFragment, false).build()) + } + val buttonBoss = view.findViewById(R.id.buttonBoss) + buttonBoss.setOnClickListener{ + findNavController().navigate(R.id.action_homeFragment_to_bossFragment, null, NavOptions.Builder().setPopUpTo(R.id.homeFragment, false).build()) + } + + val pseudo = view.findViewById(R.id.pseudoTextView) + val progressbar = view.findViewById(R.id.levelProgressBar) + val level = view.findViewById(R.id.levelTextView) + val rank = view.findViewById(R.id.rankTextView) + val maxXp = view.findViewById(R.id.maxXpTextView) + val xp = view.findViewById(R.id.xpTextView) + pseudo.text = player.pseudo + level.text = player.level.toString() + rank.text = player.rank + xp.text = player.xp.toString() + maxXp.text = (player.level*100).toString() + progressbar.progress = player.xp + progressbar.max = player.level*100 + + return view + } + + +} \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/java/com/example/shakecraft/InventoryFragment.kt b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/InventoryFragment.kt new file mode 100644 index 0000000..e4d1a5e --- /dev/null +++ b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/InventoryFragment.kt @@ -0,0 +1,38 @@ +package com.example.shakecraft + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView +import com.example.shakecraft.data.Stub +import com.example.shakecraft.model.Player +import com.example.shakecraft.view.adapter.AdapterInventory + + +class InventoryFragment() : Fragment( ) { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + } + + + override fun onCreateView( + + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + var player = (activity as MainActivity).currentPlayer + val view = inflater.inflate(R.layout.fragment_inventory, container, false) + val recyclerView: RecyclerView = view.findViewById(R.id.recyclerviewInventory) + with(recyclerView) { + layoutManager = LinearLayoutManager(view.context) + adapter = AdapterInventory(player.items) + } + return view + } + +} \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/java/com/example/shakecraft/MainActivity.kt b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/MainActivity.kt new file mode 100644 index 0000000..e2d7a7d --- /dev/null +++ b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/MainActivity.kt @@ -0,0 +1,51 @@ +package com.example.shakecraft + +import android.os.Build +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import androidx.annotation.RequiresApi +import androidx.core.view.WindowCompat +import androidx.core.view.WindowInsetsCompat +import androidx.core.view.WindowInsetsControllerCompat + +import androidx.navigation.findNavController +import androidx.navigation.ui.setupWithNavController + +import com.example.shakecraft.data.Stub + +import com.google.android.material.bottomnavigation.BottomNavigationView + +class MainActivity : AppCompatActivity() { + + + var currentPlayer = Stub().currentPlayer + + @RequiresApi(Build.VERSION_CODES.R) + private fun hideSystemUI() { + WindowCompat.setDecorFitsSystemWindows(window, false) + WindowInsetsControllerCompat(window, + window.decorView.findViewById(android.R.id.content)).let { controller -> + controller.hide(WindowInsetsCompat.Type.systemBars()) + + controller.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE + } + + } + + private lateinit var bottomNav : BottomNavigationView + @RequiresApi(Build.VERSION_CODES.R) + override fun onCreate(savedInstanceState: Bundle?) { + + super.onCreate(savedInstanceState) + hideSystemUI() + setContentView(R.layout.activity_main) + + bottomNav = findViewById(R.id.bottomNavigationView) + val navController = findNavController(R.id.fragment) + bottomNav.setupWithNavController(navController) + + } + + + +} \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/java/com/example/shakecraft/PlusFragment.kt b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/PlusFragment.kt new file mode 100644 index 0000000..58149fc --- /dev/null +++ b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/PlusFragment.kt @@ -0,0 +1,59 @@ +package com.example.shakecraft + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup + +// TODO: Rename parameter arguments, choose names that match +// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER +private const val ARG_PARAM1 = "param1" +private const val ARG_PARAM2 = "param2" + +/** + * A simple [Fragment] subclass. + * Use the [PlusFragment.newInstance] factory method to + * create an instance of this fragment. + */ +class PlusFragment : Fragment() { + // TODO: Rename and change types of parameters + private var param1: String? = null + private var param2: String? = null + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + arguments?.let { + param1 = it.getString(ARG_PARAM1) + param2 = it.getString(ARG_PARAM2) + } + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_plus, container, false) + } + + companion object { + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment PlusFragment. + */ + // TODO: Rename and change types and number of parameters + @JvmStatic + fun newInstance(param1: String, param2: String) = + PlusFragment().apply { + arguments = Bundle().apply { + putString(ARG_PARAM1, param1) + putString(ARG_PARAM2, param2) + } + } + } +} \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/java/com/example/shakecraft/data/Stub.kt b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/data/Stub.kt new file mode 100644 index 0000000..c6dfaf4 --- /dev/null +++ b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/data/Stub.kt @@ -0,0 +1,22 @@ +package com.example.shakecraft.data + +import com.example.shakecraft.R +import com.example.shakecraft.model.Item +import com.example.shakecraft.model.Player + + +class Stub { + + fun load() : List{ + val items : MutableList = mutableListOf() + items.add(Item(name = "Beech Log", rarity = 1, stack = 1, R.drawable.ic_anvil, xpReward = 10 )) + items.add(Item(name = "Bronze Ore", rarity = 2, stack = 1, R.drawable.ic_anvil, xpReward = 20)) + items.add(Item(name = "Iron Ore", rarity = 3, stack = 1, R.drawable.ic_anvil, xpReward = 30)) + items.add(Item(name = "Diamond", rarity = 3, stack = 1, R.drawable.ic_anvil, xpReward = 30)) + return items + } + + + var currentPlayer : Player = Player("Winker",0) + +} \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/java/com/example/shakecraft/model/Boss.kt b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/model/Boss.kt new file mode 100644 index 0000000..62b9b1b --- /dev/null +++ b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/model/Boss.kt @@ -0,0 +1,16 @@ +package com.example.shakecraft.model + + +class Boss ( + var name: String, + var life: Int, + var maxlife: Int, + var image: Int, + var xpReward: Int, + val possibleLoot: List>, +){ + + fun takeDamage(strength: Int) { + this.life -= strength + } +} \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/java/com/example/shakecraft/model/Generator.kt b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/model/Generator.kt new file mode 100644 index 0000000..12728b0 --- /dev/null +++ b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/model/Generator.kt @@ -0,0 +1,84 @@ +package com.example.shakecraft.model + +import com.example.shakecraft.R +import kotlin.random.Random + +class Generator { + + companion object { + fun generateLootCollection(): Item { + val possibleLoot: List> = listOf( + Pair(Item(name = "Beech Log", rarity = 1, stack = 1, R.drawable.log2, 10), 0.6), + Pair(Item(name = "Bronze Ore", rarity = 2, stack = 1, R.drawable.bronze_ore, 20), 0.25), + Pair(Item(name = "Iron Ore", rarity = 2, stack = 1, R.drawable.iron_ore, 25), 0.10), + Pair(Item(name = "Diamond", rarity = 3, stack = 1, R.drawable.diamond, 30), 0.05), + ) + val rand = Random.nextDouble() + + var cumulativeProb = 0.0 + for (element in possibleLoot) { + cumulativeProb += element.second + if (rand < cumulativeProb) { + return element.first + } + } + // Si aucun élément n'a été choisi, retourner le dernier élément de la liste + return possibleLoot.last().first + } + + fun generateLootBoss( possibleLoot : List>): Item { + val rand = Random.nextDouble() + + var cumulativeProb = 0.0 + for (element in possibleLoot) { + cumulativeProb += element.second + if (rand < cumulativeProb) { + return element.first + } + } + // Si aucun élément n'a été choisi, retourner le dernier élément de la liste + return possibleLoot.last().first + } + + + fun generateBoss(): Boss { + val possibleBoss: List> = listOf( + Pair(Boss(name = "Margit the Fell Omen", life = 150, maxlife = 150, image = R.drawable.boss, xpReward = 100, possibleLoot = listOf( + Pair(Item(name = "Monster Bones", rarity = 1, stack = 1, R.drawable.monster_bones, 10), 0.7), + Pair(Item(name = "Monster Eye", rarity = 2, stack = 1, R.drawable.monster_eyes, 20), 0.3), + )), 0.5), + Pair(Boss(name = "Godrick the Grafted", life = 200, maxlife = 200, image = R.drawable.skeleton, xpReward = 130, possibleLoot = listOf( + Pair(Item(name = "Monster Bones", rarity = 1, stack = 1, R.drawable.monster_bones, 10), 0.6), + Pair(Item(name = "Monster Eye", rarity = 2, stack = 1, R.drawable.monster_eyes, 20), 0.3), + Pair(Item(name = "Treasure Key", rarity = 2, stack = 1, R.drawable.treasure_key, 20), 0.1), + )), 0.2), + Pair(Boss(name = "Red Wolf of Radagon", life = 250, maxlife = 250, image = R.drawable.halberdier, xpReward = 210, possibleLoot = listOf( + Pair(Item(name = "Monster Bones", rarity = 1, stack = 1, R.drawable.monster_bones, 10), 0.6), + Pair(Item(name = "Monster Eye", rarity = 2, stack = 1, R.drawable.monster_eyes, 20), 0.3), + Pair(Item(name = "Treasure Key", rarity = 2, stack = 1, R.drawable.treasure_key, 20), 0.1), + )), 0.15), + Pair(Boss(name = "Old Banshee", life = 300, maxlife = 300, image = R.drawable.banshee, xpReward = 300, possibleLoot = listOf( + Pair(Item(name = "Monster Bones", rarity = 1, stack = 1, R.drawable.monster_bones, 10), 0.4), + Pair(Item(name = "Monster Eye", rarity = 2, stack = 1, R.drawable.monster_eyes, 20), 0.4), + Pair(Item(name = "Treasure Key", rarity = 2, stack = 1, R.drawable.treasure_key, 20), 0.2), + )), 0.10), + Pair(Boss(name = "Margit the Fell Omen", life = 500, maxlife = 500, image = R.drawable.lich, xpReward = 500, possibleLoot = listOf( + Pair(Item(name = "Monster Bones", rarity = 1, stack = 1, R.drawable.monster_bones, 10), 0.4), + Pair(Item(name = "Monster Eye", rarity = 2, stack = 1, R.drawable.monster_eyes, 20), 0.3), + Pair(Item(name = "Treasure Key", rarity = 2, stack = 1, R.drawable.treasure_key, 20), 0.3), + )), 0.05), + ) + val rand = Random.nextDouble() + + var cumulativeProb = 0.0 + for (element in possibleBoss) { + cumulativeProb += element.second + if (rand < cumulativeProb) { + return element.first + } + } + // Si aucun élément n'a été choisi, retourner le dernier élément de la liste + return possibleBoss.last().first + } + } +} \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/java/com/example/shakecraft/model/Item.kt b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/model/Item.kt new file mode 100644 index 0000000..4eb1b07 --- /dev/null +++ b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/model/Item.kt @@ -0,0 +1,12 @@ +package com.example.shakecraft.model + + +data class Item( + var name: String, + var rarity: Int, + var stack: Int, + var image: Int, + var xpReward: Int, +) + + diff --git a/ShakeAndCraft/app/src/main/java/com/example/shakecraft/model/Player.kt b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/model/Player.kt new file mode 100644 index 0000000..e9da6ed --- /dev/null +++ b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/model/Player.kt @@ -0,0 +1,68 @@ +package com.example.shakecraft.model + +class Player(val pseudo: String, var xp: Int = 0) { + var level: Int = 1 + + val items: MutableList = mutableListOf() + var rank: String = "Beginner" + + + fun changeRank(){ + if(this.level<=2){ + this.rank = "Beginner" + } + else if(this.level<=5){ + this.rank = "Intermediate" + } + else if(this.level<=8){ + this.rank = "Proficient" + } + else if(this.level<=11){ + this.rank = "Expert" + } + else if(this.level<=14){ + this.rank = "Master" + } + else if(this.level<=17){ + this.rank = "Professional" + } + else if(this.level<=20){ + this.rank = "Champion" + } + else if(this.level<=23){ + this.rank = "Beginner" + } + else if(this.level<=26){ + this.rank = "Legend" + } + else if(this.level<=26){ + this.rank = "Invincible" + } + else if(this.level<=29){ + this.rank = "Divine" + } + } + fun addItem(item: Item) { + val findItem = items.find { it.name == item.name } + if(findItem!= null){ + findItem.stack += 1 + } + else{items.add(item)} + } + + fun gainXp(xp: Int) { + this.xp += xp + if (this.xp >= this.level *100){ + this.level +=1 + this.xp = 0 + changeRank() + } + } + + fun removeItem(item: Item) { + items.remove(item) + } + + + +} \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/java/com/example/shakecraft/model/Recipe.kt b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/model/Recipe.kt new file mode 100644 index 0000000..d42bcfa --- /dev/null +++ b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/model/Recipe.kt @@ -0,0 +1,4 @@ +package com.example.shakecraft.model + +class Recipe(val item: Item, val quantity: Int, itemsNeeded : List) { +} \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/java/com/example/shakecraft/view/adapter/AdapterBossLoot.kt b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/view/adapter/AdapterBossLoot.kt new file mode 100644 index 0000000..bfb0da3 --- /dev/null +++ b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/view/adapter/AdapterBossLoot.kt @@ -0,0 +1,54 @@ +package com.example.shakecraft.view.adapter + +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.ImageView +import android.widget.TextView +import androidx.recyclerview.widget.RecyclerView + +import com.example.shakecraft.R +import com.example.shakecraft.model.Item + + +class AdapterBossLoot(private val possibleLoot: List>) : RecyclerView.Adapter() { + + class ViewHolder(view: View) : RecyclerView.ViewHolder(view) { + val textView: TextView + val textViewDropRate: TextView + var imageView: ImageView + + + init { + // Define click listener for the ViewHolder's View + + textView = view.findViewById(R.id.item_name) + textViewDropRate = view.findViewById(R.id.item_stock) + imageView = view.findViewById(R.id.item_image) + } + fun bind(item: Pair) { + textView.text = item.first.name + textViewDropRate.text = (item.second*100).toString() + "%" + imageView.setImageResource(item.first.image) + } + } + + override fun getItemCount() = possibleLoot.size + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.list_loot, parent, false) + + return ViewHolder(view) + } + + + override fun onBindViewHolder(viewHolder: ViewHolder, position: Int) { + val item : Pair = possibleLoot[position] + viewHolder.bind(item) + } + + + + +} + diff --git a/ShakeAndCraft/app/src/main/java/com/example/shakecraft/view/adapter/AdapterInventory.kt b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/view/adapter/AdapterInventory.kt new file mode 100644 index 0000000..c1f9877 --- /dev/null +++ b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/view/adapter/AdapterInventory.kt @@ -0,0 +1,54 @@ +package com.example.shakecraft.view.adapter + +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.ImageView +import android.widget.TextView +import androidx.recyclerview.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView.Adapter +import com.example.shakecraft.R +import com.example.shakecraft.model.Item +import com.example.shakecraft.view.viewholder.ViewHolderInventory + + +class AdapterInventory(private val inventory: List) : RecyclerView.Adapter() { + + class ViewHolder(view: View) : RecyclerView.ViewHolder(view) { + val textView: TextView + val textViewNumber: TextView + var imageView: ImageView + + + init { + // Define click listener for the ViewHolder's View + + textView = view.findViewById(R.id.item_name) + textViewNumber = view.findViewById(R.id.item_stock) + imageView = view.findViewById(R.id.item_image) + } + fun bind(item: Item) { + textView.text = item.name + textViewNumber.text = item.stack.toString() + imageView.setImageResource(item.image) + } + } + + override fun getItemCount() = inventory.size + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.list_item, parent, false) + + return ViewHolder(view) + } + + override fun onBindViewHolder(viewHolder: ViewHolder, position: Int) { + val item : Item = inventory[position] + viewHolder.bind(item) + } + + + + +} + diff --git a/ShakeAndCraft/app/src/main/java/com/example/shakecraft/view/viewholder/ViewHolderInventory.kt b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/view/viewholder/ViewHolderInventory.kt new file mode 100644 index 0000000..309efba --- /dev/null +++ b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/view/viewholder/ViewHolderInventory.kt @@ -0,0 +1,3 @@ +package com.example.shakecraft.view.viewholder +class ViewHolderInventory(inflate: Any?) { +} \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/drawable/back.xml b/ShakeAndCraft/app/src/main/res/drawable/back.xml new file mode 100644 index 0000000..6bd5650 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/drawable/back.xml @@ -0,0 +1,5 @@ + + + diff --git a/ShakeAndCraft/app/src/main/res/drawable/background.png b/ShakeAndCraft/app/src/main/res/drawable/background.png new file mode 100644 index 0000000..d1030ae Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/background.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/backgroundboss.png b/ShakeAndCraft/app/src/main/res/drawable/backgroundboss.png new file mode 100644 index 0000000..5c54fa9 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/backgroundboss.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/backgroundforest.png b/ShakeAndCraft/app/src/main/res/drawable/backgroundforest.png new file mode 100644 index 0000000..96a6c47 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/backgroundforest.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/backgroundforest2.png b/ShakeAndCraft/app/src/main/res/drawable/backgroundforest2.png new file mode 100644 index 0000000..0833adc Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/backgroundforest2.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/banshee.png b/ShakeAndCraft/app/src/main/res/drawable/banshee.png new file mode 100644 index 0000000..5e3962d Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/banshee.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/boss.png b/ShakeAndCraft/app/src/main/res/drawable/boss.png new file mode 100644 index 0000000..9bfd11e Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/boss.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/botom_nav_colors.xml b/ShakeAndCraft/app/src/main/res/drawable/botom_nav_colors.xml new file mode 100644 index 0000000..7a31195 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/drawable/botom_nav_colors.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/drawable/bronze_ore.png b/ShakeAndCraft/app/src/main/res/drawable/bronze_ore.png new file mode 100644 index 0000000..2fe78d9 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/bronze_ore.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/custom_boss_progressbar.xml b/ShakeAndCraft/app/src/main/res/drawable/custom_boss_progressbar.xml new file mode 100644 index 0000000..f3f6c2f --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/drawable/custom_boss_progressbar.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/drawable/custom_collect_progressbar.xml b/ShakeAndCraft/app/src/main/res/drawable/custom_collect_progressbar.xml new file mode 100644 index 0000000..43e1b02 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/drawable/custom_collect_progressbar.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/drawable/custom_level_progressbar.xml b/ShakeAndCraft/app/src/main/res/drawable/custom_level_progressbar.xml new file mode 100644 index 0000000..b04a88f --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/drawable/custom_level_progressbar.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/drawable/diamond.png b/ShakeAndCraft/app/src/main/res/drawable/diamond.png new file mode 100644 index 0000000..d86f073 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/diamond.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/edit_text_background.xml b/ShakeAndCraft/app/src/main/res/drawable/edit_text_background.xml new file mode 100644 index 0000000..c90c2f1 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/drawable/edit_text_background.xml @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/drawable/halberdier.png b/ShakeAndCraft/app/src/main/res/drawable/halberdier.png new file mode 100644 index 0000000..98a3750 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/halberdier.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/ic_anvil.png b/ShakeAndCraft/app/src/main/res/drawable/ic_anvil.png new file mode 100644 index 0000000..ac1269e Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/ic_anvil.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/ic_home.xml b/ShakeAndCraft/app/src/main/res/drawable/ic_home.xml new file mode 100644 index 0000000..5cc5273 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/drawable/ic_home.xml @@ -0,0 +1,10 @@ + + + diff --git a/ShakeAndCraft/app/src/main/res/drawable/ic_inventory.xml b/ShakeAndCraft/app/src/main/res/drawable/ic_inventory.xml new file mode 100644 index 0000000..0d821da --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/drawable/ic_inventory.xml @@ -0,0 +1,10 @@ + + + diff --git a/ShakeAndCraft/app/src/main/res/drawable/ic_key.png b/ShakeAndCraft/app/src/main/res/drawable/ic_key.png new file mode 100644 index 0000000..0275bdd Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/ic_key.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/ic_launcher_background.xml b/ShakeAndCraft/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..ca3826a --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ShakeAndCraft/app/src/main/res/drawable/ic_plus.xml b/ShakeAndCraft/app/src/main/res/drawable/ic_plus.xml new file mode 100644 index 0000000..1c5d737 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/drawable/ic_plus.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/ShakeAndCraft/app/src/main/res/drawable/ic_search.xml b/ShakeAndCraft/app/src/main/res/drawable/ic_search.xml new file mode 100644 index 0000000..a5687c6 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/drawable/ic_search.xml @@ -0,0 +1,5 @@ + + + diff --git a/ShakeAndCraft/app/src/main/res/drawable/ic_tree.png b/ShakeAndCraft/app/src/main/res/drawable/ic_tree.png new file mode 100644 index 0000000..f5cfd39 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/ic_tree.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/icon.png b/ShakeAndCraft/app/src/main/res/drawable/icon.png new file mode 100644 index 0000000..3d18c37 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/icon.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/image_boss.png b/ShakeAndCraft/app/src/main/res/drawable/image_boss.png new file mode 100644 index 0000000..9d09b93 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/image_boss.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/image_collect.png b/ShakeAndCraft/app/src/main/res/drawable/image_collect.png new file mode 100644 index 0000000..dd835a6 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/image_collect.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/iron_ore.png b/ShakeAndCraft/app/src/main/res/drawable/iron_ore.png new file mode 100644 index 0000000..a5a7a16 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/iron_ore.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/item_background.xml b/ShakeAndCraft/app/src/main/res/drawable/item_background.xml new file mode 100644 index 0000000..d11eca4 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/drawable/item_background.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/drawable/lich.png b/ShakeAndCraft/app/src/main/res/drawable/lich.png new file mode 100644 index 0000000..02a07ea Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/lich.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/log2.png b/ShakeAndCraft/app/src/main/res/drawable/log2.png new file mode 100644 index 0000000..195af4f Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/log2.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/monster_bones.png b/ShakeAndCraft/app/src/main/res/drawable/monster_bones.png new file mode 100644 index 0000000..e36f388 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/monster_bones.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/monster_eyes.png b/ShakeAndCraft/app/src/main/res/drawable/monster_eyes.png new file mode 100644 index 0000000..b3023fd Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/monster_eyes.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/navbar_background.xml b/ShakeAndCraft/app/src/main/res/drawable/navbar_background.xml new file mode 100644 index 0000000..705d735 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/drawable/navbar_background.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/drawable/rounded_border_button.xml b/ShakeAndCraft/app/src/main/res/drawable/rounded_border_button.xml new file mode 100644 index 0000000..265dbe8 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/drawable/rounded_border_button.xml @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/drawable/shake_to_collect.png b/ShakeAndCraft/app/src/main/res/drawable/shake_to_collect.png new file mode 100644 index 0000000..4388d72 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/shake_to_collect.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/skeleton.png b/ShakeAndCraft/app/src/main/res/drawable/skeleton.png new file mode 100644 index 0000000..d303e46 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/skeleton.png differ diff --git a/ShakeAndCraft/app/src/main/res/drawable/toast_notification.xml b/ShakeAndCraft/app/src/main/res/drawable/toast_notification.xml new file mode 100644 index 0000000..5622a8e --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/drawable/toast_notification.xml @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/drawable/treasure_key.png b/ShakeAndCraft/app/src/main/res/drawable/treasure_key.png new file mode 100644 index 0000000..1f0fefb Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/drawable/treasure_key.png differ diff --git a/ShakeAndCraft/app/src/main/res/layout/activity_main.xml b/ShakeAndCraft/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..df9110d --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,36 @@ + + + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/layout/fragment_boss.xml b/ShakeAndCraft/app/src/main/res/layout/fragment_boss.xml new file mode 100644 index 0000000..47403a4 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/layout/fragment_boss.xml @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/layout/fragment_collect.xml b/ShakeAndCraft/app/src/main/res/layout/fragment_collect.xml new file mode 100644 index 0000000..ab0d00c --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/layout/fragment_collect.xml @@ -0,0 +1,280 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/layout/fragment_home.xml b/ShakeAndCraft/app/src/main/res/layout/fragment_home.xml new file mode 100644 index 0000000..e6c6bb6 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/layout/fragment_home.xml @@ -0,0 +1,316 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ShakeAndCraft/app/src/main/res/layout/fragment_inventory.xml b/ShakeAndCraft/app/src/main/res/layout/fragment_inventory.xml new file mode 100644 index 0000000..fda0ffb --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/layout/fragment_inventory.xml @@ -0,0 +1,56 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/layout/fragment_plus.xml b/ShakeAndCraft/app/src/main/res/layout/fragment_plus.xml new file mode 100644 index 0000000..bbc5a23 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/layout/fragment_plus.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/layout/list_item.xml b/ShakeAndCraft/app/src/main/res/layout/list_item.xml new file mode 100644 index 0000000..55970a4 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/layout/list_item.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/layout/list_loot.xml b/ShakeAndCraft/app/src/main/res/layout/list_loot.xml new file mode 100644 index 0000000..60fcd41 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/layout/list_loot.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/menu/nav_menu.xml b/ShakeAndCraft/app/src/main/res/menu/nav_menu.xml new file mode 100644 index 0000000..1571d20 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/menu/nav_menu.xml @@ -0,0 +1,17 @@ + + + + + + + diff --git a/ShakeAndCraft/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/ShakeAndCraft/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..c4a603d --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/ShakeAndCraft/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..c4a603d --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/mipmap-hdpi/ic_launcher.png b/ShakeAndCraft/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..4118708 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/ShakeAndCraft/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/ShakeAndCraft/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..ad87c30 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/ShakeAndCraft/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/ShakeAndCraft/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..1802479 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/ShakeAndCraft/app/src/main/res/mipmap-mdpi/ic_launcher.png b/ShakeAndCraft/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..1c58aec Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/ShakeAndCraft/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/ShakeAndCraft/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..47ffb5a Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/ShakeAndCraft/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/ShakeAndCraft/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..ba3e8db Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/ShakeAndCraft/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/ShakeAndCraft/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..3283123 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/ShakeAndCraft/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/ShakeAndCraft/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..3f1ef4c Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/ShakeAndCraft/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/ShakeAndCraft/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..71d6369 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/ShakeAndCraft/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/ShakeAndCraft/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..2a5b8bb Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/ShakeAndCraft/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/ShakeAndCraft/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..bb5e5a4 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/ShakeAndCraft/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/ShakeAndCraft/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..36d6b5e Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/ShakeAndCraft/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/ShakeAndCraft/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..02584f4 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/ShakeAndCraft/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/ShakeAndCraft/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..4c4366e Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/ShakeAndCraft/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/ShakeAndCraft/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..35b7aa5 Binary files /dev/null and b/ShakeAndCraft/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/ShakeAndCraft/app/src/main/res/navigation/my_nav.xml b/ShakeAndCraft/app/src/main/res/navigation/my_nav.xml new file mode 100644 index 0000000..d579462 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/navigation/my_nav.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/values-night/themes.xml b/ShakeAndCraft/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..44cce77 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/values-night/themes.xml @@ -0,0 +1,18 @@ + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/values/colors.xml b/ShakeAndCraft/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..7b76b62 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #6D8DFC + #1D1C22 + #343339 + #302F35 + #2D2C32 + #ADACB2 + #FF3D3D + #FADB68 + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/values/strings.xml b/ShakeAndCraft/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..753c4d0 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/values/strings.xml @@ -0,0 +1,7 @@ + + ShakeCraft + Inventory + Home + Plus + Hello blank fragment + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/values/themes.xml b/ShakeAndCraft/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..7bf8639 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/values/themes.xml @@ -0,0 +1,19 @@ + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/xml/backup_rules.xml b/ShakeAndCraft/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/main/res/xml/data_extraction_rules.xml b/ShakeAndCraft/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/ShakeAndCraft/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/ShakeAndCraft/app/src/test/java/com/example/shakecraft/ExampleUnitTest.kt b/ShakeAndCraft/app/src/test/java/com/example/shakecraft/ExampleUnitTest.kt new file mode 100644 index 0000000..606dabd --- /dev/null +++ b/ShakeAndCraft/app/src/test/java/com/example/shakecraft/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package com.example.shakecraft + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/ShakeAndCraft/build.gradle b/ShakeAndCraft/build.gradle new file mode 100644 index 0000000..7cadbe8 --- /dev/null +++ b/ShakeAndCraft/build.gradle @@ -0,0 +1,6 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id 'com.android.application' version '7.4.0' apply false + id 'com.android.library' version '7.4.0' apply false + id 'org.jetbrains.kotlin.android' version '1.7.21' apply false +} \ No newline at end of file diff --git a/ShakeAndCraft/gradle.properties b/ShakeAndCraft/gradle.properties new file mode 100644 index 0000000..3c5031e --- /dev/null +++ b/ShakeAndCraft/gradle.properties @@ -0,0 +1,23 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Kotlin code style for this project: "official" or "obsolete": +kotlin.code.style=official +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/ShakeAndCraft/gradle/wrapper/gradle-wrapper.jar b/ShakeAndCraft/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/ShakeAndCraft/gradle/wrapper/gradle-wrapper.jar differ diff --git a/ShakeAndCraft/gradle/wrapper/gradle-wrapper.properties b/ShakeAndCraft/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..c349bcc --- /dev/null +++ b/ShakeAndCraft/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Thu Mar 02 21:55:38 CET 2023 +distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionPath=wrapper/dists +zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/ShakeAndCraft/gradlew b/ShakeAndCraft/gradlew new file mode 100644 index 0000000..4f906e0 --- /dev/null +++ b/ShakeAndCraft/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/ShakeAndCraft/gradlew.bat b/ShakeAndCraft/gradlew.bat new file mode 100644 index 0000000..107acd3 --- /dev/null +++ b/ShakeAndCraft/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/ShakeAndCraft/settings.gradle b/ShakeAndCraft/settings.gradle new file mode 100644 index 0000000..e1e5dcd --- /dev/null +++ b/ShakeAndCraft/settings.gradle @@ -0,0 +1,16 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} +rootProject.name = "Shake&Craft" +include ':app'