Example #1
0
        public ObjectInfoPacket(ObjectId id, ModelId type, Location3D location, Color?color)
        {
            Id       = id;
            Type     = type;
            Location = location;

            ushort packetLength = (ushort)(color.HasValue ? 17 : 15);
            var    payload      = new byte[packetLength];
            var    writer       = new ArrayPacketWriter(payload);

            writer.WriteByte((byte)PacketDefinitions.ObjectInfo.Id);
            writer.WriteUShort(packetLength);
            writer.WriteId(id);
            writer.WriteModelId(type);
            writer.WriteUShort((ushort)location.X);
            ushort y = (ushort)(color.HasValue ? location.Y | 0x8000 : location.Y);

            writer.WriteUShort(y);
            writer.WriteSByte((sbyte)location.Z);

            if (color.HasValue)
            {
                writer.WriteColor(color.Value);
            }

            rawPacket = new Packet(PacketDefinitions.ObjectInfo.Id, payload);
        }
Example #2
0
        public IActionResult GetViewData(
            [FromQuery] string view,
            ModelId modelId,
            string method,
            [FromQuery] int?primaryId,
            [FromQuery] int?secondaryId,
            [FromQuery] string primaryKey,
            [FromQuery] string secondaryKey,
            [FromQuery] bool?primaryOption,
            [FromQuery] bool?secondaryOption,
            [FromQuery] DateTime?primaryDateTime,
            [FromQuery] DateTime?secondaryDateTime)
        {
            object[] parameters = ParameterHelper.GetParameters(
                primaryId,
                secondaryId,
                primaryKey,
                secondaryKey,
                primaryOption,
                secondaryOption,
                primaryDateTime,
                secondaryDateTime);

            try
            {
                object viewModel = _modelService.GetViewModel(modelId, method, parameters);
                return(View(view.ToLower(), viewModel));
            }
            catch
            {
                return(View(ReservedPage.InternalError.ToString()));
            }
        }
Example #3
0
        public ModelId AddDocumentFile(string serverUrl, string loginId, string authToken, DocumentFile documentFile)
        {
            System.Diagnostics.Debug.WriteLine("updated " + documentFile.FileUpdatedAt.ToString());
            var service      = new RestService(serverUrl);
            var urlParameter = this.CreateUrlParameter(authToken);
            var parameter    = new
            {
                documentFile = new
                {
                    fileName      = documentFile.FileName,
                    filePath      = documentFile.FilePath,
                    fileContent   = documentFile.FileContent,
                    fileHash      = documentFile.FileHash,
                    fileCreatedAt = documentFile.FileCreatedAt.ToString(),
                    fileUpdatedAt = documentFile.FileUpdatedAt.ToString()
                }
            };

            Logger.Info("fileContent length : " + documentFile.FileContent.Length);

            var response = service.Post("document/file?authToken={authToken}", urlParameter, parameter);

            this.HandleException(response);

            var content = response.Content;

            Logger.Info(content);

            var map     = JsonConvert.DeserializeObject <Dictionary <string, string> >(response.Content);
            var modelId = new ModelId(map["documentId"]);

            return(modelId);
        }
Example #4
0
 public DialogBoxResponse(byte index, ModelId type, Color color, string text)
 {
     Index = index;
     Type  = type;
     Color = color;
     Text  = text;
 }
Example #5
0
 public async Task <Blessing> GetBlessing(ModelId <Blessing> blessingId)
 {
     using (IDbConnection db = new SqlConnection(""))
     {
         return(await db.QuerySingleAsync <Blessing>(GetQuery, new { ModelId = blessingId }));
     }
 }
 public void Deserialize(ParsedByteArray cmd)
 {
     Name = cmd.GetString(32);
     cmd.Skip(8);
     Model = (ModelId)cmd.GetUInt8();
     cmd.Skip(3);
 }
Example #7
0
        public Model GetModel(ModelId modelId)
        {
            if (modelId.Id <= 0)
            {
                return(null);
            }

            if (models.Length <= modelId.Id)
            {
                Array.Resize(ref models, MathHelper.NextPowerOfTwo(ModelId.Count));
            }

            var entry = models[modelId.Id];

            if (entry.LoadState == LoadState.None)
            {
                LoadModel(modelId);

                // Ensures the method returns a valid result when the
                // async load method succeeded synchroniously.
                entry = models[modelId.Id];
            }

            return(entry.LoadState != LoadState.None ? entry.Slice : null);
        }
