コード例 #1
0
        public void SendEvent(Vector3 position, MyGlobalEventEnum eventType, int seed, Vector3 up, Vector3 forward)
        {
            var msg = new MyEventEvent();

            msg.Position      = new MyMwcPositionAndOrientation(position, forward, up);
            msg.EventTypeEnum = (int)eventType;
            msg.Seed          = seed;

            Peers.SendToAll(ref msg, NetDeliveryMethod.ReliableOrdered);
        }
コード例 #2
0
ファイル: MyGameWorld.cs プロジェクト: Bunni/Miner-Wars-2081
        public MyGlobalEvent(MyGlobalEventEnum Type, MyTextsWrapperEnum Name, MyTextsWrapperEnum Description, float RatePerHour, MyTexture2D Icon, EventHandler Action, bool WriteToEventLog, bool Enabled)
        {
            this.Type = Type;

            this.Name = Name;
            this.Description = Description;

            this.RatePerHour = RatePerHour; //occurences per hour
            this.ActivationDateTime = null;
            this.Icon = Icon;
            this.Action = Action;
            this.WriteToEventLog = WriteToEventLog;
            this.Enabled = Enabled;
        }
コード例 #3
0
        public MyGlobalEvent(MyGlobalEventEnum Type, MyTextsWrapperEnum Name, MyTextsWrapperEnum Description, float RatePerHour, MyTexture2D Icon, EventHandler Action, bool WriteToEventLog, bool Enabled)
        {
            this.Type = Type;

            this.Name        = Name;
            this.Description = Description;

            this.RatePerHour        = RatePerHour; //occurences per hour
            this.ActivationDateTime = null;
            this.Icon            = Icon;
            this.Action          = Action;
            this.WriteToEventLog = WriteToEventLog;
            this.Enabled         = Enabled;
        }
コード例 #4
0
 public void SendEvent(Vector3 position, MyGlobalEventEnum eventType, int seed)
 {
     SendEvent(position, eventType, seed, Vector3.Up, Vector3.Forward);
 }
コード例 #5
0
ファイル: MyGameWorld.cs プロジェクト: Bunni/Miner-Wars-2081
 public MyGlobalEvent(MyGlobalEventEnum Type, MyTextsWrapperEnum Name, MyTextsWrapperEnum Description, DateTime activationDateTime, MyTexture2D Icon, EventHandler Action, bool WriteToEventLog, bool Enabled)
     : this(Type, Name, Description, 0, Icon, Action, WriteToEventLog, Enabled)
 {
     ActivationDateTime = activationDateTime;
 }
コード例 #6
0
ファイル: MyGameWorld.cs プロジェクト: Bunni/Miner-Wars-2081
 public static void SetRatePerHour(MyGlobalEventEnum globalAction, float ratePerHour)
 {
     MyGlobalEvent globalEvent = m_globalEvents[(int)globalAction];
     globalEvent.RatePerHour = ratePerHour;
 }
コード例 #7
0
ファイル: MyGameWorld.cs プロジェクト: Bunni/Miner-Wars-2081
 public static void Enable(MyGlobalEventEnum globalAction, bool enabled)
 {
     MyGlobalEvent globalEvent = m_globalEvents[(int)globalAction];
     globalEvent.Enabled = enabled;
 }
コード例 #8
0
ファイル: MyGameWorld.cs プロジェクト: Bunni/Miner-Wars-2081
 public static void StartGlobalEvent(MyGlobalEventEnum globalAction)
 {
     MyGlobalEvent globalEvent = m_globalEvents[(int)globalAction];
     StartGlobalEvent(globalEvent);
 }
コード例 #9
0
        public static void StartGlobalEvent(MyGlobalEventEnum globalAction)
        {
            MyGlobalEvent globalEvent = m_globalEvents[(int)globalAction];

            StartGlobalEvent(globalEvent);
        }
コード例 #10
0
 public void SendEvent(Vector3 position, MyGlobalEventEnum eventType, int seed)
 {
     SendEvent(position, eventType, seed, Vector3.Up, Vector3.Forward);
 }
コード例 #11
0
 public MyGlobalEvent(MyGlobalEventEnum Type, MyTextsWrapperEnum Name, MyTextsWrapperEnum Description, DateTime activationDateTime, MyTexture2D Icon, EventHandler Action, bool WriteToEventLog, bool Enabled)
     : this(Type, Name, Description, 0, Icon, Action, WriteToEventLog, Enabled)
 {
     ActivationDateTime = activationDateTime;
 }
コード例 #12
0
        public static void SetRatePerHour(MyGlobalEventEnum globalAction, float ratePerHour)
        {
            MyGlobalEvent globalEvent = m_globalEvents[(int)globalAction];

            globalEvent.RatePerHour = ratePerHour;
        }
コード例 #13
0
        public static void Enable(MyGlobalEventEnum globalAction, bool enabled)
        {
            MyGlobalEvent globalEvent = m_globalEvents[(int)globalAction];

            globalEvent.Enabled = enabled;
        }
コード例 #14
0
        public void SendEvent(Vector3 position, MyGlobalEventEnum eventType, int seed, Vector3 up, Vector3 forward)
        {
            var msg = new MyEventEvent();
            msg.Position = new MyMwcPositionAndOrientation(position, forward, up);
            msg.EventTypeEnum = (int)eventType;
            msg.Seed = seed;

            Peers.SendToAll(ref msg, NetDeliveryMethod.ReliableOrdered);
        }
コード例 #15
0
ファイル: MyGameWorld.cs プロジェクト: Bunni/Miner-Wars-2081
 public static MyGlobalEvent GetGlobalEventByType(MyGlobalEventEnum value)
 {
     return m_globalEvents[(int) value];
 }
コード例 #16
0
ファイル: MyEventLog.cs プロジェクト: whztt07/Miner-Wars-2081
 public void AddGlobalEvent(MyGlobalEventEnum eventID)
 {
     AddEvent((int)eventID, EventTypeEnum.GlobalEvent);
 }
コード例 #17
0
 public static MyGlobalEvent GetGlobalEventByType(MyGlobalEventEnum value)
 {
     return(m_globalEvents[(int)value]);
 }