private async Task MakeNpc(NPCInfo data, IPlayerGrain player) { var npcGrain = GrainFactory.GetGrain <INPCGrain>(player.GetPrimaryKey().ToString() + "Npc" + data.Id); await npcGrain.SetInfo(data, player); IRoomGrain room = GrainFactory.GetGrain <IRoomGrain>(player.GetPrimaryKey().ToString() + "Room" + data.StartIn); await npcGrain.SetRoomGrain(room); await npcGrain.SetPlayerGuid(await player.GetPlayerGuid()); await player.AddNpc(npcGrain); }
private async Task MakeMonster(MonsterInfo data, IPlayerGrain player) { //var monsterGrain = MonsterGrainFactory.GetGrain(data.Id); //var monsterGrain = MonsterGrainFactory.GetGrain(Guid.NewGuid()); var monsterGrain = GrainFactory.GetGrain <IMonsterGrain>(player.GetPrimaryKey().ToString() + "Monster" + data.Id); //var room = await player.GetRandomRoom(); await monsterGrain.SetInfo(data, player); IRoomGrain room = GrainFactory.GetGrain <IRoomGrain>(player.GetPrimaryKey().ToString() + "Room" + data.StartIn); await monsterGrain.SetRoomGrain(room); await monsterGrain.SetPlayerGuid(await player.GetPlayerGuid()); await player.AddMonster(monsterGrain); }
private async Task MakeNpc(NPCInfo data, IPlayerGrain player) { var npcGrain = GrainFactory.GetGrain<INPCGrain>(player.GetPrimaryKey().ToString() + "Npc" + data.Id); await npcGrain.SetInfo(data, player); IRoomGrain room = GrainFactory.GetGrain<IRoomGrain>(player.GetPrimaryKey().ToString() + "Room" + data.StartIn); await npcGrain.SetRoomGrain(room); await npcGrain.SetPlayerGuid(await player.GetPlayerGuid()); await player.AddNpc(npcGrain); }
private async Task MakeMonster(MonsterInfo data, IPlayerGrain player) { //var monsterGrain = MonsterGrainFactory.GetGrain(data.Id); //var monsterGrain = MonsterGrainFactory.GetGrain(Guid.NewGuid()); var monsterGrain = GrainFactory.GetGrain<IMonsterGrain>(player.GetPrimaryKey().ToString() + "Monster" + data.Id); //var room = await player.GetRandomRoom(); await monsterGrain.SetInfo(data, player); IRoomGrain room = GrainFactory.GetGrain<IRoomGrain>(player.GetPrimaryKey().ToString() + "Room" + data.StartIn); await monsterGrain.SetRoomGrain(room); await monsterGrain.SetPlayerGuid(await player.GetPlayerGuid()); await player.AddMonster(monsterGrain); }