Example #8
0
        public UpdatePlayerPacket(ObjectId id, ModelId type, Location3D location,
                                  Direction direction, Color color)
        {
            PlayerId     = id;
            Type         = type;
            Location     = location;
            Direction    = direction;
            MovementType = MovementType.Walk;
            Color        = color;
            Flags        = 0;

            byte[] payload = new byte[17];

            var writer = new ArrayPacketWriter(payload);

            writer.WriteByte((byte)PacketDefinitions.UpdatePlayer.Id);
            writer.WriteId(id);
            writer.WriteModelId(type);
            writer.WriteUShort((ushort)location.X);
            writer.WriteUShort((ushort)location.Y);
            writer.WriteSByte((sbyte)location.Z);
            writer.WriteMovement(direction, MovementType.Walk);
            writer.WriteColor(color);
            writer.WriteByte(0);
            writer.WriteByte(0);

            rawPacket = new Packet(PacketDefinitions.UpdateCurrentStamina.Id, payload);
        }
Example #9
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Uid != 0UL)
            {
                hash ^= Uid.GetHashCode();
            }
            if (ModelId != 0)
            {
                hash ^= ModelId.GetHashCode();
            }
            if (ModelLv != 0)
            {
                hash ^= ModelLv.GetHashCode();
            }
            if (Cup != 0)
            {
                hash ^= Cup.GetHashCode();
            }
            if (Uname.Length != 0)
            {
                hash ^= Uname.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Example #10
0
        public ItemSpec(ModelId type, Color?color = null)
        {
            Specificity = color.HasValue ? SpecSpecificity.TypeAndColor : SpecSpecificity.Type;

            Type  = type;
            Color = color;
        }
Example #11
0
 private Option <ModelId> GetOutDatedModelId(ModelEntity e)
 {
     return(from raw in e.Get(CurrentTechnology.ModelIdTag)
            from modelId in ModelId.Parse(raw)
            where modelId.IsPredecessorOf(CurrentTechnology.ModelId)
            select modelId);
 }
Example #12
0
        private async Task LoadModel(ModelId modelId)
        {
            try
            {
                models[modelId.Id].LoadState = LoadState.Loading;

                var data = await loader.Load(modelId.Name);

                if (data == null)
                {
                    await LoadModel(ModelId.Missing);

                    models[modelId.Id].Slice     = models[TextureId.Missing.Id].Slice;
                    models[modelId.Id].LoadState = LoadState.Missing;
                    return;
                }

                models[modelId.Id].Slice     = CreateModel(data);
                models[modelId.Id].LoadState = LoadState.Loaded;
            }
            catch
            {
                // TODO: StackOverflow
                // await LoadModel(ModelId.Error);
                models[modelId.Id].Slice     = models[ModelId.Error.Id].Slice;
                models[modelId.Id].LoadState = LoadState.Failed;
            }
        }
Example #13
0
    public List <GameObject> RetrieveAllyModels()
    {
        List <GameObject> models   = new List <GameObject>();
        List <int>        modelIds = new List <int>();

        foreach (var allyId in GameData.Instance.currentPartyMemberCharacterIds)
        {
            Paradigm allyParadigm = GameData.Instance.allyEquippedSouldParadigms[allyId];
            modelIds.Add(modelInformationDatabase.Find(x => x.characterId == allyId && x.paradigm == allyParadigm).modelId);
        }
        //loops through all ids
        for (int i = 0; i < modelIds.Count; i++)
        {
            //loops through all model info records
            for (int ii = 0; ii < allyDatabase.transform.childCount; ii++)
            {
                ModelId model = allyDatabase.transform.GetChild(ii).GetComponent <ModelId>();

                if (checkedOutAllyModels.ContainsKey(model.GetInstanceID()) == false && model.modelId == modelIds[i])
                {
                    models.Add(model.gameObject);
                    checkedOutAllyModels.Add(model.GetInstanceID(), new Vector2(model.transform.localPosition.x, model.transform.localPosition.y));
                    break;
                }
            }
        }
        return(models);
    }
Example #14
0
 public TargetInfo(Location3D location, TargetType type, ModelId modelId, ObjectId?id)
 {
     Location = location;
     Type     = type;
     ModelId  = modelId;
     Id       = id;
 }
Example #15
0
 public PropertyAttribute(PropertyId propertyId, ModelId childModelId, string displayName = null, bool isList = false)
 {
     PropertyId   = propertyId;
     ChildModelId = childModelId;
     DisplayName  = displayName;
     IsList       = isList;
 }
Example #16
0
        public bool DisableInstance(int sectorInstanceId, ModelId modelId)
        {
            MyModelInstanceData instanceData = null;

            m_instanceParts.TryGetValue(modelId, out instanceData);
            Debug.Assert(instanceData != null, "Could not find instance data in a sector for model " + modelId.ToString());
            if (instanceData == null)
            {
                return(false);
            }

            Debug.Assert(instanceData.InstanceData.Count > sectorInstanceId, "Disabling invalid instance in environment item sector!");
            if (instanceData.InstanceData.Count <= sectorInstanceId)
            {
                return(false);
            }

            var data = instanceData.InstanceData[sectorInstanceId];

            data.InstanceData.LocalMatrix = Matrix.Zero;
            instanceData.InstanceData[sectorInstanceId] = data;

            instanceData.FreeInstances.Enqueue(sectorInstanceId);
            m_sectorItemCount--;
            m_invalidateAABB = true;

            return(true);
        }
Example #17
0
        public void InstallModels()
        {
            // install or update models
            foreach (IViewModel viewModel in _viewModels)
            {
                ModelAttribute modelAttribute = GetAttribute <ModelAttribute>(viewModel);
                Model          model          = _entityBuilder.BuildModel(viewModel.GetType(), modelAttribute);
                _modelRepository.SaveModel(model);
            }

            foreach (IViewModel viewModel in _viewModels)
            {
                ModelId modelId = GetAttribute <ModelAttribute>(viewModel).ModelId;
                _modelRepository.SaveConditionals(GetConditionals(modelId, viewModel));
                _modelRepository.SaveProperties(GetProperties(modelId, viewModel));
            }

            foreach (IViewModelService service in _services)
            {
                MethodInfo[] methods = service.GetType().GetMethods();
                foreach (MethodInfo method in methods)
                {
                    if (TryGetAttribute(method, out EndpointAttribute attribute))
                    {
                        Endpoint endpoint = _entityBuilder.BuildEndpoint(method.Name, attribute);
                        endpoint.ModelId = service.ModelId;
                        _modelRepository.SaveEndpoint(endpoint);

                        List <Parameter> parameters = GetAttributes <ParameterAttribute>(method)
                                                      .Select(p => _entityBuilder.BuildParameter(endpoint.EndpointId, p)).ToList();
                        _modelRepository.SaveParameters(parameters);
                    }
                }
            }
        }
Example #18
0
 public void AddModel(ModelId id, Model model)
 {
     lock (models_)
     {
         models_.Add(Pair.New(id, model));
     }
 }
Example #19
0
 public Item(ObjectId id, ModelId type, ushort amount, Location3D location, Color?color, ObjectId?containerId, Layer?layer)
     : base(id, type, location)
 {
     Amount      = amount;
     Color       = color;
     ContainerId = containerId;
     Layer       = layer;
 }
Example #20
0
 private Dictionary <string, string> CreateUrlParameter(string authToken, ModelId documentId)
 {
     return(new Dictionary <string, string>()
     {
         { "id", documentId.Value },
         { "authToken", authToken }
     });
 }
Example #21
0
        public MobileSpec(ModelId type, Color?color = null)
        {
            Specificity = !string.IsNullOrEmpty(Name) ? SpecSpecificity.Name :
                          color.HasValue ? SpecSpecificity.TypeAndColor : SpecSpecificity.Type;

            Type  = type;
            Color = color;
        }
Example #22
0
 public void ShowMobile(ObjectId id, ModelId type, Location3D location, Color color, Direction direction)
 {
     ShowTracked(id, location);
     if (id.IsMobile)
     {
         ultimaClient.UpdatePlayer(id, type, location, direction, color);
     }
     phantomIds.Add(id);
 }
Example #23
0
        public DrawGamePlayerPacket(ObjectId playerId, ModelId bodyType, Location3D location, Direction direction, MovementType movementType, Color color)
        {
            PlayerId = playerId;
            BodyType = bodyType;
            Location = location;
            Color    = color;

            Serialize();
        }
Example #24
0
        internal Item Update(ModelId type, ushort amount, Location3D location, Color?color, ObjectId?containerId,
                             Layer?layer)
        {
            var updatedItem = Update(type, amount, location, color, containerId);

            updatedItem.Layer = layer;

            return(updatedItem);
        }
Example #25
0
 public JournalEntry(long id, string name, string message, ObjectId speakerId, ModelId type)
 {
     Id        = id;
     Name      = name;
     Message   = message;
     SpeakerId = speakerId;
     Type      = type;
     Created   = DateTime.UtcNow;
 }
 public MyModelInstanceData(MyEnvironmentSector parent, MyStringHash subtypeId, ModelId model, MyInstanceFlagsEnum flags, float maxViewDistance, BoundingBox modelBox)
 {
     Parent = parent;
     SubtypeId = subtypeId;
     Flags = flags;
     MaxViewDistance = maxViewDistance;
     ModelBox = modelBox;
     Model = model;
 }
 public MyModelInstanceData(MyEnvironmentSector parent, MyStringHash subtypeId, ModelId model, MyInstanceFlagsEnum flags, float maxViewDistance, BoundingBox modelBox)
 {
     Parent          = parent;
     SubtypeId       = subtypeId;
     Flags           = flags;
     MaxViewDistance = maxViewDistance;
     ModelBox        = modelBox;
     Model           = model;
 }
Example #28
0
        public bool Matches(ModelId type)
        {
            if (Type.HasValue)
            {
                return(type == Type && !Color.HasValue);
            }

            return(childSpecs.Any(s => s.Matches(type)));
        }
Example #29
0
 internal GreenModel(ModelId id, string name, ModelVersion version)
 {
     this.id             = id;
     this.name           = name;
     this.version        = version;
     this.objects        = ImmutableDictionary <ObjectId, GreenObject> .Empty;
     this.strongObjects  = ImmutableList <ObjectId> .Empty;
     this.lazyProperties = ImmutableDictionary <ObjectId, ImmutableHashSet <Slot> > .Empty;
     this.references     = ImmutableDictionary <ObjectId, ImmutableDictionary <ObjectId, ImmutableHashSet <Slot> > > .Empty;
 }
Example #30
0
        public ObjectId AddNewItemToGround(ModelId type, Location2D location, int amount = 1, Color?color = null)
        {
            var newItemId = NewItemId();

            var packet = new ObjectInfoPacket(newItemId, type, (Location3D)location, color, (ushort?)amount);

            sendPacket(packet.RawPacket.Payload);

            return(newItemId);
        }
Example #31
0
        internal bool ContainsObject(ModelId mid, ObjectId oid)
        {
            GreenModel model;

            if (!this.models.TryGetValue(mid, out model))
            {
                return(false);
            }
            return(model.Objects.ContainsKey(oid));
        }
        public bool DisableInstance(int sectorInstanceId, ModelId modelId)
        {
            MyModelInstanceData instanceData = null;
            m_instanceParts.TryGetValue(modelId, out instanceData);
            Debug.Assert(instanceData != null, "Could not find instance data in a sector for model " + modelId.ToString());
            if (instanceData == null) return false;

            Debug.Assert(instanceData.InstanceData.Count > sectorInstanceId, "Disabling invalid instance in environment item sector!");
            if (instanceData.InstanceData.Count <= sectorInstanceId) return false;

            var data = instanceData.InstanceData[sectorInstanceId];
            data.InstanceData.LocalMatrix = Matrix.Zero;
            instanceData.InstanceData[sectorInstanceId] = data;

            instanceData.FreeInstances.Enqueue(sectorInstanceId);
            m_sectorItemCount--;
            m_invalidateAABB = true;

            return true;
        }
        /// <summary>
        /// Adds instance of the given model. Local matrix specified might be changed internally for renderer (must be used for removing instances).
        /// </summary>
        /// <param name="subtypeId"></param>
        /// <param name="localMatrix">Local transformation matrix. Changed to internal matrix.</param>
        /// <param name="colorMaskHsv"></param>
        public int AddInstance(
            MyStringHash subtypeId, 
            ModelId modelId,
            int localId,
            ref Matrix localMatrix, 
            BoundingBox localAabb, 
            MyInstanceFlagsEnum instanceFlags, 
            float maxViewDistance,
            Vector4 colorMaskHsv = default(Vector4))
        {
            MyModelInstanceData builderInstanceData;
            if (!m_instanceParts.TryGetValue(modelId, out builderInstanceData))
            {
                builderInstanceData = new MyModelInstanceData(subtypeId, instanceFlags, maxViewDistance, localAabb);
                m_instanceParts.Add(modelId, builderInstanceData);
            }

            MySectorInstanceData newInstance = new MySectorInstanceData()
            {
                LocalId = localId,
                InstanceData = new MyInstanceData()
                {
                ColorMaskHSV = new VRageMath.PackedVector.HalfVector4(colorMaskHsv),
                LocalMatrix = localMatrix
                }
            };
            int sectorInstanceId = builderInstanceData.AddInstanceData(ref newInstance);

            // Matrix has been changed due to packing.
            localMatrix = builderInstanceData.InstanceData[sectorInstanceId].InstanceData.LocalMatrix;
            Debug.Assert(builderInstanceData.InstanceData[sectorInstanceId].InstanceData.LocalMatrix == localMatrix, "Bad matrix");

            m_AABB = m_AABB.Include(localAabb.Transform(localMatrix));
            m_sectorItemCount++;
            m_invalidateAABB = true;

            return sectorInstanceId;
        }
        /// <summary>
        /// Adds instance of the given model. Local matrix specified might be changed internally for renderer (must be used for removing instances).
        /// </summary>
        /// <param name="subtypeId"></param>
        /// <param name="localMatrix">Local transformation matrix. Changed to internal matrix.</param>
        /// <param name="colorMaskHsv"></param>
        public int AddInstance(
            MyStringHash subtypeId, 
            ModelId modelId,
            int localId,
            ref Matrix localMatrix, 
            BoundingBox localAabb, 
            MyInstanceFlagsEnum instanceFlags, 
            float maxViewDistance,
            Vector4 colorMaskHsv = default(Vector4),
            Vector2I uvOffset = default(Vector2I))
        {
            MyModelInstanceData builderInstanceData;

            using (m_instancePartsLock.AcquireExclusiveUsing())
            {
                if (!m_instanceParts.TryGetValue(modelId, out builderInstanceData))
                {
                    builderInstanceData = new MyModelInstanceData(subtypeId, instanceFlags, maxViewDistance, localAabb);
                    m_instanceParts.Add(modelId, builderInstanceData);
                }
            }


            uvOffset = new Vector2I(MyUtils.GetRandomInt(2), MyUtils.GetRandomInt(2));
            Color green = Color.Green;
            Vector3 hsv = green.ColorToHSVDX11();
            hsv.Y = MyUtils.GetRandomFloat(0.0f, 1.0f);
            colorMaskHsv = new Vector4(hsv, 0);

            MySectorInstanceData newInstance = new MySectorInstanceData()
            {
                LocalId = localId,
                InstanceData = new MyInstanceData()
                {
                    ColorMaskHSV = new VRageMath.PackedVector.HalfVector4(colorMaskHsv),
                    LocalMatrix = localMatrix,
                    UVOffset = new VRageMath.PackedVector.HalfVector2(uvOffset)
                }
            };
            int sectorInstanceId = builderInstanceData.AddInstanceData(ref newInstance);

            // Matrix has been changed due to packing.
            localMatrix = builderInstanceData.InstanceData[sectorInstanceId].InstanceData.LocalMatrix;
            Debug.Assert(builderInstanceData.InstanceData[sectorInstanceId].InstanceData.LocalMatrix == localMatrix, "Bad matrix");

            m_AABB = m_AABB.Include(localAabb.Transform(localMatrix));
            m_sectorItemCount++;
            m_invalidateAABB = true;

            return sectorInstanceId;
        }
        public void UpdateRenderInstanceData(ModelId modelId)
        {
            using (m_instancePartsLock.AcquireSharedUsing())
            {
                MyModelInstanceData instanceData = null;
                m_instanceParts.TryGetValue(modelId, out instanceData);
                Debug.Assert(instanceData != null, "Could not find instance data in a sector for model " + modelId.ToString());
                if (instanceData == null) return;

                instanceData.UpdateRenderInstanceData();
            }
        }
        public bool DisableInstance(int sectorInstanceId, ModelId modelId)
        {
            MyModelInstanceData instanceData = null;
            m_instanceParts.TryGetValue(modelId, out instanceData);
            Debug.Assert(instanceData != null, "Could not find instance data in a sector for model " + modelId.ToString());
            if (instanceData == null)
            {
                return false;
            }

            if (instanceData.DisableInstance(sectorInstanceId))
            {
                m_sectorItemCount--;
                m_invalidateAABB = true;

                return true;
            }
            return false;
        }
Example #37
0
 public static IRecipe GetRecipeNoThrow(this IRecipeService service, ModelId<IRecipe> id)
 {
     try
      {
     return service.GetRecipe (id);
      }
      catch
      {
     return null;
      }
 }
 public IRecipe GetRecipe(ModelId<IRecipe> recipeId)
 {
     throw new NotImplementedException ();
      //return LoadRecipe (recipeId.Id);
 }
        public IRecipe GetRecipe(ModelId<IRecipe> recipeId)
        {
            return new Recipe
             {
            Id=new ModelId<IRecipe>(recipeId.Id),
            Name="Jeremy's Brownie Sensations",
            Servings=new Fraction (12),
            Parts = new List<RecipePart> (new RecipePart []
               {
                  new RecipePart
                  {
                     Name = "Brownie",
                     CookTime = TimeSpan.FromMinutes (30),
                     PreparationTime = TimeSpan.FromMinutes (15),
                     PreparationMethod = new Tag () {Name="Oven"},
                     Temperature = 350,
                     Ingredients = new ObservableCollection<IngredientDetail> (new IngredientDetail []
                     {
                        new IngredientDetail
                        {
                           Index=0,
                           Quantity=4,
                           Ingredient = "Egg",
                           Preparation = "Unbroken,Uncracked,Uncooked",
                        },
                        new IngredientDetail
                        {
                           Index=1,
                           Amount=new Fraction (2),
                           Ingredient = "Sugar, Granulated",
                           Unit = new Unit {Name = "c"},
                        },
                        new IngredientDetail
                        {
                           Index=2,
                           Amount=new Fraction (2),
                           Ingredient = "Vanilla Extract",
                           Unit = new Unit {Name = "tsp"},
                        },

                        new IngredientDetail
                        {
                           Index=3,
                           Amount=new Fraction (1,2),
                           Ingredient = "Oil, Vegetable",
                           Unit = new Unit {Name = "c"},
                        },
                        new IngredientDetail
                        {
                           Index=4,
                           Amount=new Fraction (1,4),
                           Ingredient = "Cocoa Powder",
                           Unit = new Unit {Name = "c"},
                        },

                        new IngredientDetail
                        {
                           Index=5,
                           Amount=new Fraction (1, 1,2),
                           Ingredient = "Flour, All-purpose",
                           Unit = new Unit {Name = "c"},
                        },
                        new IngredientDetail
                        {
                           Index=6,
                           Amount=new Fraction (1,2),
                           Ingredient = "Salt",
                           Unit = new Unit {Name = "tsp"},
                        },
                        new IngredientDetail
                        {
                           Index=7,
                           Amount=new Fraction (1,2),
                           Ingredient = "Baking Powder",
                           Unit = new Unit {Name = "tsp"},
                        },
                     }),
                     Instructions =
            @"1. In small bowl, mix Eggs, Sugar, Vanilla.
            2. In small bowl, mix oil and cocoa.
            3. Fold oil mixture into egg mixture.
            4. In medium bowl, mix remaining dry ingredients. (Be sure to break up soda pockets.)
            5. Fold wet mixture into dry mixture.
            (optionally mix in 1/2 c chocolate chips and/or 1/2 c coconut)
            6. Bake at 350 F for 30 minutes, or until toothpick comes out clean.
            Let cool slowly or top will fall."
                  },
                  new RecipePart
                  {
                     Name = "Frosting",
                     CookTime = TimeSpan.FromMinutes (30),
                     PreparationTime = TimeSpan.FromMinutes (15),
                     Temperature = 32,
                     PreparationMethod = new Tag () {Name="Refridgerator"},
                     Ingredients = new ObservableCollection<IngredientDetail> (new IngredientDetail []
                     {
                        new IngredientDetail
                        {
                           Index=0,
                           Amount=new Fraction(4, 1, 2),
                           Unit = new Unit {Name = "lbs"},
                           Ingredient = "Lion Meat",
                        },
                        new IngredientDetail
                        {
                           Index=1,
                           Amount=new Fraction(4, 1, 2),
                           Ingredient = "Sugar, Powdered",
                           Unit = new Unit {Name = "c"},
                        },
                        new IngredientDetail
                        {
                           Index=2,
                           Amount=new Fraction (2),
                           Ingredient = "Vanilla Extract",
                           Unit = new Unit {Name = "tsp"},
                        },
                     }),
                     Instructions =
            @"1. In large bowl blend meat.
            2. Add vanilla
            3. Blend in sugar."
                  },
               })
             };
        }
 public IRecipe GetRecipe(ModelId<IRecipe> recipeId)
 {
     return LoadRecipe (recipeId.Id);
 }