Exemplo n.º 1
0
        public HomeNavigatorModel()
        {
            ViewObjects = new ViewObjects
            {
                new ViewObject
                {
                    Section = "Кафе",
                    Title = "Меню",
                    View = Dishes,
                    Image = @"Images\Menu.png"
                },

                new ViewObject
                {
                    Section = "Кафе",
                    Title = "Заказы",
                    View = Orders,
                    Image = @"Images\Orders.png"
                },
                new ViewObject
                {
                    Section = "Кафе",
                    Title = "Группы меню",
                    View = DishGroups,
                    IsVisible = EasyRoleSystem.Instance.IsAdmin,
                    Image = @"Images\DishGroups.png"
                },
                new ViewObject
                {
                    Section = "Кафе",
                    Title = "Скидки",
                    View = Discounts,
                    IsVisible = EasyRoleSystem.Instance.IsAdmin,
                    Image = @"Images\Discount.png"
                },
                new ViewObject
                {
                    Section = "Кафе",
                    Title = "Подарки",
                    View = Gifts,
                    IsVisible = EasyRoleSystem.Instance.IsAdmin,
                    Image = @"Images\Gifts.png"
                }
            };


            ShowView = new DelegateCommand<ViewObject>(OnShowExecuted);
//            IsEditable = EasyRoleSystem.Instance.IsAdmin;

            UpdateVisibilities(ViewObjects[0]);
        }
Exemplo n.º 2
0
 public ModuleController()
 {
     ViewObjects = new ViewObjects
                       {
                           new ViewObject
                               {
                                   Section = "Склад",
                                   Title = "Склад",
                                   View = "/WarehousesView",
                                   Image = @"Images\Warehouse.png"
                               },
                           new ViewObject
                               {
                                   Section = "Склад",
                                   Title = "Ингредиенты",
                                   View = "/IngredientsView",
                                   Image = @"Images\Ingredients.png"
                               }
                       };
     ShowViewCommand = new DelegateCommand<ViewObject>(OnShowExecuted);
 }
Exemplo n.º 3
0
        private static int ProcessMessage(int messageIndex)
        {
            Sims3.SimIFace.StopWatch stopWatch = Sims3.SimIFace.StopWatch.Create(Sims3.SimIFace.StopWatch.TickStyles.Milliseconds);
            stopWatch.Start();

            uint message = 0;

            stopWatch.SetElapsedTime(10);
            int readIndex = messageIndex;

            while (message == 0)
            {
                try { message = BitConverter.ToUInt32(messageBuffer, readIndex); readIndex += intSize; }
                catch { }
                while (stopWatch.GetElapsedTime() < 10)
                {
                }
                stopWatch.Restart();
            }

            if (message == (uint)MessageIDs.HandShakeRequest)
            {
                byte[] comfirmBytes = BitConverter.GetBytes((uint)MessageIDs.HandShakeComfirm);
                sendBuffer.Add(comfirmBytes);
                bufferConnected = true;
            }
            else if (message == (uint)MessageIDs.StartGame)
            {
                Sims3.Gameplay.Gameflow.SetGameSpeed(Sims3.SimIFace.Gameflow.GameSpeed.Normal, Sims3.Gameplay.Gameflow.SetGameSpeedContext.GameStates);
                gameStarted = true;
            }
            else if (message == (uint)MessageIDs.GameFlowNormal)
            {
                Sims3.Gameplay.Gameflow.SetGameSpeed(Sims3.SimIFace.Gameflow.GameSpeed.Normal, Sims3.Gameplay.Gameflow.SetGameSpeedContext.GameStates);
            }
            else if (message == (uint)MessageIDs.GameFlowPause)
            {
                Sims3.Gameplay.Gameflow.SetGameSpeed(Sims3.SimIFace.Gameflow.GameSpeed.Pause, Sims3.Gameplay.Gameflow.SetGameSpeedContext.GameStates);
            }
            else if (message == (uint)MessageIDs.InteractionTerrain)
            {
                uint type = BitConverter.ToUInt32(messageBuffer, readIndex); readIndex += intSize;
                if (type == (uint)InteractionTerrainTypes.GoHereSameLot)
                {
                    ulong targetID = BitConverter.ToUInt64(messageBuffer, readIndex); readIndex += longSize;
                    float x        = BitConverter.ToSingle(messageBuffer, readIndex); readIndex += sizeof(float);
                    float y        = BitConverter.ToSingle(messageBuffer, readIndex); readIndex += sizeof(float);
                    float z        = BitConverter.ToSingle(messageBuffer, readIndex); readIndex += sizeof(float);

                    InteractionPriority priority = new InteractionPriority();
                    priority.Level = InteractionPriorityLevel.UserDirected;
                    ObjectGuid guid = new ObjectGuid();
                    guid.Value  = targetID;
                    guid.mValue = targetID;
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(Terrain.GoHere.SameLotSingleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    Terrain.GoHere gohere = new Terrain.GoHere();
                    gohere.Init(ref paras);
                    gohere.SetTargetPosition(new Vector3(x, y, z));
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(gohere);
                }
            }
            else if (message == (uint)MessageIDs.InteractionShared)
            {
                uint  type     = BitConverter.ToUInt32(messageBuffer, readIndex); readIndex += intSize;
                ulong targetID = BitConverter.ToUInt64(messageBuffer, readIndex); readIndex += longSize;
                InteractionPriority priority = new InteractionPriority();
                priority.Level = InteractionPriorityLevel.UserDirected;
                ObjectGuid guid = new ObjectGuid();
                guid.Value  = targetID;
                guid.mValue = targetID;

                if (type == (uint)InteractionSharedTypes.JumpOnObject)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(JumpOnObject.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    JumpOnObject interaction            = new JumpOnObject();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.JumpOffObject)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(JumpOffObject.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    JumpOffObject interaction           = new JumpOffObject();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.SleepAndNapOnObject)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(SleepAndNapOnObject.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras       = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    SleepAndNapOnObject           interaction = new SleepAndNapOnObject();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.StretchOnObject)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(StretchOnObject.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    StretchOnObject interaction         = new StretchOnObject();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.ShooOff)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(ShooOff.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    ShooOff interaction = new ShooOff();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.ShooNeighborPet)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(ShooNeighborPet.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    ShooNeighborPet interaction         = new ShooNeighborPet();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.ShooFromFood)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(ShooFromFood.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    ShooFromFood interaction            = new ShooFromFood();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.ScratchObject)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(ScratchObject.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    ScratchObject interaction           = new ScratchObject();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.PetSingAlong)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(PetSingAlong.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    PetSingAlong interaction            = new PetSingAlong();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.ReactToDisturbance)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(ReactToDisturbance.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras       = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    ReactToDisturbance            interaction = new ReactToDisturbance();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.Sit)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(Sit.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    Sit interaction = new Sit();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.Stand)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(Stand.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    Stand interaction = new Stand();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.ViewObjects)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(ViewObjects.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    ViewObjects interaction             = new ViewObjects();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.Reminisce)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(Reminisce.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    Reminisce interaction = new Reminisce();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.CatchFlies)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(CatchFlies.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    CatchFlies interaction = new CatchFlies();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
            }
            else
            {
                return(-1);
            }
            return(readIndex);
        }
Exemplo n.º 4
0
 public ViewObject(IModelViews node)
 {
     ViewObjects.Add(this);
 }