public void GetPartiesTest() { var mappingConfig = new MapperConfiguration(mc => { mc.AddProfile(new MappingProfile()); }); IMapper mapper = mappingConfig.CreateMapper(); var partyService = new Mock <IService <Models.Party> >(); partyService.Setup(ps => ps.GetAll()).Returns(GetPartiesFromService()); var locationService = new Mock <IService <Models.Location> >(); locationService.Setup(ls => ls.Get(It.IsAny <int>())).Returns(GetLocation1()); var cityService = new Mock <IService <Models.City> >(); cityService.Setup(ls => ls.Get(It.IsAny <int>())).Returns(GetCity1()); var danceService = new Mock <IService <Models.Dance> >(); // Arrange var partyController = new PartyController(partyService.Object, locationService.Object, cityService.Object, danceService.Object, mapper); // Act IEnumerable <PartyResponse> response = partyController.GetParties().Result; // Assert Assert.Equal(GetPartiesResponse().Count(), response.Count()); }
// Use this for initialization void Start() { player = GameObject.Find("Player").GetComponent <PlayerBehavior>(); party = GameObject.Find("PlayerParty").GetComponent <PartyController>(); ui = GameObject.Find("UIController").GetComponent <UIController>(); mainCamera = Camera.main; }
void Start() { party = GameObject.Find("PlayerParty").GetComponent <PartyController>(); loc = 0; dc = GameObject.Find("DialogueController").GetComponent <DialogueController>(); anim = gameObject.GetComponent <Animator>(); switch (facing) { case Direction.Up: anim.Play("IdleUp"); break; case Direction.Down: anim.Play("IdleDown"); break; case Direction.Left: anim.Play("IdleLeft"); break; case Direction.Right: anim.Play("IdleRight"); break; default: break; } }
// TODO Rename this function /// <summary> /// Initialize Packet data to it's Current Room. /// Optional param sets to given room index /// </summary> /// <param name="packet_key"></param> /// <param name="new_room_index">optional; sets the packet to this room index</param> public void InitializePacketToRoom(string packet_key, int new_room_index = -1) { PartyController party = m_questingParties[packet_key].GetComponent <PartyController>(); // TODO aherrera, wspier : should 0 be allowed? That would mean fighting Boss Room right away if (new_room_index >= 0) { party.SetCurrentRoomIndex(new_room_index); } // TODO aherrera : replace this check with something more elegant :/ if (new_room_index >= mDungeonModel.RoomCount) { Debug.LogError("GIVEN INDEX LARGER THAN ARRAY SIZE"); } RoomModel current_room_reference = mDungeonModel.GetRoom(party.GetCurrentRoomIndex()); RoomView currentRoomView = current_room_reference.gameObject.GetComponent <RoomView> (); if (current_room_reference != null) { party.SetRoomTimer(Helper.Epoch.GetEpochTimestamp(current_room_reference.timer_frequency)); currentRoomView.addAdventurer(party.GetAdventurers()[0]); } else { Debug.LogError("DungeonModel::InitializePacketToCurrentRoom -- currentroom not found for string: " + packet_key); } }
public Form1() { InitializeComponent(); JsonData = @"{ ""parties"": [ { ""id"":0, ""name"":""SPD"", ""longname"":""Sozialdemokratische Partei Deutschlands""}, { ""id"":1, ""name"":""CDU"", ""longname"":""Christlich Demokratische Union Deutschlands""}, { ""id"":2, ""name"":""GRÜNE"", ""longname"":""BÜNDNIS 90/DIE GRÜNEN""}, { ""id"":3, ""name"":""FDP"", ""longname"":""Freie Demokratische Partei""}, { ""id"":4, ""name"":""DIE LINKE"", ""longname"":""DIE LINKE""}, { ""id"":5, ""name"":""PIRATEN"", ""longname"":""Piratenpartei Deutschland""}, { ""id"":6, ""name"":""NPD"", ""longname"":""Nationaldemokratische Partei Deutschlands""}, { ""id"":7, ""name"":""Die PARTEI"", ""longname"":""Partei für Arbeit, Rechtsstaat, Tierschutz, Elitenförderung und basisdemokratische Initiative""}, { ""id"":8, ""name"":""RENTNER"", ""longname"":""RENTNER Partei Deutschland""}, { ""id"":9, ""name"":""ÖDP"", ""longname"":""Ökologisch-Demokratische Partei""}, { ""id"":10, ""name"":""AfD"", ""longname"":""Alternative für Deutschland""}, { ""id"":11, ""name"":""HHBL"", ""longname"":""Hamburger Bürger-Liste""}, { ""id"":12, ""name"":""Liberale"", ""longname"":""Neue Liberale""} ] }"; PartyList jsonPartyList = JsonConvert.DeserializeObject <PartyList>(JsonData); JsonParties = jsonPartyList.getParties(); partyCtr = new PartyController(); parties = partyCtr.GetParties(); }
// Use this for initialization void Start () { currentCooldownTime = 0; envr = GameObject.FindObjectOfType<Environment> (); partyController = envr.gameObject.GetComponent<PartyController> (); enemyController = envr.gameObject.GetComponent<EnemyController> (); mainCamera = Camera.main; }
// Use this for initialization void Start() { partyStatsHolders = new List <GameObject>(); itemHolders = new List <GameObject>(); playerParty = GameObject.Find("PlayerParty").GetComponent <PartyController>(); player = playerParty.player; }
void Start() { ui = GameObject.Find("UIController").GetComponent <UIController>(); party = GameObject.Find("PlayerParty").GetComponent <PartyController>(); allowingInput = true; toSay = null; }
/// <summary> /// Advances Packet to the next room. /// Updates packet with new room data. /// Returns : TRUE if packet has completed dungeon /// </summary> /// <param name="packet"></param> public bool UpdatePacketToNextRoom(string packet_key) { PartyController party = m_questingParties[packet_key].GetComponent <PartyController>(); if (party != null) { // We move in the list from last->first bool completed_dungeon = (0 > party.AdvanceRoom()); if (completed_dungeon) { // TODO aherrera : Party has defeated the boss? party.SetState(PartyState.PARTY_SUCCESS); } else { RoomModel party_new_current_room = mDungeonModel.GetRoom(party.GetCurrentRoomIndex()); if (party_new_current_room != null) { InitializePacketToRoom(packet_key); } } return(completed_dungeon); } else { Debug.LogError("DungeonModel::UpdatePacketToNextRoom -- packet not found in list with string: " + packet_key); } // Hey pls don't be here // TODO aherrera : handle these kinds of errors to search out and erase traces of this packet? return(false); }
// Use this for initialization void Start() { toUse = -1; equipLoc = ""; status = GameObject.Find("MenuControllers").GetComponent <StatusMenuController>(); party = GameObject.Find("PlayerParty").GetComponent <PartyController>(); }
public void generateWorld() { Debug.Log("generating world"); Physics.gravity = new Vector3(0, 0, 1f); this.mapGenerationSettings = MapGenerationSettings.loadSettings(applicationPersistentPath); this.mapData = MapData.loadData(applicationPersistentPath); UIController.getInstance().updateSettingsPanel(this.mapGenerationSettings, 0); Map map = MapGenerator.generateMap(0, mapGenerationSettings, mapData, applicationPersistentPath, this.randomGenerator); //UIController.getInstance().setCameraPosition(HexMathHelper.hexToWorldCoords(MapGenerator.mapCenter(this.mapGenerationSettings), MeshMapController.getInstance().getHexSize())); MeshMapController.getInstance().map = map; MeshMapController.getInstance().drawMap(); this.partyGenerationSettings = PartyGenerationSettings.loadSettings(applicationPersistentPath); Party party = PartyGenerator.getInstance().generateParty(applicationPersistentPath, this.partyGenerationSettings); PartyController.getInstance().party = party; PartyController.getInstance().setInitialPosition(MapGenerator.mapCenter(this.mapGenerationSettings)); UIController.getInstance().showPartyInfo(); UIController.getInstance().startingMenuPanel.SetActive(false); UIController.getInstance().inGamePanel.SetActive(true); this.currentTime = this.partyGenerationSettings.nightTime; }
/// <summary> /// Triggered when battle has been lost /// </summary> /// <param name="_controller">The controller of the losing side</param> private void BattleOver(PartyController _controller) { bool didPlayerOneWin = _controller == EnemyLoader; var _event = didPlayerOneWin ? OnPlayerWin : OnPlayerLose; _event?.Invoke(); string message = didPlayerOneWin ? "Player 1" : "Player 2"; EndButton.enabled = false; UserMessage.Instance.SendMessageToUser(message + " Has won"); if (_previousLevel == null) { Debug.LogWarning("Missing Previous Level"); return; } _previousLevel.DidPlayerOneWin = didPlayerOneWin; FindObjectOfType <EnemyController>().StopAllCoroutines(); StartCoroutine(BattleOverCoroutine()); }
public void Construct(PartyController partyController, string playerName, GameObject memberSlot) { memberSlot.GetComponent <Button>().onClick.AddListener(() => { partyController.CurrentSelectedMember = playerName; }); }
void Start() { party = GameObject.Find("PlayerParty").GetComponent <PartyController>(); flow = GameObject.Find("BattleControllers").GetComponent <BattleFlowController>(); ui = GameObject.Find("BattleControllers").GetComponent <BattleUIController>(); action = Action.Item; }
public static void Postfix(ScreenBase __instance) { if (__instance is GauntletPartyScreen screen && !PartyController.CurrentInstance.WidgetsAdded) { PartyController.AddPartyWidgets(screen); } }
// Use this for initialization void Start() { toUse = -1; ac = GameObject.Find("MenuControllers").GetComponent <AbilityMenuController>(); party = GameObject.Find("PlayerParty").GetComponent <PartyController>(); stat = GameObject.Find("MenuControllers").GetComponent <StatusMenuController>(); }
private void OnTriggerStay2D(Collider2D collision) { //Debug.Log("At inn!!"); if (collision.gameObject.tag == "Party") { PartyController partyController = collision.GetComponent <PartyController>(); if (partyController.fatigue > 0) { partyController.fatigue -= 5 * Time.deltaTime; } if (partyController.Gold > 0) { partyController.Gold -= 0.5f * Time.deltaTime; Gold += 0.5f * Time.deltaTime; } if (Quests.Count > 0 && collision.GetComponent <PartyController>().Quests.Count == 0) { collision.GetComponent <PartyController>().Quests.Add(Quests[0]); Quests.Remove(Quests[0]); OnListChanged(); } if (CharacterList.Characters.Count > 0 && collision.GetComponent <PartyController>().CharacterList.Characters.Count < 4) { collision.GetComponent <PartyController>().CharacterList.Characters.Add(CharacterList.Characters[0]); CharacterList.Characters[0].transform.parent = collision.transform; CharacterList.Characters.Remove(CharacterList.Characters[0]); } } }
/* * ------------------------------------------------------------------------- * MARK: LIFECYCLE FUNCTIONS * ------------------------------------------------------------------------- */ void Awake() { battleController = GameObject.FindGameObjectWithTag("Battle Container").GetComponent <BattleController>(); partyController = GameObject.FindGameObjectWithTag("Party").GetComponent <PartyController>(); enemyController = GameObject.FindGameObjectWithTag("Enemies").GetComponent <EnemyController>(); loadedUnitData = DataSaver.loadData <UnitData>(savedUnitDataFilename); }
public PartyController() { Instance = this; targetOrientation = new Vector3(0, 0, 0); targetPosition = new Vector3(0, 0, 0); LookOffset = Quaternion.identity; dizzyOffset = Quaternion.identity; }
public void moveParty(int movementCost, Vector2 hexCoordinates) { for (int i = 0; i < movementCost; i++) { this.passTurn(); } PartyController.getInstance().setPosition(hexCoordinates); }
public void ResolveChallengeFailure(PartyController party, RoomModel room) { foreach (GameObject adventurer in party.GetAdventurers()) { AdventurerModel a = adventurer.GetComponent <AdventurerModel>(); a.applyDamage(room.room_attack); } }
void Start() { _partyController = PartyController.CreateWithInstantiatingCharacters(_partyView, Context.Party); BossView = R.Boss.GetView(Context.Boss.Id).Instantiate(); BossView.transform.SetParent(_bossOrigin, false); Events.Boss.OnSkillStart += OnBossSkillStart; }
public void Setup(GameObject currentParty, PartyScrollList currentScrollList) { party = currentParty; PartyController partyContoller = party.GetComponent <PartyController>(); goldLabel.text = "Gold: " + partyContoller.Gold.ToString("#0.00"); nameLabel.text = party.gameObject.name; scrollList = currentScrollList; }
//public string AddNewPacket(List<AdventurerModel> party_list, bool automatic_start = false) //{ //} public void RemovePacket(string packet_key) { GameObject party_to_remove = RemovePartyFromDungeon(packet_key); PartyController p = party_to_remove.GetComponent <PartyController> (); // RISK aherrera : is this gonna work? Like, since we're not really returning a reference // to packet_to_remove, will it unregister from the Packet correctly? p.UnRegisterToEvent(HandlePacketTimerUp); }
public void AddInvitesTest() { string testName = "my new event"; DateTime testDate = new DateTime(2012, 3, 6, 11, 3, 5); Person person1 = new Person { FirstName = "Bob", LastName = "Smith" }; Person person2 = new Person { FirstName = "Alice", LastName = "Jones" }; Person person3 = new Person { FirstName = "George", LastName = "Clinton" }; PartyController controller = new PartyController(); int partyId = controller.CreateParty(new Party { Name = testName, Date = testDate }); int personId1 = controller.CreatePerson(person1); int personId2 = controller.CreatePerson(person2); int personId3 = controller.CreatePerson(person3); controller.InvitePeople(partyId, new List <int> { personId1, personId2 }); IEnumerable <Rsvp> rsvpList = controller.GetPartyRsvps(partyId); Assert.AreEqual(rsvpList.Count(), 2); bool foundPerson1 = false; bool foundPerson2 = false; foreach (var rsvp in rsvpList) { if (rsvp.FirstName == person1.FirstName && rsvp.LastName == person1.LastName && rsvp.PersonId == personId1) { foundPerson1 = true; } if (rsvp.FirstName == person2.FirstName && rsvp.LastName == person2.LastName && rsvp.PersonId == personId2) { foundPerson2 = true; } Assert.AreEqual(rsvp.PartyId, partyId); Assert.AreEqual(rsvp.PartyName, testName); } Assert.IsTrue(foundPerson1); Assert.IsTrue(foundPerson2); }
// Use this for initialization void Start() { party = GameObject.Find("PlayerParty").GetComponent <PartyController>(); inv = GameObject.Find("MenuControllers").GetComponent <InventoryMenuController>(); stat = GameObject.Find("MenuControllers").GetComponent <StatusMenuController>(); order = GameObject.Find("MenuControllers").GetComponent <OrderMenuController>(); ability = GameObject.Find("MenuControllers").GetComponent <AbilityMenuController>(); set = GameObject.Find("MenuControllers").GetComponent <SettingsMenuController>(); }
// Use this for initialization void Start() { stat = GameObject.Find("MenuControllers").GetComponent <StatusMenuController>(); party = GameObject.Find("PlayerParty").GetComponent <PartyController>(); eq = GameObject.Find("ItemControllers").GetComponent <EquipController>(); gameObject.transform.SetParent(invPanel.transform, false); UpdateText(); Button theBtn = gameObject.GetComponent <Button>(); theBtn.onClick.AddListener(SendToUse); }
public string AddPartyToDungeon(GameObject new_party) { PartyController pc = new_party.GetComponent <PartyController>(); // TODO aherrera : probably make sure i'm unique string packet_key = checkDictionaryForKey(pc.GetAdventureTitle()); m_questingParties.Add(packet_key, new_party); InitializePacketToRoom(packet_key, mDungeonModel.GetEntrance()); return(packet_key); }
public string AddNewParty(GameObject party, bool automatic_start = false) { PartyController pc = party.GetComponent <PartyController> (); PartyModel pm = party.GetComponent <PartyModel> (); DebugLogger.DebugSystemMessage("Inserting " + pm._AdventureTitle + " Party to Dungeon"); pc.RegisterToEvent(HandlePacketTimerUp); string newPacketKey = AddPartyToDungeon(party); return(newPacketKey); }
private void Awake() { if (!instance) // Singleton pattern { instance = this; } else { Destroy(this.gameObject); } DontDestroyOnLoad(this.gameObject); }
// Use this for initialization void Start() { ui = GameObject.Find("BattleControllers").GetComponent <BattleUIController>(); target = GameObject.Find("BattleControllers").GetComponent <TargetHandler>(); party = GameObject.Find("PlayerParty").GetComponent <PartyController>(); controller = GameObject.Find("BattleControllers").GetComponent <BattleItemController>(); gameObject.transform.SetParent(invPanel.transform, false); StartCoroutine("WaitAndUpdateText"); Button theBtn = gameObject.GetComponent <Button>(); theBtn.onClick.AddListener(SetAction); action = Action.Item; }
public void highlightHex(Vector2 hexCoordinates) { float hexSize = MeshMapController.getInstance().getHexSize(); Vector2 newHighlightPosition = HexMathHelper.hexToWorldCoords(hexCoordinates, hexSize); this.transform.position = new Vector3(newHighlightPosition.x, newHighlightPosition.y, this.transform.position.z); this.gameObject.SetActive(true); int movementCost = PartyController.getInstance().calculateMovementCost(hexCoordinates); //this.showMovementCost(movementCost); this.showHexCoordinates("x:" + hexCoordinates.x + ", y:" + hexCoordinates.y); this.movementCost = movementCost; this.movementTarget = hexCoordinates; }
void OnEnable() { partyController = (PartyController) target; }
void Awake() { instance = this; }
public static PartyController Fixture() { PartyController controller = new PartyController(new PartyRepository(), "", new LoginView()); return controller; }