From e30738d193e03ae52d1512456d72a4530ab9eb46 Mon Sep 17 00:00:00 2001 From: Josh Date: Tue, 23 Jan 2024 11:04:03 -0500 Subject: [PATCH] favorite things --- namedropper/Assets/Resources/categories.yaml | 83 +++++++++++++++++++ namedropper/Assets/Scripts/GameDataManager.cs | 18 +++- namedropper/Assets/Scripts/TopicSelect.cs | 6 +- 3 files changed, 102 insertions(+), 5 deletions(-) diff --git a/namedropper/Assets/Resources/categories.yaml b/namedropper/Assets/Resources/categories.yaml index 1ef7950..40ce589 100644 --- a/namedropper/Assets/Resources/categories.yaml +++ b/namedropper/Assets/Resources/categories.yaml @@ -1,4 +1,87 @@ Topics: +- Topic: Favorite Things + Categories: + - Category: Josh + Elements: + - Shopsin's + - Mangoes + - Lewis & Clark + - Backpack rap + - Jackie Brown + - Marvel Snap + - Jazz saxophone + - Crosswords + - My wife Amanda + - Bonne Maman jelly + - Bukowski + - Nabokov + - Broguelikes + - The Magnetic Fields + - Category: Yalan + Elements: + - Tea with milk + - silky bed sheet + - hot spring + - High ceiling + - furry dog + - Category: Mus + Elements: + - The Good, the Bad & the Ugly + - Dragon Ball Z + - One Piece + - Spider-man + - Killer Queen Arcade + - Sculpting + - Dawn + - Rainy days in + - Smash Bros Melee + - Action figures + - Category: Nik + Elements: + - Chicken Fried steak + - Black Sabbath + - The Kinks + - They Might be Giants + - Led Zeppelin + - Motown + - Disco + - Swimming + - Jiu Jitsu + - 70s Blaxploitation + - Quentin Tarantino + - Super Smash Brothers + - Scott Pilgrim + - The Legend of Zelda + - Hedwig & the Angry Inch + - Cappuccinos + - Philip K Dick + - Vector Displays + - Attack on Titan + - Category: Amanda + Elements: + - bourbon neat + - black coffee + - Hooded sweatshirts + - Books + - Campfires + - Tent camping + - Exploring new places + - L&B Spumoni Gardens + - Sausage, egg and cheese + - black pepper + + - Category: Maria von Trapp + Elements: + - raindrops on roses + - whiskers on kittens + - bright copper kettles + - warm woolen mittens + - cream-colored ponies + - crisp apple strudels + - doorbells + - sleigh bells + - schnitzel with noodles + - Topic: Contemporary TV Categories: - Category: White Lotus diff --git a/namedropper/Assets/Scripts/GameDataManager.cs b/namedropper/Assets/Scripts/GameDataManager.cs index f687cf0..69f6a78 100644 --- a/namedropper/Assets/Scripts/GameDataManager.cs +++ b/namedropper/Assets/Scripts/GameDataManager.cs @@ -22,20 +22,34 @@ public class GameDataManager { _gameData = deserializer.Deserialize(yamlText); } - public TopicData GetRandomTopicData() + public TopicData GetRandomTopicData(bool ignoreFirst=false) { - if (_gameData.Topics.Count == 0) + if (_gameData.Topics.Count == 0 || (ignoreFirst && _gameData.Topics.Count == 1)) { Reset(); } int topicIndex = Random.Range(0, _gameData.Topics.Count); + if (ignoreFirst && topicIndex == 0) + topicIndex = 1; + TopicData topicData = _gameData.Topics[topicIndex]; _gameData.Topics.RemoveAt(topicIndex); return topicData; } + public TopicData GetFirstTopicData() + { + if (_gameData.Topics.Count == 0) + { + Reset(); + } + + TopicData topicData = _gameData.Topics[0]; + return topicData; + } + public CategoryData GetRandomCategoryData(TopicData topicData, bool removeFromTopic = true) { diff --git a/namedropper/Assets/Scripts/TopicSelect.cs b/namedropper/Assets/Scripts/TopicSelect.cs index 521f2e0..8f94dcb 100644 --- a/namedropper/Assets/Scripts/TopicSelect.cs +++ b/namedropper/Assets/Scripts/TopicSelect.cs @@ -244,9 +244,9 @@ public class TopicSelect : Level } } - _topic1Box.TopicData = GameDataManager.Instance.GetRandomTopicData(); - _topic2Box.TopicData = GameDataManager.Instance.GetRandomTopicData(); - _topic3Box.TopicData = GameDataManager.Instance.GetRandomTopicData(); + _topic1Box.TopicData = GameDataManager.Instance.GetRandomTopicData(true); + _topic2Box.TopicData = GameDataManager.Instance.GetFirstTopicData(); + _topic3Box.TopicData = GameDataManager.Instance.GetRandomTopicData(true); _topic1Box.Name = _topic1Box.TopicData.Topic; _topic2Box.Name = _topic2Box.TopicData.Topic; _topic3Box.Name = _topic3Box.TopicData.Topic;